Add another method for debugging
This commit is contained in:
parent
4c1f6750f2
commit
d5752f73d2
@ -90,10 +90,16 @@ if RubyVM::MJIT.enabled?
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Convert encoded VM pointers to insn BINs.
|
||||||
def rb_vm_insn_decode(encoded)
|
def rb_vm_insn_decode(encoded)
|
||||||
Primitive.cexpr! 'INT2NUM(rb_vm_insn_decode(NUM2PTR(encoded)))'
|
Primitive.cexpr! 'INT2NUM(rb_vm_insn_decode(NUM2PTR(encoded)))'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Convert insn BINs to encoded VM pointers. This one is not used by the compiler, but useful for debugging.
|
||||||
|
def rb_vm_insn_encode(bin)
|
||||||
|
Primitive.cexpr! 'PTR2NUM((VALUE)rb_vm_get_insns_address_table()[NUM2INT(bin)])'
|
||||||
|
end
|
||||||
|
|
||||||
def insn_may_depend_on_sp_or_pc(insn, opes)
|
def insn_may_depend_on_sp_or_pc(insn, opes)
|
||||||
_opes_addr = opes.to_i
|
_opes_addr = opes.to_i
|
||||||
Primitive.cexpr! 'RBOOL(insn_may_depend_on_sp_or_pc(NUM2INT(insn), (VALUE *)NUM2PTR(_opes_addr)))'
|
Primitive.cexpr! 'RBOOL(insn_may_depend_on_sp_or_pc(NUM2INT(insn), (VALUE *)NUM2PTR(_opes_addr)))'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user