Skip to content

Commit b8e857c

Browse files
committed
[GR-50476] Avoid use of addConst in AssertionSnippets
PullRequest: graal/16297
2 parents 3ad697c + d799c64 commit b8e857c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replacements/AssertionSnippets.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import static jdk.graal.compiler.replacements.SnippetTemplate.DEFAULT_REPLACER;
3131

3232
import jdk.graal.compiler.api.replacements.Snippet;
33-
import jdk.graal.compiler.api.replacements.Snippet.ConstantParameter;
3433
import jdk.graal.compiler.core.common.spi.ForeignCallDescriptor;
3534
import jdk.graal.compiler.core.common.type.StampFactory;
3635
import jdk.graal.compiler.graph.Node.ConstantNodeParameter;
@@ -54,14 +53,14 @@
5453
public class AssertionSnippets implements Snippets {
5554

5655
@Snippet
57-
public static void assertion(boolean condition, @ConstantParameter Word message, long l1, long l2) {
56+
public static void assertion(boolean condition, Word message, long l1, long l2) {
5857
if (injectBranchProbability(SLOWPATH_PROBABILITY, !condition)) {
5958
vmMessageC(VM_MESSAGE_C, true, message, l1, l2, 0L);
6059
}
6160
}
6261

6362
@Snippet
64-
public static void stubAssertion(boolean condition, @ConstantParameter Word message, long l1, long l2) {
63+
public static void stubAssertion(boolean condition, Word message, long l1, long l2) {
6564
if (injectBranchProbability(SLOWPATH_PROBABILITY, !condition)) {
6665
vmMessageStub(VM_MESSAGE_C, true, message, l1, l2, 0L);
6766
}
@@ -90,7 +89,7 @@ public void lower(AssertionNode assertionNode, LoweringTool tool) {
9089
StructuredGraph graph = assertionNode.graph();
9190
Arguments args = new Arguments(graph.start() instanceof StubStartNode ? stubAssertion : assertion, graph.getGuardsStage(), tool.getLoweringStage());
9291
args.add("condition", assertionNode.condition());
93-
args.addConst("message",
92+
args.add("message",
9493
graph.unique(new ConstantNode(new CStringConstant("failed runtime assertion in snippet/stub: " + assertionNode.message() + " (" + graph.method() + ")"),
9594
StampFactory.pointer())));
9695
args.add("l1", assertionNode.getL1());

0 commit comments

Comments
 (0)