diff options
author | Takashi Kokubun <[email protected]> | 2023-02-13 07:30:25 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-05 23:28:59 -0800 |
commit | 1b0fbd137fb4fa07e1a67fcf75302a80afac0c50 (patch) | |
tree | 2d8364db410e4f290fe7bcb72afea655a2570cd4 /lib/ruby_vm/mjit/jit_state.rb | |
parent | 9bce848b4cde9f0868dee290dfe4249421164252 (diff) |
Implement branchif
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7448
Diffstat (limited to 'lib/ruby_vm/mjit/jit_state.rb')
-rw-r--r-- | lib/ruby_vm/mjit/jit_state.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ruby_vm/mjit/jit_state.rb b/lib/ruby_vm/mjit/jit_state.rb index 6cc14020dc..b90d2f8020 100644 --- a/lib/ruby_vm/mjit/jit_state.rb +++ b/lib/ruby_vm/mjit/jit_state.rb @@ -12,8 +12,9 @@ module RubyVM::MJIT Compiler.decode_insn(C.VALUE.new(pc).*) end - def operand(index) - C.VALUE.new(pc)[index + 1] + def operand(index, signed: false) + addr = pc + (index + 1) * Fiddle::SIZEOF_VOIDP + Fiddle::Pointer.new(addr)[0, Fiddle::SIZEOF_VOIDP].unpack(signed ? 'q' : 'Q')[0] end def at_current_insn? |