RJIT: Fix invokesuper

This commit is contained in:
Takashi Kokubun 2023-03-21 00:10:14 -07:00
parent 832f810dd7
commit c44367265d
2 changed files with 5 additions and 7 deletions

View File

@ -3876,7 +3876,7 @@ module RubyVM::RJIT
C::FL_TEST_RAW(rbasic_klass, C::RMODULE_IS_REFINEMENT) != 0
return CantCompile
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
# Note, not using VM_CALL_ARGS_SIMPLE because sometimes we pass a block.
@ -3907,12 +3907,6 @@ module RubyVM::RJIT
return CantCompile
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
cme_def_type = cme.def.type
if cme_def_type != C::VM_METHOD_TYPE_ISEQ && cme_def_type != C::VM_METHOD_TYPE_CFUNC

View File

@ -329,6 +329,10 @@ module RubyVM::RJIT # :nodoc: all
_cme_addr = cme.to_i
Primitive.cexpr! 'RBOOL(UNDEFINED_METHOD_ENTRY_P((const rb_callable_method_entry_t *)NUM2SIZET(_cme_addr)))'
end
def RCLASS_ORIGIN(klass)
Primitive.cexpr! 'RCLASS_ORIGIN(klass)'
end
end
#