mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
Implement jump
This commit is contained in:
parent
557bd86402
commit
091c2ee1ac
1 changed files with 14 additions and 3 deletions
|
@ -18,7 +18,7 @@ module RubyVM::MJIT
|
||||||
asm.incr_counter(:mjit_insns_count)
|
asm.incr_counter(:mjit_insns_count)
|
||||||
asm.comment("Insn: #{insn.name}")
|
asm.comment("Insn: #{insn.name}")
|
||||||
|
|
||||||
# 29/101
|
# 30/101
|
||||||
case insn.name
|
case insn.name
|
||||||
when :nop then nop(jit, ctx, asm)
|
when :nop then nop(jit, ctx, asm)
|
||||||
# getlocal
|
# getlocal
|
||||||
|
@ -82,7 +82,7 @@ module RubyVM::MJIT
|
||||||
# invokeblock
|
# invokeblock
|
||||||
when :leave then leave(jit, ctx, asm)
|
when :leave then leave(jit, ctx, asm)
|
||||||
# throw
|
# throw
|
||||||
# jump
|
when :jump then jump(jit, ctx, asm)
|
||||||
# branchif
|
# branchif
|
||||||
when :branchunless then branchunless(jit, ctx, asm)
|
when :branchunless then branchunless(jit, ctx, asm)
|
||||||
# branchnil
|
# branchnil
|
||||||
|
@ -331,7 +331,18 @@ module RubyVM::MJIT
|
||||||
end
|
end
|
||||||
|
|
||||||
# throw
|
# throw
|
||||||
# jump
|
|
||||||
|
# @param jit [RubyVM::MJIT::JITState]
|
||||||
|
# @param ctx [RubyVM::MJIT::Context]
|
||||||
|
# @param asm [RubyVM::MJIT::Assembler]
|
||||||
|
def jump(jit, ctx, asm)
|
||||||
|
# TODO: check ints for backward branches
|
||||||
|
|
||||||
|
pc = jit.pc + C.VALUE.size * (jit.insn.len + jit.operand(0))
|
||||||
|
stub_next_block(jit.iseq, pc, ctx, asm)
|
||||||
|
EndBlock
|
||||||
|
end
|
||||||
|
|
||||||
# branchif
|
# branchif
|
||||||
|
|
||||||
# @param jit [RubyVM::MJIT::JITState]
|
# @param jit [RubyVM::MJIT::JITState]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue