summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-11-18 17:27:07 -0800
committerGitHub <noreply@github.com>2022-11-18 17:27:07 -0800
commit6dcb7b92169e5bd490bb6eaa4d5b9b7445af464c (patch)
tree19c4f1230e3c977028cc42666ad8f6212b6eb394 /yjit
parent082cfcfd06f85ea5c578f0654431dad5c2f32814 (diff)
YJIT: Improve the failure message on enlarging a branch (#6769)
Notes
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/core.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/yjit/src/core.rs b/yjit/src/core.rs
index 78b4cbdb0c..869c0859b5 100644
--- a/yjit/src/core.rs
+++ b/yjit/src/core.rs
@@ -1851,8 +1851,8 @@ fn branch_stub_hit_body(branch_ptr: *const c_void, target_idx: u32, ec: EcPtr) -
let new_branch_size = branch.code_size();
assert!(
new_branch_size <= branch_size_on_entry,
- "branch stubs should never enlarge branches: (old_size: {}, new_size: {})",
- branch_size_on_entry, new_branch_size,
+ "branch stubs should never enlarge branches (start_addr: {:?}, old_size: {}, new_size: {})",
+ branch.start_addr.unwrap().raw_ptr(), branch_size_on_entry, new_branch_size,
);
// Return a pointer to the compiled block version
@@ -2258,14 +2258,17 @@ pub fn invalidate_block_version(blockref: &BlockRef) {
}
// Rewrite the branch with the new jump target address
- let branch_end_addr = branch.end_addr;
+ let old_branch_size = branch.code_size();
regenerate_branch(cb, &mut branch);
if target_next && branch.end_addr > block.end_addr {
panic!("yjit invalidate rewrote branch past end of invalidated block: {:?} (code_size: {})", branch, block.code_size());
}
- if !target_next && branch.end_addr > branch_end_addr {
- panic!("invalidated branch grew in size: {:?}", branch);
+ if !target_next && branch.code_size() > old_branch_size {
+ panic!(
+ "invalidated branch grew in size (start_addr: {:?}, old_size: {}, new_size: {})",
+ branch.start_addr.unwrap().raw_ptr(), old_branch_size, branch.code_size()
+ );
}
}