summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstraptest/test_yjit.rb68
-rw-r--r--yjit/src/core.rs39
2 files changed, 102 insertions, 5 deletions
@@ -3667,6 +3667,74 @@ assert_equal 'new', %q{
test
}
assert_equal 'ok', %q{
# Try to compile new method while OOM
def foo
@@ -4158,7 +4158,23 @@ pub fn invalidate_block_version(blockref: &BlockRef) {
}
// For each incoming branch
- for branchref in block.incoming.0.take().iter() {
let branch = unsafe { branchref.as_ref() };
let target_idx = if branch.get_target_address(0) == Some(block_start) {
0
@@ -4198,10 +4214,18 @@ pub fn invalidate_block_version(blockref: &BlockRef) {
let target_next = block.start_addr == branch.end_addr.get();
if target_next {
- // The new block will no longer be adjacent.
- // Note that we could be enlarging the branch and writing into the
- // start of the block being invalidated.
- branch.gen_fn.set_shape(BranchShape::Default);
}
// Rewrite the branch with the new jump target address
@@ -4211,6 +4235,11 @@ pub fn invalidate_block_version(blockref: &BlockRef) {
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.code_size() > old_branch_size {
panic!(
"invalidated branch grew in size (start_addr: {:?}, old_size: {}, new_size: {})",