2022-12-28 13:50:24 -08:00
|
|
|
module RubyVM::MJIT
|
|
|
|
class JITState < Struct.new(
|
2023-01-02 14:11:06 -08:00
|
|
|
:iseq, # @param `RubyVM::MJIT::CPointer::Struct_rb_iseq_t`
|
|
|
|
:pc, # @param [Integer] The JIT target PC
|
|
|
|
:cfp, # @param `RubyVM::MJIT::CPointer::Struct_rb_control_frame_t` The JIT source CFP (before MJIT is called)
|
|
|
|
:block, # @param [RubyVM::MJIT::Block]
|
2022-12-28 13:50:24 -08:00
|
|
|
)
|
|
|
|
def operand(index)
|
|
|
|
C.VALUE.new(pc)[index + 1]
|
|
|
|
end
|
2022-12-31 13:41:32 -08:00
|
|
|
|
|
|
|
def at_current_insn?
|
|
|
|
pc == cfp.pc.to_i
|
|
|
|
end
|
2022-12-28 13:50:24 -08:00
|
|
|
end
|
2022-12-26 14:09:45 -08:00
|
|
|
end
|