Skip to content

Commit

Permalink
Handle SmallFloat64 in special selector sends
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Dec 6, 2024
1 parent 89db875 commit fcd8e8c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,16 @@ public static AbstractBytecodeNode create(final VirtualFrame frame, final Compil
*/
final int receiverStackIndex = FrameAccess.getStackPointer(frame) - 2;
final Object receiver = FrameAccess.getStackValue(frame, receiverStackIndex, FrameAccess.getNumArguments(frame));
if (receiver instanceof Long) { // TODO: can this be expanded to Double and others?
if (receiver instanceof Long) {
final CompiledCodeObject method = (CompiledCodeObject) image.smallIntegerClass.lookupInMethodDictSlow(specialSelector);
assert method.hasPrimitive() && method.getNumArgs() == numArguments;
primitiveIndex = method.primitiveIndex();
} else if (receiver instanceof Double) {
final CompiledCodeObject method = (CompiledCodeObject) image.smallFloatClass.lookupInMethodDictSlow(specialSelector);
assert method.hasPrimitive() && method.getNumArgs() == numArguments;
primitiveIndex = method.primitiveIndex();
} else {
// TODO: can this be expanded to Characters and others?
}
} else if (selectorIndex == 16 || selectorIndex == 17) { // #at:, #at:put:
return new SendSpecialSelectorQuickWithClassCheck1OrMoreArgumentsNode(code, index, selectorIndex);
Expand Down

1 comment on commit fcd8e8c

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

Benchmarks ran on 23.0.1-graal.

Steady (after 100 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 516 548 520.13 517 520.1 104026 1.73
CD 471 506 477.6 473 477.55 95520 1.59
DeltaBlue 287 464 404.61 405 403.63 80922 1.35
Havlak 1149 1208 1180.4 1181 1180.35 236080 3.93
Json 344 361 348.22 345 348.18 69644 1.16
List 310 335 311.92 310.5 311.88 62383 1.04
Mandelbrot 129 155 130.31 129 130.26 26062 0.43
NBody 243 267 247.84 245 247.78 49568 0.83
Permute 155 182 160.6 160 160.52 32119 0.54
Queens 218 248 220.63 219 220.57 44126 0.74
Richards 1296 1363 1312.44 1306 1312.28 262487 4.37
Sieve 177 204 178.4 178 178.36 35679 0.59
Storage 138 154 141.19 139 141.12 28238 0.47
Towers 179 210 181.16 179 181.08 36231 0.6
5612 6205 5815.42 5786.5 5813.66 1163085 19.38

fcd8e8c-2-steady.svg

Warmup (first 100 iterations)

fcd8e8c-3-warmup.svg

Please sign in to comment.