Skip to content

Commit 883c911

Browse files
author
Michael Haas
committed
Replace enum with static final class.
1 parent 98c4380 commit 883c911

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/nodes/InvokeJavaMethodNode.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,16 @@ public class InvokeJavaMethodNode extends DeoptimizingFixedWithNextNode implemen
6464
* {@link InvokeJavaMethodNode} creation. See
6565
* {@code HotSpotTruffleSafepointLoweringSnippet#pollSnippet} for usage details.
6666
*/
67-
public enum MethodWrapper {
68-
SUBSTITUTABILITY_CHECK,
69-
TRUFFLE_SAFEPOINT;
70-
67+
public static final class MethodWrapper {
7168
ResolvedJavaMethod targetMethod;
7269

7370
public void setTargetMethod(ResolvedJavaMethod targetMethod) {
7471
this.targetMethod = targetMethod;
7572
}
7673
}
7774

75+
public static final MethodWrapper TRUFFLE_SAFEPOINT = new MethodWrapper();
76+
7877
@Input protected NodeInputList<ValueNode> arguments;
7978

8079
private int bci;
@@ -202,7 +201,7 @@ public Invoke replaceWithInvoke() {
202201
public InvokeNode createInvoke(StructuredGraph graph) {
203202
MethodCallTargetNode callTarget = graph.add(new MethodCallTargetNode(getInvokeKind(), getTargetMethod(), toArgumentArray(), getReturnStamp(), null));
204203
InvokeNode in = new InvokeNode(callTarget, bci(), MemoryKill.NO_LOCATION);
205-
// this node has no side-effect, propagate it to the invoke node
204+
// this node has no side effect, propagate it to the invoke node
206205
in.setSideEffect(false);
207206
InvokeNode invoke = graph.add(in);
208207
invoke.setStateDuring(stateBefore());

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/hotspot/HotSpotTruffleSafepointLoweringSnippet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private static void pollSnippet(Object node, @ConstantParameter int pendingHands
7373
Word thread = CurrentJavaThreadNode.get();
7474
if (BranchProbabilityNode.probability(BranchProbabilityNode.VERY_SLOW_PATH_PROBABILITY,
7575
thread.readInt(pendingHandshakeOffset, PENDING_HANDSHAKE_LOCATION) != 0)) {
76-
InvokeJavaMethodNode.invoke(InvokeJavaMethodNode.MethodWrapper.TRUFFLE_SAFEPOINT, node);
76+
InvokeJavaMethodNode.invoke(InvokeJavaMethodNode.TRUFFLE_SAFEPOINT, node);
7777
}
7878
}
7979

@@ -152,7 +152,7 @@ public void initialize(HotSpotProviders providers,
152152
if (config.jvmciReserved0Offset != -1) {
153153
this.templates = new Templates(options, providers, config.jvmciReserved0Offset);
154154
this.deferredInit = () -> {
155-
InvokeJavaMethodNode.MethodWrapper.TRUFFLE_SAFEPOINT.setTargetMethod(types.HotSpotThreadLocalHandshake_doHandshake);
155+
InvokeJavaMethodNode.TRUFFLE_SAFEPOINT.setTargetMethod(types.HotSpotThreadLocalHandshake_doHandshake);
156156
};
157157
}
158158
}

0 commit comments

Comments
 (0)