summaryrefslogtreecommitdiffstats
path: root/object.c
Commit message (Collapse)AuthorAgeFilesLines
* * common.mk: clean upko12008-09-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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: http://svn.ruby-lang.org/repos/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): added metameta-class initialization foryugui2008-09-141-0/+9
| | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@19336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz2008-09-051-4/+4
| | | | | | | a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_freeze): update rdoc to mention RuntimeErrormatz2008-08-291-2/+2
| | | | | | (not TypeError any longer) would be raised. [ruby-dev:35982] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (convert_type): call less rb_intern() less frequentlymatz2008-08-281-2/+32
| | | | | | by using cache structure. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu2008-08-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_untrusted): new method Object#untrusted?.shugo2008-08-131-4/+63
| | | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_superclass): rdoc improvement, a patch fromnobu2008-06-221-0/+6
| | | | | | | Gaston Ramos <ramos.gaston AT gmail.com> in [ruby-core:17371]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu2008-06-181-1/+1
| | | | | | | | | | | | public methods only. [ruby-core:17283] * object.c (convert_type): ditto. * lib/singleton.rb (Singleton#_dump): conversion method should be public. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-0/+2
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_alloc): RDoc updated. a patch from Gastonmatz2008-06-041-2/+15
| | | | | | Ramos <ramos.gaston at gmail.com> in [ruby-core:17073]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-6/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_object, marshal_dump, r_object0, marshal_load): searchnobu2008-05-281-1/+1
| | | | | | | | | private methods too. [ruby-dev:34671] * object.c (convert_type): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * util.c (ruby_strtod): clear errno at the top of our ownmatz2008-05-261-1/+0
| | | | | | impelementation of strtod(3). [ruby-dev:34834] [ruby-dev:34839] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_cstr_to_dbl): should clear errno before callingmatz2008-05-241-0/+1
| | | | | | strtod(3). [ruby-dev:34834] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * math.c (to_flo): rb_Float() accepts even strings for input.matz2008-05-161-7/+1
| | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@16429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_cstr_to_dbl): no need for forceful warning whenmatz2008-05-151-2/+2
| | | | | | | | converting to float. overflow is a nature of float values. * parse.y (parser_yylex): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_cstr_to_dbl): fix for a mere underscore.nobu2008-03-121-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix doc.akr2008-03-091-10/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_mod_freeze): call rb_class_name() directly.matz2008-03-061-1/+1
| | | | | | [ruby-core:15802] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz2008-03-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_cstr_to_dbl): check for successive underscores.nobu2008-03-011-9/+14
| | | | | | | [ruby-dev:33952] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_new): remove encoding assumption of empty string.naruse2008-02-281-1/+1
| | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@15635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (ROBJECT_NUMIV): renamed from ROBJECT_LEN.akr2008-02-251-10/+10
| | | | | | | | | | | | | | | | (ROBJECT_IVPTR): renamed from ROBJECT_PTR. * variable.c: follow the above renaming. * object.c: ditto. * gc.c: ditto. * marshal.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (RObject): add iv_index_tbl for shortcut ofakr2008-02-131-0/+2
| | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@15458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * range.c (range_include): specialize single character stringmatz2008-02-111-2/+8
| | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@15433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_usascii_new{,2}: defined.naruse2008-01-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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: http://svn.ruby-lang.org/repos/ruby/trunk@15244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * load.c (rb_feature_p): get rid of unlimited alloca.nobu2008-01-161-5/+7
| | | | | | | | | * object.c (rb_cstr_to_dbl): ditto. * io.c (mode_enc): fixed uninitialized variable. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enable several rdoc.akr2007-12-241-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, insnhelper.ci, insns.def, object.c, vm.c, vm.h:ko12007-12-181-3/+3
| | | | | | | | | | optimize !@, != method invocation. * id.c, id.h: ditto. * bootstraptest/test_syntax.rb: add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_freeze): preserve frozen state of immediatematz2007-12-181-1/+12
| | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@14294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (op_tbl): remove duplication to avoid symbol aliases.matz2007-12-181-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (Init_Object): singleton_method_{added,removed,undefined}matz2007-12-111-4/+4
| | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@14193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_not_match): wrong test.matz2007-12-091-2/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (expr): redefinable not (!) operator.matz2007-12-091-4/+45
| | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@14162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (concatarray, splatarray): use to_a instead ofmatz2007-12-011-11/+0
| | | | | | | | to_splat. * insnhelper.ci (caller_setup_args): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (nil_plus): remove unused function. [ruby-core:13737]matz2007-11-201-21/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_superclass): should not raise exception formatz2007-11-191-0/+1
| | | | | | BasicObject. [ruby-Bugs-15668] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: introduce 2 macros:ko12007-11-131-10/+10
| | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@13913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c: improve docs for Object.tapdavidflanagan2007-11-081-3/+9
| | | | | | | * ChangeLog: fix bogus dates on my previous entries git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h (NOEX_LOCAL): remove unused local visibility.matz2007-10-111-2/+0
| | | | | | | | * class.c (ins_methods_push): ditto. * class.c (rb_class_local_methods): method removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_ivar_set): fix class instance variable.akr2007-09-291-0/+2
| | | | | | | * object.c (rb_class_real): cl argument may be 0. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_class_real): use BUILTIN_TYPE instead of TYPE.akr2007-09-291-1/+1
| | | | | | | | access flags directly intead of FL_TEST. they are enough because cl argument is a class. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: export rb_ivar_foreach.akr2007-09-281-26/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: provide basic features for M17N.matz2007-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * blockinlining.c: remove "yarv" prefix.ko12007-07-121-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-5/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (instance_variable_get): Restore rdoc markups lost inknu2007-03-031-4/+4
| | | | | | | the last commit. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_ivar_set): RDoc updated according to amatz2007-03-011-4/+6
| | | | | | | suggestion from Brian Candler <B.Candler AT pobox.com>. [ruby-core:10469] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e