YJIT: invokesuper: Remove cme mid matching check

This check was introduced to match an assertion in the C YJIT when this
was originally introduced. I don't believe it's necessary for
correctness of the generated code.

Co-authored-by: Adam Hess <HParker@github.com>
Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
Co-authored-by: Luan Vieira <luanzeba@github.com>
This commit is contained in:
John Hawthorn 2023-04-19 10:40:40 -07:00
Родитель a42c36c0f1
Коммит 072ef7a1aa
2 изменённых файлов: 19 добавлений и 7 удалений

Просмотреть файл

@ -777,6 +777,25 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
def test_super_with_alias
assert_compiles(<<~'RUBY', insns: %i[invokesuper opt_plus opt_mult], result: 15)
class A
def foo = 1 + 2
end
module M
def foo = super() * 5
alias bar foo
def foo = :bad
end
A.prepend M
A.new.bar
RUBY
end
def test_super_cfunc
assert_compiles(<<~'RUBY', insns: %i[invokesuper], result: "Hello")
class Gnirts < String

Просмотреть файл

@ -7034,13 +7034,6 @@ fn gen_invokesuper(
let current_defined_class = unsafe { (*me).defined_class };
let mid = unsafe { get_def_original_id((*me).def) };
if me != unsafe { rb_callable_method_entry(current_defined_class, (*me).called_id) } {
// Though we likely could generate this call, as we are only concerned
// with the method entry remaining valid, assume_method_lookup_stable
// below requires that the method lookup matches as well
return None;
}
// vm_search_normal_superclass
let rbasic_ptr: *const RBasic = current_defined_class.as_ptr();
if current_defined_class.builtin_type() == RUBY_T_ICLASS