Skip to content

Commit

Permalink
Turn BitBlt bounce check into assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Dec 16, 2023
1 parent 7c48444 commit c54f576
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3875,15 +3875,11 @@ private long halftoneLongAt(final long index) {

private long srcLongAt(final long index) {
/**
* Unfortunately, BitBlt tries to read past the end or before the start of
* {@link sourceBits} sometimes, so return `0` in these cases. An example is
* #testPivelValueAt (confirmed by SqueakJS's BitBltPlugin) or `PolygonMorph
* arrowPrototype`.
* BitBlt sometimes tries to read past the end or before the start of {@link sourceBits}
* sometimes. An example is #testPivelValueAt (confirmed by SqueakJS's BitBltPlugin) or
* `PolygonMorph arrowPrototype`.
*/
if (0 <= index && index < endOfSource) {
return Integer.toUnsignedLong(UnsafeUtils.getIntAt(sourceBits, sourceBitsBaseOffset + (index >>> 2) * sourceBitsIndexScale));
} else {
return 0L;
}
assert 0 <= index && index <= endOfSource;
return Integer.toUnsignedLong(UnsafeUtils.getIntAt(sourceBits, sourceBitsBaseOffset + (index >>> 2) * sourceBitsIndexScale));
}
}

1 comment on commit c54f576

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

Benchmarks ran on graalvm-jdk-21+35.1.

Steady (after 100 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 525 536 527.42 526 527.41 105483 1.76
CD 472 485 476.43 474 476.41 95285 1.59
DeltaBlue 277 471 410 410 408.49 82000 1.37
Havlak 1136 1189 1167.15 1173 1167.07 233430 3.89
Json 363 373 365.88 364 365.87 73176 1.22
List 291 301 291.38 291 291.38 58276 0.97
Mandelbrot 125 136 126.06 126 126.04 25211 0.42
NBody 248 262 251.66 250 251.64 50331 0.84
Permute 150 161 151.26 151 151.25 30252 0.5
Queens 232 244 235.5 235 235.49 47099 0.78
Richards 1239 1257 1243.93 1244 1243.93 248786 4.15
Sieve 163 179 164.1 164 164.08 32819 0.55
Storage 137 145 138.55 137 138.53 27710 0.46
Towers 195 214 196.45 196 196.44 39290 0.65
5553 5953 5745.74 5741 5744.03 1149148 19.15

c54f576-2-steady.svg

Warmup (first 100 iterations)

c54f576-3-warmup.svg

Please sign in to comment.