Skip to content

Commit

Permalink
Ensure back-jump checks are disabled
Browse files Browse the repository at this point in the history
when interrupt handler is disabled.
  • Loading branch information
fniephaus committed Aug 2, 2024
1 parent 9238b6f commit 64c21b5
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void executeCheck(final VirtualFrame frame) {

public static AbstractUnconditionalJumpNode createUnconditionalShortJump(final CompiledCodeObject code, final AbstractBytecodeNode[] bytecodeNodes, final int index, final int bytecode) {
final int offset = calculateShortOffset(bytecode);
if (needsCheck(bytecodeNodes, index, 1, offset)) {
if (needsCheck(code, bytecodeNodes, index, 1, offset)) {
return new UnconditionalJumpWithCheckNode(code, index, 1, offset);
} else {
return new UnconditionalJumpWithoutCheckNode(code, index, 1, offset);
Expand All @@ -183,7 +183,7 @@ public static AbstractUnconditionalJumpNode createUnconditionalShortJump(final C
public static AbstractUnconditionalJumpNode createUnconditionalLongJump(final CompiledCodeObject code, final AbstractBytecodeNode[] bytecodeNodes, final int index, final int bytecode,
final byte parameter) {
final int offset = ((bytecode & 7) - 4 << 8) + Byte.toUnsignedInt(parameter);
if (needsCheck(bytecodeNodes, index, 2, offset)) {
if (needsCheck(code, bytecodeNodes, index, 2, offset)) {
return new UnconditionalJumpWithCheckNode(code, index, 2, offset);
} else {
return new UnconditionalJumpWithoutCheckNode(code, index, 2, offset);
Expand All @@ -193,14 +193,17 @@ public static AbstractUnconditionalJumpNode createUnconditionalLongJump(final Co
public static AbstractUnconditionalJumpNode createUnconditionalLongExtendedJump(final CompiledCodeObject code, final AbstractBytecodeNode[] bytecodeNodes, final int index, final int numBytecodes,
final byte bytecode, final int extB) {
final int offset = calculateLongExtendedOffset(bytecode, extB);
if (needsCheck(bytecodeNodes, index, numBytecodes, offset)) {
if (needsCheck(code, bytecodeNodes, index, numBytecodes, offset)) {
return new UnconditionalJumpWithCheckNode(code, index, numBytecodes, offset);
} else {
return new UnconditionalJumpWithoutCheckNode(code, index, numBytecodes, offset);
}
}

private static boolean needsCheck(final AbstractBytecodeNode[] bytecodeNodes, final int index, final int numBytecodes, final int offset) {
private static boolean needsCheck(final CompiledCodeObject code, final AbstractBytecodeNode[] bytecodeNodes, final int index, final int numBytecodes, final int offset) {
if (code.getSqueakClass().getImage().interruptHandlerDisabled()) {
return false;
}
CompilerAsserts.neverPartOfCompilation();
if (offset < 0) { // back-jumps only
final int backJumpIndex = index + numBytecodes + offset;
Expand Down

1 comment on commit 64c21b5

@TruffleSqueak-Bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance Report (64c21b5)

Benchmarks ran on 22.0.2-graal.

Steady (after 100 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 516 530 519.31 518 519.3 103862 1.73
CD 484 494 487.09 485 487.07 97417 1.62
DeltaBlue 275 456 406.89 406 405.37 81377 1.36
Havlak 1138 1179 1161.33 1168.5 1161.25 232266 3.87
Json 389 397 391.13 390 391.12 78226 1.3
List 308 320 309.23 309 309.23 61846 1.03
Mandelbrot 127 137 127.65 127 127.64 25530 0.43
NBody 249 263 252.52 251 252.5 50504 0.84
Permute 155 171 156.75 156 156.74 31350 0.52
Queens 232 245 235.22 235 235.21 47044 0.78
Richards 1221 1265 1225.81 1225.5 1225.8 245161 4.09
Sieve 177 187 178.01 178 178 35602 0.59
Storage 142 151 143.79 143 143.77 28758 0.48
Towers 196 207 198.12 197 198.11 39624 0.66
5609 6002 5792.84 5789 5791.11 1158567 19.31

64c21b5-2-steady.svg

Warmup (first 100 iterations)

64c21b5-3-warmup.svg

Please sign in to comment.