aboutsummaryrefslogtreecommitdiffstats
path: root/vm_method.c
Commit message (Collapse)AuthorAgeFilesLines
* * vm_method.c (rb_clear_cache_by_class): just return if the class hasakr2010-11-021-0/+3
| | | | | | | no method. reported by Eric Wong. [ruby-core:32689] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-5/+2
| | | | | | | | transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss.nobu2010-10-191-2/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-5/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu2010-10-121-2/+3
| | | | | | | | | | | | | | (syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_boundp): revert r28543, r28564.naruse2010-07-211-11/+10
| | | | | | They may be merged in Ruby 2.0. [ruby-core:31217] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_boundp): respond_to?(:protected_method,knu2010-07-071-11/+11
| | | | | | | | true) should return true. Pointed out by Marc-Andre Lafortune. [ruby-dev:41837] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_boundp): Return false for protectedknu2010-07-051-2/+3
| | | | | | | methods when called from Kernel#respond_to?. [ruby-dev:40461] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed trailing spaces.nobu2010-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_intern.h (rb_vm_get_sourceline): add prototype.nobu2010-05-111-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_unlink_method_entry, rb_sweep_method_entry):ko12010-05-051-16/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | added. Unlinked method entries are collected to vm->unlinked_method_entry_list. On the GC timing, mark all method entries which are on all living threads. Only non-marked method entries are collected. This hack prevents releasing living method entry. [Performance Consideration] Since this Method Entry GC (MEGC) doesn't occuer frequently, MEGC will not be a performance bottleneck. However, to traverse living method entries, every control frame push needs to clear cfp->me field. This will be a performance issue (because pushing control frame is occurred frequently). Bug #2777 [ruby-dev:40457] * cont.c (fiber_init): init cfp->me. * gc.c (garbage_collect): kick rb_sweep_method_entry(). * method.h (rb_method_entry_t): add a mark field. * vm.c (invoke_block_from_c): set passed me. * vm.c (rb_thread_mark): mark cfp->me. * vm_core.h (rb_thread_t): add a field passed_me. * vm_core.h (rb_vm_t): add a field unlinked_method_entry_list. * vm_insnhelper.c (vm_push_frame): clear cfp->me at all times. * vm_insnhelper.c (vm_call_bmethod): pass me. * bootstraptest/test_method.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h, vm_method.c: rename some internal functions related toko12010-05-041-13/+16
| | | | | | | | | | | | rb_method_entry_t. rb_add_method_me() -> rb_method_entry_set(). rb_get_method_entry() -> rb_method_entry_without_cache(). rb_gc_mark_method_entry() -> rb_mark_method_entry(). * class.c, proc.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method_def): decrement alias count ofmame2010-04-201-0/+8
| | | | | | | rb_method_definition_t to prevent memory leak. see [ruby-dev:41021]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method_def): workarond fix for redefinitionnaruse2010-04-181-2/+8
| | | | | | | | | of methods. This is because cfp->me uses the rb_method_entry which is freed by redefinition of remove_method. Note that reusing may cause another problem when the usage is changed. [ruby-core:27320] [ruby-core:29464] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method): clear attr.location before rb_ary_new3.wanabe2010-04-091-2/+1
| | | | | | a patch from Masaya TARUI in [Bug #3108] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method): prototype of rb_vm_get_sourceline.nobu2010-03-241-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (rb_method_location): return attr's location if it is setup.wanabe2010-03-221-2/+13
| | | | | | | | | | | | | | | | | | | | [Feature #2084] * NEWS: follow above. * vm_method.c (rb_add_method): save attr's location. * gc.c (mark_method_entry): mark attr's location. * method.h (rb_method_definition_t): add member to save attr's location. * vm_eval.c (vm_call0): follow above. * vm_insnhelper.c (vm_call_method): ditto. * vm_method.c (rb_method_definition_eq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (compile.$(OBJEXT)): dependencies lacking.shyouhei2010-01-201-3/+3
| | | | | | | | | * vm_method.c (rb_add_method_cfunc): invalid initializer for C89 * compile.c (iseq_insns_unification): int might be smaller than int* git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_alias): skip ZSUPER method when searching body ofmame2010-01-081-1/+11
| | | | | | source method. [ruby-dev:39760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed spaces just before tabs.nobu2009-11-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_undef): should raise TypeError if klass is nil.shugo2009-11-181-0/+3
| | | | | | | | 1.instance_eval { undef to_s } causes SEGV before this fix. * test/ruby/test_undef.rb: new tests for undef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_alias): should raise TypeError if klass is nil.shugo2009-11-171-0/+4
| | | | | | | | | 1.instance_eval { alias to_string to_s } causes SEGV before this fix. * test/ruby/test_alias.rb (test_special_const_alias): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (basic_obj_respond_to): call #respond_to_missing?matz2009-10-171-4/+4
| | | | | | always with two arguments. [ruby-core:26090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_boundp): should exclude NOEX_RESPONDS.matz2009-10-091-1/+1
| | | | | | based on the patch from Nikolai Lugovoi. [ruby-core:25949] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (basic_obj_respond_to): should not callmatz2009-10-041-9/+12
| | | | | | | | | | | | | #respond_to_missing? for not implemented methods. [ruby-core:25909] * vm_method.c (rb_method_boundp): returns exceptional value 2 for not-implemented methods when called from #respond_to? (specifies by new contant NOEX_RESPONDS). * method.h (enum): new constant NOEX_RESPONDS added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method_def): no redefinition warning onnobu2009-10-031-0/+1
| | | | | | | undef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method_def): show the location wherenobu2009-09-301-0/+19
| | | | | | | overwritten method was defined. [ruby-dev:39400] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_definition_eq): non-null definition isnobu2009-09-291-3/+2
| | | | | | | not equal to null definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method_def): nothing to do if old method hadnobu2009-09-291-2/+9
| | | | | | | same definition. [ruby-dev:39397] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_entry_eq): fixed a message.nobu2009-09-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25129 ↵matz2009-09-281-0/+2
| | | | b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_entry_eq): suppressed a warning.nobu2009-09-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_entry_eq): method defined from samematz2009-09-261-1/+1
| | | | | | block/proc should be equal. [ruby-core:25755] [ruby-core:24791] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (check_definition): fixed typo.nobu2009-09-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (obj_respond_to_missing): added rdoc.nobu2009-09-251-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_mod_method_defined): should return true or false.nobu2009-09-251-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_mod_method_defined): should return true or false.nobu2009-09-251-3/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (basic_obj_respond_to): new function to fundamentalmatz2009-09-231-10/+27
| | | | | | | | | | behavior for #respond_to? * vm_method.c (basic_obj_respond_to): calls #respond_to_missing method if overridden, to check responsiveness of methods implemented by #method_missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu2009-09-211-7/+7
| | | | | | | | | thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl, tool/instruction.rb: fixed types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method_def): no warning for inheritednobu2009-09-131-1/+2
| | | | | | | method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (CALL_METHOD_HOOK): refined with macro.nobu2009-09-121-21/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (remove_method): typo fixed.nobu2009-09-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_remove_method_id): no definition body isnobu2009-09-121-13/+11
| | | | | | | undefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_alias): hooks are called from rb_add_method_def.nobu2009-09-121-15/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_add_method, rb_add_method_me): call method addednobu2009-09-121-3/+10
| | | | | | | hook after definition. [ruby-core:25536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h (rb_method_definition_t): split from rb_method_entry_tnobu2009-08-281-101/+106
| | | | | | | | | to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_remove_method_id): exported.nobu2009-08-271-4/+8
| | | | | | | * numeric.c (num_sadded): fix for non-ascii method name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_method_entry_eq): deals with optimized methodnobu2009-08-061-0/+2
| | | | | | | properly. [ruby-core:24789] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * method.h : Commas at end of enum list not allowed as of C89shyouhei2009-07-221-1/+2
| | | | | | | | | * vm_method.c (rb_add_method): avoid C++ comment * vm_insnhelper.c (vm_call_cfunc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e