* vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
vm_insnhelper.c (vm_search_method): revert r37616 because it's too slow. [ruby-dev:46477] * test/ruby/test_refinement.rb (test_inline_method_cache): skip the test until the bug is fixed efficiently. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6483a1057a
commit
afdfbde4e7
@ -1,3 +1,12 @@
|
|||||||
|
Mon Nov 12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
|
||||||
|
vm_insnhelper.c (vm_search_method): revert r37616 because it's too
|
||||||
|
slow. [ruby-dev:46477]
|
||||||
|
|
||||||
|
* test/ruby/test_refinement.rb (test_inline_method_cache): skip
|
||||||
|
the test until the bug is fixed efficiently.
|
||||||
|
|
||||||
Mon Nov 12 14:28:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Nov 12 14:28:01 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* win32/mkexports.rb (each_export): skip garbages generated by VS2012's
|
* win32/mkexports.rb (each_export): skip garbages generated by VS2012's
|
||||||
|
@ -954,7 +954,6 @@ new_callinfo(rb_iseq_t *iseq, ID mid, int argc, VALUE block, unsigned long flag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ci->vmstat = 0;
|
ci->vmstat = 0;
|
||||||
ci->refinements = Qundef;
|
|
||||||
ci->blockptr = 0;
|
ci->blockptr = 0;
|
||||||
ci->recv = Qundef;
|
ci->recv = Qundef;
|
||||||
ci->call = 0; /* TODO: should set default function? */
|
ci->call = 0; /* TODO: should set default function? */
|
||||||
|
@ -726,6 +726,7 @@ class TestRefinement < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_inline_method_cache
|
def test_inline_method_cache
|
||||||
|
skip "can't implement efficiently with the current implementation of refinements"
|
||||||
c = InlineMethodCache::C.new
|
c = InlineMethodCache::C.new
|
||||||
f = Proc.new { c.foo }
|
f = Proc.new { c.foo }
|
||||||
assert_equal("original", f.call)
|
assert_equal("original", f.call)
|
||||||
|
@ -153,7 +153,6 @@ typedef struct rb_call_info_struct {
|
|||||||
/* inline cache: keys */
|
/* inline cache: keys */
|
||||||
VALUE vmstat;
|
VALUE vmstat;
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
VALUE refinements;
|
|
||||||
|
|
||||||
/* inline cache: values */
|
/* inline cache: values */
|
||||||
const rb_method_entry_t *me;
|
const rb_method_entry_t *me;
|
||||||
|
@ -843,30 +843,19 @@ static void
|
|||||||
vm_search_method(rb_call_info_t *ci, VALUE recv)
|
vm_search_method(rb_call_info_t *ci, VALUE recv)
|
||||||
{
|
{
|
||||||
VALUE klass = CLASS_OF(recv);
|
VALUE klass = CLASS_OF(recv);
|
||||||
NODE *cref = rb_vm_cref();
|
|
||||||
VALUE refinements = Qnil;
|
|
||||||
|
|
||||||
if (cref && !NIL_P(cref->nd_refinements)) {
|
|
||||||
refinements = cref->nd_refinements;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if OPT_INLINE_METHOD_CACHE
|
#if OPT_INLINE_METHOD_CACHE
|
||||||
if (LIKELY(GET_VM_STATE_VERSION() == ci->vmstat && klass == ci->klass &&
|
if (LIKELY(GET_VM_STATE_VERSION() == ci->vmstat && klass == ci->klass)) {
|
||||||
refinements == ci->refinements)) {
|
|
||||||
/* cache hit! */
|
/* cache hit! */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ci->me = rb_method_entry_get_with_refinements(refinements, klass,
|
ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class);
|
||||||
ci->mid,
|
|
||||||
&ci->defined_class);
|
|
||||||
ci->klass = klass;
|
ci->klass = klass;
|
||||||
ci->refinements = refinements;
|
|
||||||
ci->vmstat = GET_VM_STATE_VERSION();
|
ci->vmstat = GET_VM_STATE_VERSION();
|
||||||
ci->call = vm_call_general;
|
ci->call = vm_call_general;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
ci->me = rb_method_entry_get_with_refinements(refinements, klass, ci->mid,
|
ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class);
|
||||||
&ci->defined_class);
|
|
||||||
ci->call = vm_call_general;
|
ci->call = vm_call_general;
|
||||||
ci->klass = klass;
|
ci->klass = klass;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user