diff options
| author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2025-02-06 16:04:29 -0500 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-04-18 21:52:57 +0900 |
| commit | 3305e7626ddbdb0e787fd17cb26eb9ae18e16afe (patch) | |
| tree | 76ac77d7ce9aea00763ea9b783c2085ab69e5e18 | |
| parent | a6872d8feb8fe059cfa6cd72eee55af89ce09709 (diff) | |
Store pc on frame state
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
| -rw-r--r-- | zjit/src/ir.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index c961ec7412..3d9d52f8c3 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -301,12 +301,16 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function { if let Some(block_id) = insn_idx_to_block.get(&insn_idx) { block = *block_id; } + // Get the current pc and opcode let pc = unsafe { rb_iseq_pc_at_idx(iseq, insn_idx.into()) }; + state.pc = pc; + // try_into() call below is unfortunate. Maybe pick i32 instead of usize for opcodes. let opcode: u32 = unsafe { rb_iseq_opcode_at_pc(iseq, pc) } .try_into() .unwrap(); + // Move to the next instruction to compile insn_idx += insn_len(opcode as usize); |
