Skip to content

Commit

Permalink
Revise special selector sends and cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Jan 13, 2025
1 parent 1cbebe2 commit fd07b8d
Show file tree
Hide file tree
Showing 13 changed files with 603 additions and 829 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ public static final class MUTEX {
}

public static final class POINT {
public static final int X = 0;
public static final int Y = 1;
public static final long X = 0;
public static final long Y = 1;
public static final int SIZE = 2;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ public static boolean isLongMinValue(final long value) {
return value == Long.MIN_VALUE;
}

public static boolean isLShiftLongOverflow(final long receiver, final long arg) {
return Long.numberOfLeadingZeros(receiver) - 1 < arg;
}

@Idempotent
public static boolean isMacOS() {
return OS.isMacOS();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static AbstractBytecodeNode decodeBytecode(final VirtualFrame frame, fin
}
case 0x5F -> new MiscellaneousBytecodes.NopBytecodeNode(code, index);
case 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F //
-> SendBytecodes.AbstractSendSpecialSelectorQuickNode.create(frame, code, index, b - 96);
-> SendBytecodes.createSpecialSelectorSend(frame, code, index, b - 96);
case 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F //
-> new SendBytecodes.SelfSendNode(frame, code, index, 1, (NativeObject) code.getLiteral(b & 0xF), 0);
case 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public AbstractBytecodeNode decodeBytecode(final VirtualFrame frame, final Compi
case 0xA8, 0xA9, 0xAA, 0xAB -> JumpBytecodes.ConditionalJumpOnTrueNode.createLong(code, index, b, bytecode[index + 1]);
case 0xAC, 0xAD, 0xAE, 0xAF -> JumpBytecodes.ConditionalJumpOnFalseNode.createLong(code, index, b, bytecode[index + 1]);
case 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF //
-> SendBytecodes.AbstractSendSpecialSelectorQuickNode.create(frame, code, index, b - 176);
-> SendBytecodes.createSpecialSelectorSend(frame, code, index, b - 176);
case 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF //
-> new SendBytecodes.SelfSendNode(frame, code, index, 1, (NativeObject) code.getLiteral(b & 0xF), 0);
case 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF //
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import de.hpi.swa.trufflesqueak.nodes.accessing.AbstractPointersObjectNodes.AbstractPointersObjectWriteNode;
import de.hpi.swa.trufflesqueak.nodes.primitives.AbstractPrimitiveFactoryHolder;
import de.hpi.swa.trufflesqueak.nodes.primitives.AbstractPrimitiveNode;
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive1WithFallback;
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive0WithFallback;
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive1WithFallback;
import de.hpi.swa.trufflesqueak.nodes.primitives.Primitive.Primitive2WithFallback;
import de.hpi.swa.trufflesqueak.nodes.primitives.SqueakPrimitive;

Expand Down Expand Up @@ -72,7 +72,7 @@ protected final double loadArgumentPointY(final PointersObject point, final Abst
return loadArgumentPointAt(point, POINT.Y, readNode, errorProfile, node);
}

private double loadArgumentPointAt(final PointersObject point, final int index, final AbstractPointersObjectReadNode readNode, final InlinedBranchProfile errorProfile, final Node node) {
private double loadArgumentPointAt(final PointersObject point, final long index, final AbstractPointersObjectReadNode readNode, final InlinedBranchProfile errorProfile, final Node node) {
if (isPoint(point)) {
final Object value = readNode.execute(node, point, index);
if (value instanceof final Long longValue) {
Expand Down
Loading

0 comments on commit fd07b8d

Please sign in to comment.