Implement initial opt_lt

This commit is contained in:
Takashi Kokubun 2023-01-02 22:53:14 -08:00
parent 21696ad81e
commit a8dec34961
9 changed files with 143 additions and 34 deletions

View file

@ -32,10 +32,10 @@ module RubyVM::MJIT
incr_insn_exit(jit.pc)
# Fix pc/sp offsets for the interpreter
save_pc_and_sp(jit, ctx, asm)
save_pc_and_sp(jit, ctx.dup, asm) # dup to avoid sp_offset update
# Restore callee-saved registers
asm.comment('exit to interpreter')
asm.comment("exit to interpreter on #{pc_to_insn(jit.pc).name}")
asm.pop(SP)
asm.pop(EC)
asm.pop(CFP)
@ -65,6 +65,10 @@ module RubyVM::MJIT
private
def pc_to_insn(pc)
Compiler.decode_insn(C.VALUE.new(pc).*)
end
# @param pc [Integer]
def incr_insn_exit(pc)
if C.mjit_opts.stats