[Bug #6048]. Isolate hash computation for proc
* internal.h: Declaration for above
* vm_method.c (rb_method_definition_hash): Computation for
hash part of a method definition
* method.h: Declaration for above
* test/ruby/test_method.rb: Test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
vm_insnhelper.c: use struct rb_constant_entry_t as entry of
RCLASS_CONST_TBL. RCLASS_CONST_TBL has contained VALUE of constant
directly. Now instead rb_const_entry_t is contained in
RCLASS_CONST_TBL, rb_const_entry_t is managed by malloc, and
have not only the value itself but also visibility flag.
This is another preparation for private constant (see
[ruby-dev:39685][ruby-core:32698]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
#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
* method.h (rb_get_method_entry): added a prototype of the function.
(rb_method_entry_without_cache): more friendly name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
method management. This change affect some VM control stack structure.
* vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some
refactoring.
* insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto.
* vm_core.h, compile.c (iseq_specialized_instruction): remove
VM_CALL_SEND_BIT. use another optimization tech for Kernel#send.
* node.h: remove unused node types.
* ext/objspace/objspace.c (count_nodes): ditto.
* gc.c: add mark/free functions for method entry.
* include/ruby/intern.h: remove decl of
rb_define_notimplement_method_id(). nobody can use it
because noex is not opend.
* iseq.c (iseq_mark): fix to check ic_method is available.
* iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e