summaryrefslogtreecommitdiff
path: root/object.c
AgeCommit message (Collapse)Author
2008-12-31* object.c (rb_to_float): replaced by to_flo definition frommatz
math.c [ruby-dev:37668] * math.c (Need_Float): use rb_to_float(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30* object.c (rb_to_float): prohibit conversion from nil to float.matz
[ruby-dev:37663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29* pack.c (pack_pack): template f should not accept non floatmatz
values. [ruby-dev:37656] * object.c (rb_to_float): new function to type check floats. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* common.mk: clean upko1
- remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-14* object.c (Init_Object): added metameta-class initialization foryugui
BasicObject, Object, and Module. The metameta-classes of them are now the metaclass of Class, as the metameta-calss of Class is. * object.c (boot_defmetametaclass): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz
a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29* object.c (rb_obj_freeze): update rdoc to mention RuntimeErrormatz
(not TypeError any longer) would be raised. [ruby-dev:35982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* object.c (convert_type): call less rb_intern() less frequentlymatz
by using cache structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16* include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* object.c (rb_obj_untrusted): new method Object#untrusted?.shugo
(rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-22* object.c (rb_class_superclass): rdoc improvement, a patch fromnobu
Gaston Ramos <ramos.gaston AT gmail.com> in [ruby-core:17371]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18* marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu
public methods only. [ruby-core:17283] * object.c (convert_type): ditto. * lib/singleton.rb (Singleton#_dump): conversion method should be public. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-04* object.c (rb_obj_alloc): RDoc updated. a patch from Gastonmatz
Ramos <ramos.gaston at gmail.com> in [ruby-core:17073]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* suppress warnings with -Wwrite-string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28* marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu
private methods too. [ruby-dev:34671] * object.c (convert_type): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-26* util.c (ruby_strtod): clear errno at the top of our ownmatz
impelementation of strtod(3). [ruby-dev:34834] [ruby-dev:34839] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24* object.c (rb_cstr_to_dbl): should clear errno before callingmatz
strtod(3). [ruby-dev:34834] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-16* math.c (to_flo): rb_Float() accepts even strings for input.matz
* complex.c (nucomp_to_f): fix wrong message. * complex.c (nucomp_to_r): ditto. * object.c (rb_Float): do not check NaN for error. NaN is a part of valid float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-15* object.c (rb_cstr_to_dbl): no need for forceful warning whenmatz
converting to float. overflow is a nature of float values. * parse.y (parser_yylex): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-12* object.c (rb_cstr_to_dbl): fix for a mere underscore.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-09fix doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-06* object.c (rb_mod_freeze): call rb_class_name() directly.matz
[ruby-core:15802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05* numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz
given. * bignum.c (rb_big_to_s): ditto. * enum.c (enum_first): ditto. * eval_jump.c (rb_f_catch): ditto. * io.c (rb_obj_display): ditto. * class.c (rb_obj_singleton_methods): ditto. * object.c (rb_class_initialize): ditto. * random.c (rb_f_srand): ditto. * range.c (range_step): ditto. * re.c (rb_reg_s_last_match): ditto. * string.c (rb_str_to_i): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_chomp_bang): ditto. * string.c (rb_str_sum): ditto. * string.c (str_modifiable): declare inline. * string.c (str_independent): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01* object.c (rb_cstr_to_dbl): check for successive underscores.nobu
[ruby-dev:33952] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28* string.c (str_new): remove encoding assumption of empty string.naruse
* hash.c ( rb_f_getenv, env_fetch, env_inspect): result of ENV should be always ASCII-8BIT. * object.c (nil_to_s): nil.to_s should be US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-25* include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.akr
(ROBJECT_IVPTR): renamed from ROBJECT_PTR. * variable.c: follow the above renaming. * object.c: ditto. * gc.c: ditto. * marshal.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13* include/ruby/ruby.h (RObject): add iv_index_tbl for shortcut ofakr
RCLASS_IV_INDEX_TBL(rb_obj_class(obj)). (ROBJECT_IV_INDEX_TBL): defined. * object.c (init_copy): initialize iv_index_tbl in struct RObject. * variable.c (ivar_get): use ROBJECT_IV_INDEX_TBL. (rb_ivar_defined): ditto. (obj_ivar_each): ditto. (rb_obj_remove_instance_variable): ditto. (rb_ivar_set): update iv_index_tbl in struct RObject. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-11* range.c (range_include): specialize single character stringmatz
case (e.g. (?a ..?z).include(?x)) for performance. [ruby-core:15481] * string.c (rb_str_upto): specialize single character case. * string.c (rb_str_hash): omit coderange scan for performance. * object.c (rb_check_to_integer): check Fixnum first. * object.c (rb_to_integer): ditto. * string.c (rb_str_equal): inline memcmp to avoid unnecessary rb_str_comparable(). * parse.y (rb_intern2): use US-ASCII encoding. * parse.y (rb_intern_str): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25* string.c (rb_str_usascii_new{,2}: defined.naruse
(rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when empty string. * encoding.c (rb_usascii_encoding, rb_usascii_encindex): defined. (rb_enc_inspect, enc_name, rb_locale_charmap, rb_enc_name_list_i): use rb_str_ascii_new. * array.c (recursive_join, inspect_ary): ditto. * object.c (nil_to_s, nil_inspect, true_to_s, false_to_s, rb_mod_to_s): ditto. * hash.c (inspect_hash, rb_hash_inspect, rb_f_getenv, env_fetch, env_clear, env_to_s, env_inspect): ditto. * numeric.c (flo_to_s, int_chr, rb_fix2str): ditto. * bignum.c (rb_big2str): ditto. * file.c (rb_file_ftype, rb_file_s_dirname, rb_file_s_extname, file_inspect_join, Init_file): ditto. * test/ruby/test_ruby_m17n.rb: add checks for encoding of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-16* load.c (rb_feature_p): get rid of unlimited alloca.nobu
* object.c (rb_cstr_to_dbl): ditto. * io.c (mode_enc): fixed uninitialized variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* $Date$ keyword removed to avoid inclusion of locale dependentakr
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24enable several rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18* compile.c, insnhelper.ci, insns.def, object.c, vm.c, vm.h:ko1
optimize !@, != method invocation. * id.c, id.h: ditto. * bootstraptest/test_syntax.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18* object.c (rb_obj_freeze): preserve frozen state of immediatematz
values in internal hash table, a la generic_ivar. * object.c (rb_obj_frozen_p): check immediate values too. * variable.c (generic_ivar_set): add frozen check fro immediate values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18* parse.y (op_tbl): remove duplication to avoid symbol aliases.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-11* object.c (Init_Object): singleton_method_{added,removed,undefined}matz
hooks should be defined for BasicObject. [ruby-dev:32531] * eval.c (Init_eval): method_missing should be defined for all objects; moved to BasicObject. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* object.c (rb_obj_not_match): wrong test.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* parse.y (expr): redefinable not (!) operator.matz
* parse.y (arg): ditto. * object.c (rb_obj_not): new method "!". * object.c (rb_obj_not_equal): new method "!=". * object.c (rb_obj_not_match): new method "!~". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-01* insns.def (concatarray, splatarray): use to_a instead ofmatz
to_splat. * insnhelper.ci (caller_setup_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20* object.c (nil_plus): remove unused function. [ruby-core:13737]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19* object.c (rb_class_superclass): should not raise exception formatz
BasicObject. [ruby-Bugs-15668] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13* include/ruby/ruby.h: introduce 2 macros:ko1
RFLOAT_VALUE(v), DOUBLE2NUM(dbl). Rename RFloat#value -> RFloat#double_value. Do not touch RFloat#double_value directly. * bignum.c, insns.def, marshal.c, math.c, numeric.c, object.c, pack.c, parse.y, process.c, random.c, sprintf.c, string.c, time.c: apply above changes. * ext/dl/mkcallback.rb, ext/json/ext/generator/generator.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-08* object.c: improve docs for Object.tapdavidflanagan
* ChangeLog: fix bogus dates on my previous entries git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-11* include/ruby/node.h (NOEX_LOCAL): remove unused local visibility.matz
* class.c (ins_methods_push): ditto. * class.c (rb_class_local_methods): method removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-29* variable.c (rb_ivar_set): fix class instance variable.akr
* object.c (rb_class_real): cl argument may be 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-29* object.c (rb_class_real): use BUILTIN_TYPE instead of TYPE.akr
access flags directly intead of FL_TEST. they are enough because cl argument is a class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* include/ruby/intern.h: export rb_ivar_foreach.akr
* include/ruby/ruby.h: modify struct RObject and RClass for optimizing T_OBJECT space. [ruby-dev:31853] (ROBJECT_LEN, ROBJECT_PTR) (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL) (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor defined. * variable.c: support the modified RObject and RClass. * object.c: ditto. * class.c: ditto. * gc.c: ditto. * marshal.c: ditto. * eval_method.ci: use the abstract accessor. * insns.def: ditto. * proc.c: ditto. * struct.c: ditto. * eval.c: ditto. * error.c: ditto. * vm.c: ditto. * insnhelper.ci: ditto. * ext/digest/digest.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* encoding.c: provide basic features for M17N.matz
* parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12* blockinlining.c: remove "yarv" prefix.ko1
* array.c, numeric.c: ditto. * insnhelper.ci, insns.def, vm_evalbody.ci: ditto. * yarvcore.c: removed. * yarvcore.h: renamed to core.h. * cont.c, debug.c, error.c, process.c, signal.c : ditto. * ext/probeprofiler/probeprofiler.c: ditto. * id.c, id.h: added. * inits.c: ditto. * compile.c: rename internal functions. * compile.h: fix debug flag. * eval.c, object.c, vm.c: remove ruby_top_self. use rb_vm_top_self() instead. * eval_intern.h, eval_load: ditto. * gc.c: rename yarv_machine_stack_mark() to rb_gc_mark_machine_stack(). * insnhelper.h: remove unused macros. * iseq.c: add iseq_compile() to create iseq object from source string. * proc.c: rename a internal function. * template/insns.inc.tmpl: remove YARV prefix. * thread.c: * vm.c (rb_iseq_eval): added. * vm.c: move some functions from yarvcore.c. * vm_dump.c: fix to remove compiler warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e