summaryrefslogtreecommitdiff
path: root/lib/ruby_vm/mjit/insn_compiler.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2023-02-28 22:27:22 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 23:28:59 -0800
commit536d8cc51b065315ff463594b5135abb5f1340da (patch)
treeb80b67d32c622bed64b423c7c16d733d442944ee /lib/ruby_vm/mjit/insn_compiler.rb
parent33213542f241709727475a386a3fa189d426b52d (diff)
Fix invokesuper for railsbench
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7448
Diffstat (limited to 'lib/ruby_vm/mjit/insn_compiler.rb')
-rw-r--r--lib/ruby_vm/mjit/insn_compiler.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ruby_vm/mjit/insn_compiler.rb b/lib/ruby_vm/mjit/insn_compiler.rb
index 29a66b4913..a266c11665 100644
--- a/lib/ruby_vm/mjit/insn_compiler.rb
+++ b/lib/ruby_vm/mjit/insn_compiler.rb
@@ -2114,7 +2114,7 @@ module RubyVM::MJIT
# and so only have to do this once at compile time this is fine to always
# check and side exit.
comptime_recv = jit.peek_at_stack(argc)
- unless comptime_recv.kind_of?(current_defined_class)
+ unless C.rb_obj_is_kind_of(comptime_recv, current_defined_class)
return CantCompile
end
@@ -2125,6 +2125,12 @@ module RubyVM::MJIT
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