diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-04-03 22:52:38 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-04-04 00:35:29 -0700 |
commit | 19506650efeb8b19cea3f72d3f95547c5cbc3659 (patch) | |
tree | be5eacc769e42bd350dd5420e265d052f168c9dc /lib/ruby_vm/rjit/jit_state.rb | |
parent | 2c560b976ed86730dfa305266fcc69033f6790cc (diff) |
RJIT: Add --rjit-verify-ctx option
Diffstat (limited to 'lib/ruby_vm/rjit/jit_state.rb')
-rw-r--r-- | lib/ruby_vm/rjit/jit_state.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ruby_vm/rjit/jit_state.rb b/lib/ruby_vm/rjit/jit_state.rb index f31223e478..02a713474e 100644 --- a/lib/ruby_vm/rjit/jit_state.rb +++ b/lib/ruby_vm/rjit/jit_state.rb @@ -27,6 +27,13 @@ module RubyVM::RJIT pc == cfp.pc.to_i end + def peek_at_local(n) + local_table_size = iseq.body.local_table_size + offset = -C::VM_ENV_DATA_SIZE - local_table_size + n + 1 + value = (cfp.ep + offset).* + C.to_ruby(value) + end + def peek_at_stack(depth_from_top) raise 'not at current insn' unless at_current_insn? offset = -(1 + depth_from_top) |