diff options
author | Takashi Kokubun <[email protected]> | 2025-05-12 09:03:46 -0700 |
---|---|---|
committer | <[email protected]> | 2025-05-12 09:03:46 -0700 |
commit | 53a27f114afafcdfea1a6066d01c12e4dc295657 () | |
tree | 8874c7dfa9f678ac654446f9e8a3e8d23f58d43b | |
parent | 0b6cee73295099ce095d3a17c1d00ad8c1907b82 (diff) |
YJIT: Split the block on optimized getlocal/setlocal (#13282)
Notes: Merged-By: k0kubun <[email protected]>
-rw-r--r-- | test/-ext-/debug/test_debug.rb | 49 | ||||
-rw-r--r-- | yjit/src/codegen.rs | 10 |
2 files changed, 54 insertions, 5 deletions
@@ -75,19 +75,58 @@ class TestDebug < Test::Unit::TestCase end assert_equal true, x, '[Bug #15105]' end - # This is a YJIT test, but we can't test this without a C extension that calls - # rb_debug_inspector_open(), so we're testing it using "-test-/debug" here. - def test_yjit_invalidates_setlocal_after_inspector_call val = setlocal_after_proc_call(proc { Bug::Debug.inspector; :ok }) assert_equal :ok, val - end if defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled? private def setlocal_after_proc_call(block) local = block.call # setlocal followed by OPTIMIZED_METHOD_TYPE_CALL itself # split a block using a C call local # getlocal end -end @@ -2445,6 +2445,11 @@ fn gen_getlocal_generic( ep_offset: u32, level: u32, ) -> Option<CodegenStatus> { let local_opnd = if level == 0 && jit.assume_no_ep_escape(asm) { // Load the local using SP register asm.local_opnd(ep_offset) @@ -2535,6 +2540,11 @@ fn gen_setlocal_generic( return Some(KeepCompiling); } let (flags_opnd, local_opnd) = if level == 0 && jit.assume_no_ep_escape(asm) { // Load flags and the local using SP register let flags_opnd = asm.ctx.ep_opnd(VM_ENV_DATA_INDEX_FLAGS as i32); |