From fcd8e8c38de5449b3f5ec78486d36e6175f30663 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Fri, 6 Dec 2024 15:08:02 +0100 Subject: [PATCH] Handle SmallFloat64 in special selector sends --- .../swa/trufflesqueak/nodes/bytecodes/SendBytecodes.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/bytecodes/SendBytecodes.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/bytecodes/SendBytecodes.java index d93b23f41..0e474ef66 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/bytecodes/SendBytecodes.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/bytecodes/SendBytecodes.java @@ -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);