summaryrefslogtreecommitdiff
path: root/vm_method.c
AgeCommit message (Collapse)Author
2012-02-13merge revision(s) 33935,33936,33987: [Backport #5702]naruse
* variable.c (set_const_visibility): Module#private_constant has changed the visibility of only the first argument. Now it changes all of them. [ruby-list:48558] * test/ruby/test_module.rb: add a test for above. * variable.c (set_const_visibility): print a warning when no argument is passwd to Module#private_constant. [ruby-list:48558] * vm_method.c (set_method_visibility): ditto for Module#private_class_method. * variable.c (set_const_visibility): clear inine-cache when constant's visibility is modified. [ruby-dev:44929] * test/ruby/test_module.rb (test_private_constants_clear_inlinecache): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-12merge revision(s) 32527,32567: [Backport #6004]naruse
* vm_method.c (rb_add_method): should not call method_added hook for undef operation. [Bug #5015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-10Revert r34538.naruse
* backport 33935,33936,33987 (fix private constant) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-10merge revision(s) 33935,33936,33987:naruse
* variable.c (set_const_visibility): Module#private_constant has changed the visibility of only the first argument. Now it changes all of them. [ruby-list:48558] * test/ruby/test_module.rb: add a test for above. * variable.c (set_const_visibility): print a warning when no argument is passwd to Module#private_constant. [ruby-list:48558] * vm_method.c (set_method_visibility): ditto for Module#private_class_method. * variable.c (set_const_visibility): clear inine-cache when constant's visibility is modified. [ruby-dev:44929] * test/ruby/test_module.rb (test_private_constants_clear_inlinecache): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28* backport r32669 from trunk.mame
* proc.c (struct METHOD), gc.c (gc_marks), vm_method.c (rb_gc_mark_unlinked_live_method_entries): fix SEGV bug. rb_method_entry_t was free'd even when the method is still on the stack if it is BMETHOD (i.e., Method#call). This is because rb_method_entry_t is embedded in struct METHOD. This commit separates them and marks the live method entries. See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22* vm_method.c (obj_respond_to): fix missing argument.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* method.h, internal.h iseq.h: declare internal functions.akr
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13* vm_core.h, vm_insnhelper.h: move decl. ofko1
ruby_vm_global_state_version and related macros from vm_core.h to vm_insnhelper.h. * vm.c (vm_clear_all_cache): added. This function is called when ruby_vm_global_state_version overflows. TODO: vm_clear_all_inline_method_cache() is only place holder. We need to implement it ASAP. * vm_method.c (vm_clear_global_method_cache): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-12* vm_method.c (rb_clear_cache*): update only vm state version.ko1
* vm_method.c (rb_method_entry_get_without_cache, rb_method_entry): Fill method cache entry with vm state version, and check current vm state version for method (cache) look up. This modification speed-up invaridating of global method cache table. [Ruby 1.9 - Feature #3905] [ruby-core:36908] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29* vm_method.c (rb_clear_cache_by_class): Revert r29673. It madekosaki
a segmentation fault regression. [Bug #4289][ruby-core:34554]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07cancel subversion backfire. sorrymatz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07* gc.c (rb_gc_set_params): allow GC parameter configuration bymatz
environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-05* class.c: fix camelCase to snake_case in documentation code examples.naruse
patched by Andrew Grimm. fixes Bug #4469 * marshal.c: ditto. * proc.c: ditto. * sample/biorhythm.rb: ditto. * vm_eval.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-14* vm_method.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-02* vm_method.c (rb_clear_cache_by_class): just return if the class hasakr
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
2010-10-24* array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu
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
2010-10-19Commit miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-19* test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu
(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
2010-07-21* vm_method.c (rb_method_boundp): revert r28543, r28564.naruse
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
2010-07-07* vm_method.c (rb_method_boundp): respond_to?(:protected_method,knu
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
2010-07-05* vm_method.c (rb_method_boundp): Return false for protectedknu
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
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
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
2010-05-11* eval_intern.h (rb_vm_get_sourceline): add prototype.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-05* vm_method.c (rb_unlink_method_entry, rb_sweep_method_entry):ko1
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
2010-05-04* method.h, vm_method.c: rename some internal functions related toko1
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
2010-04-20* vm_method.c (rb_add_method_def): decrement alias count ofmame
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
2010-04-18* vm_method.c (rb_add_method_def): workarond fix for redefinitionnaruse
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
2010-04-09* vm_method.c (rb_add_method): clear attr.location before rb_ary_new3.wanabe
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
2010-03-24* vm_method.c (rb_add_method): prototype of rb_vm_get_sourceline.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-22* proc.c (rb_method_location): return attr's location if it is setup.wanabe
[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
2010-01-20 * common.mk (compile.$(OBJEXT)): dependencies lacking.shyouhei
* 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
2010-01-08* vm_method.c (rb_alias): skip ZSUPER method when searching body ofmame
source method. [ruby-dev:39760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-26* removed spaces just before tabs.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-18* vm_method.c (rb_undef): should raise TypeError if klass is nil.shugo
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
2009-11-17* vm_method.c (rb_alias): should raise TypeError if klass is nil.shugo
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
2009-10-17* vm_method.c (basic_obj_respond_to): call #respond_to_missing?matz
always with two arguments. [ruby-core:26090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-09* vm_method.c (rb_method_boundp): should exclude NOEX_RESPONDS.matz
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
2009-10-04* vm_method.c (basic_obj_respond_to): should not callmatz
#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
2009-10-03* vm_method.c (rb_add_method_def): no redefinition warning onnobu
undef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-30* vm_method.c (rb_add_method_def): show the location wherenobu
overwritten method was defined. [ruby-dev:39400] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29* vm_method.c (rb_method_definition_eq): non-null definition isnobu
not equal to null definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29* vm_method.c (rb_add_method_def): nothing to do if old method hadnobu
same definition. [ruby-dev:39397] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29* vm_method.c (rb_method_entry_eq): fixed a message.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-28git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25129 ↵matz
b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-27* vm_method.c (rb_method_entry_eq): suppressed a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-26* vm_method.c (rb_method_entry_eq): method defined from samematz
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
2009-09-25* vm_method.c (check_definition): fixed typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25* vm_method.c (obj_respond_to_missing): added rdoc.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e