YJIT: Apply patches ignoring page_end_reserve (#9015)

This commit is contained in:
Takashi Kokubun 2023-11-23 07:53:12 -08:00 committed by GitHub
parent 95369ac0a3
commit 440b59db10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);