Skip to content

Commit

Permalink
Turn check into assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Dec 26, 2023
1 parent 9dbb4c3 commit d9c4838
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ private ContextObject commonNLReturn(final AbstractSqueakObject sender, final Co
assert sender == NilObject.SINGLETON;
throw returnToTopLevel(targetContext, returnValue);
}
if (!targetContext.hasClosure() && !senderContext.canBeReturnedTo()) {
if (!senderContext.canBeReturnedTo()) {
assert !targetContext.hasClosure();
return sendCannotReturn(senderContext, returnValue);
}
ContextObject context = senderContext;
Expand All @@ -150,10 +151,11 @@ private ContextObject commonNLReturn(final AbstractSqueakObject sender, final Co
@TruffleBoundary
private ContextObject commonReturn(final ContextObject startContext, final ContextObject targetContext, final Object returnValue) {
/* "make sure we can return to the given context" */
if (!targetContext.hasClosure() && !targetContext.canBeReturnedTo()) {
if (!targetContext.canBeReturnedTo()) {
if (startContext == targetContext) {
throw returnToTopLevel(targetContext, returnValue);
}
assert !targetContext.hasClosure();
return sendCannotReturn(startContext, returnValue);
}
/*
Expand Down

1 comment on commit d9c4838

@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 (d9c4838)

Benchmarks ran on graalvm-jdk-21+35.1.

Steady (after 100 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 559 568 562.17 561 562.16 112433 1.87
CD 485 496 488.28 486 488.27 97656 1.63
DeltaBlue 280 454 412.53 417.5 410.98 82506 1.38
Havlak 1141 1196 1173.85 1179 1173.78 234770 3.91
Json 383 393 385.58 384 385.57 77116 1.29
List 378 389 379.25 379 379.25 75850 1.26
Mandelbrot 230 241 234.05 235 234.03 46810 0.78
NBody 256 271 259.43 258 259.41 51885 0.86
Permute 154 166 155.68 155 155.67 31136 0.52
Queens 244 255 245.67 245 245.66 49134 0.82
Richards 1222 1240 1226.54 1226.5 1226.53 245307 4.09
Sieve 177 190 178.13 178 178.12 35626 0.59
Storage 140 151 142.36 141 142.34 28472 0.47
Towers 195 213 197.32 196 197.29 39464 0.66
5844 6223 6040.82 6041 6039.06 1208165 20.14

d9c4838-2-steady.svg

Warmup (first 100 iterations)

d9c4838-3-warmup.svg

Please sign in to comment.