RJIT: Fix invokesuper
This commit is contained in:
parent
832f810dd7
commit
c44367265d
@ -3876,7 +3876,7 @@ module RubyVM::RJIT
|
|||||||
C::FL_TEST_RAW(rbasic_klass, C::RMODULE_IS_REFINEMENT) != 0
|
C::FL_TEST_RAW(rbasic_klass, C::RMODULE_IS_REFINEMENT) != 0
|
||||||
return CantCompile
|
return CantCompile
|
||||||
end
|
end
|
||||||
comptime_superclass = C.rb_class_get_superclass(current_defined_class)
|
comptime_superclass = C.rb_class_get_superclass(C.RCLASS_ORIGIN(current_defined_class))
|
||||||
|
|
||||||
# Don't JIT calls that aren't simple
|
# Don't JIT calls that aren't simple
|
||||||
# Note, not using VM_CALL_ARGS_SIMPLE because sometimes we pass a block.
|
# Note, not using VM_CALL_ARGS_SIMPLE because sometimes we pass a block.
|
||||||
@ -3907,12 +3907,6 @@ module RubyVM::RJIT
|
|||||||
return CantCompile
|
return CantCompile
|
||||||
end
|
end
|
||||||
|
|
||||||
# workaround -- TODO: Why does this happen?
|
|
||||||
if me.to_i == cme.to_i
|
|
||||||
asm.incr_counter(:invokesuper_same_me)
|
|
||||||
return CantCompile
|
|
||||||
end
|
|
||||||
|
|
||||||
# Check that we'll be able to write this method dispatch before generating checks
|
# Check that we'll be able to write this method dispatch before generating checks
|
||||||
cme_def_type = cme.def.type
|
cme_def_type = cme.def.type
|
||||||
if cme_def_type != C::VM_METHOD_TYPE_ISEQ && cme_def_type != C::VM_METHOD_TYPE_CFUNC
|
if cme_def_type != C::VM_METHOD_TYPE_ISEQ && cme_def_type != C::VM_METHOD_TYPE_CFUNC
|
||||||
|
@ -329,6 +329,10 @@ module RubyVM::RJIT # :nodoc: all
|
|||||||
_cme_addr = cme.to_i
|
_cme_addr = cme.to_i
|
||||||
Primitive.cexpr! 'RBOOL(UNDEFINED_METHOD_ENTRY_P((const rb_callable_method_entry_t *)NUM2SIZET(_cme_addr)))'
|
Primitive.cexpr! 'RBOOL(UNDEFINED_METHOD_ENTRY_P((const rb_callable_method_entry_t *)NUM2SIZET(_cme_addr)))'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def RCLASS_ORIGIN(klass)
|
||||||
|
Primitive.cexpr! 'RCLASS_ORIGIN(klass)'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user