Skip to content

Commit

Permalink
Handle shadowBlocks and outerMethod during become
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Jul 20, 2021
1 parent a1bb0ad commit 6acd834
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,15 @@ public void become(final CompiledCodeObject other) {
CompilerDirectives.transferToInterpreterAndInvalidate();
final Object[] literals2 = other.literals;
final byte[] bytes2 = other.bytes;
final EconomicMap<Integer, CompiledCodeObject> shadowBlocks2 = other.shadowBlocks;
final CompiledCodeObject outerMethod2 = other.outerMethod;
other.setLiteralsAndBytes(literals, bytes);
setLiteralsAndBytes(literals2, bytes2);
other.shadowBlocks = shadowBlocks;
other.outerMethod = outerMethod;
other.callTargetStable.invalidate();
setLiteralsAndBytes(literals2, bytes2);
shadowBlocks = shadowBlocks2;
outerMethod = outerMethod2;
callTargetStable.invalidate();
}

Expand Down Expand Up @@ -516,6 +522,15 @@ public void pointersBecomeOneWay(final Object[] from, final Object[] to) {
setLiteral(j, toPointer);
}
}
if (fromPointer == outerMethod && to[i] instanceof CompiledCodeObject) {
outerMethod = (CompiledCodeObject) to[i];
}
}
// Migrate all shadow blocks
if (shadowBlocks != null) {
for (final CompiledCodeObject shadowBlock : shadowBlocks.getValues()) {
shadowBlock.pointersBecomeOneWay(from, to);
}
}
}

Expand Down

0 comments on commit 6acd834

Please sign in to comment.