diff options
author | Takashi Kokubun <[email protected]> | 2023-01-02 14:11:06 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-05 22:11:20 -0800 |
commit | 21696ad81ec40cf9cd146836dc8c945f1e485774 (patch) | |
tree | f5d132f2f11c082512790d2c20804910bc658159 /lib/ruby_vm/mjit/insn_compiler.rb | |
parent | 00c659d246784fe98114136bc3eb4d7f02cb071c (diff) |
Partly implement BOP assumption
Diffstat (limited to 'lib/ruby_vm/mjit/insn_compiler.rb')
-rw-r--r-- | lib/ruby_vm/mjit/insn_compiler.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/ruby_vm/mjit/insn_compiler.rb b/lib/ruby_vm/mjit/insn_compiler.rb index debd8361fb..262d33387a 100644 --- a/lib/ruby_vm/mjit/insn_compiler.rb +++ b/lib/ruby_vm/mjit/insn_compiler.rb @@ -4,9 +4,11 @@ module RubyVM::MJIT # 5/101 class InsnCompiler # @param ocb [CodeBlock] - def initialize(ocb) + # @param exit_compiler [RubyVM::MJIT::ExitCompiler] + def initialize(ocb, exit_compiler) @ocb = ocb - @exit_compiler = ExitCompiler.new + @exit_compiler = exit_compiler + @invariants = Invariants.new(ocb, exit_compiler) freeze end @@ -265,6 +267,10 @@ module RubyVM::MJIT defer_compilation(jit, ctx, asm) return EndBlock end + + unless @invariants.assume_bop_not_redefined(jit, C.INTEGER_REDEFINED_OP_FLAG, C.BOP_LT) + return CantCompile + end CantCompile end @@ -350,7 +356,7 @@ module RubyVM::MJIT # @param ctx [RubyVM::MJIT::Context] def compile_side_exit(jit, ctx) asm = Assembler.new - @exit_compiler.compile_exit(jit, ctx, asm) + @exit_compiler.compile_side_exit(jit, ctx, asm) @ocb.write(asm) end end |