diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-02-28 22:27:22 -0800 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-05 23:28:59 -0800 |
| commit | 536d8cc51b065315ff463594b5135abb5f1340da (patch) | |
| tree | b80b67d32c622bed64b423c7c16d733d442944ee /lib/ruby_vm | |
| parent | 33213542f241709727475a386a3fa189d426b52d (diff) | |
Fix invokesuper for railsbench
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7448
Diffstat (limited to 'lib/ruby_vm')
| -rw-r--r-- | lib/ruby_vm/mjit/insn_compiler.rb | 8 | ||||
| -rw-r--r-- | lib/ruby_vm/mjit/stats.rb | 1 |
2 files changed, 8 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 diff --git a/lib/ruby_vm/mjit/stats.rb b/lib/ruby_vm/mjit/stats.rb index 22be01fe34..55146be479 100644 --- a/lib/ruby_vm/mjit/stats.rb +++ b/lib/ruby_vm/mjit/stats.rb @@ -35,6 +35,7 @@ module RubyVM::MJIT $stderr.puts("***MJIT: Printing MJIT statistics on exit***") print_counters(stats, prefix: 'send_', prompt: 'method call exit reasons') + print_counters(stats, prefix: 'invokesuper_', prompt: 'invokesuper exit reasons') print_counters(stats, prefix: 'getivar_', prompt: 'getinstancevariable exit reasons') print_counters(stats, prefix: 'optaref_', prompt: 'opt_aref exit reasons') print_counters(stats, prefix: 'optgetconst_', prompt: 'opt_getconstant_path exit reasons') |
