diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-11-23 07:53:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-23 10:53:12 -0500 |
commit | 440b59db10bf3cd163092f5b20d32a7654c2d6ff (patch) | |
tree | 8de992538167d87c09f0ab92b25bc98e2e4fc9a2 /yjit | |
parent | 95369ac0a3b326e1cee18e843d409bdf023abc00 (diff) |
YJIT: Apply patches ignoring page_end_reserve (#9015)
Diffstat (limited to 'yjit')
-rw-r--r-- | yjit/src/invariants.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/yjit/src/invariants.rs b/yjit/src/invariants.rs index 2c1d085872..cffdfff117 100644 --- a/yjit/src/invariants.rs +++ b/yjit/src/invariants.rs @@ -526,14 +526,15 @@ pub extern "C" fn rb_yjit_tracing_invalidate_all() { for patch in &patches { assert!(last_patch_end <= patch.inline_patch_pos.raw_ptr(cb), "patches should not overlap"); - let mut asm = crate::backend::ir::Assembler::new(); - asm.jmp(patch.outlined_target_pos.as_side_exit()); - cb.set_write_ptr(patch.inline_patch_pos); cb.set_dropped_bytes(false); - if asm.compile(cb, None).is_none() { - panic!("Failed to apply patch at {:?}", patch.inline_patch_pos); - } + cb.without_page_end_reserve(|cb| { + let mut asm = crate::backend::ir::Assembler::new(); + asm.jmp(patch.outlined_target_pos.as_side_exit()); + if asm.compile(cb, None).is_none() { + panic!("Failed to apply patch at {:?}", patch.inline_patch_pos); + } + }); last_patch_end = cb.get_write_ptr().raw_ptr(cb); } cb.set_pos(old_pos); |