Skip to content

Commit edcc6fe

Browse files
committed
Force inlining in StringGetBytesTest
1 parent d18bce1 commit edcc6fe

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/StringGetBytesTest.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,11 +26,16 @@
2626

2727
import java.nio.charset.StandardCharsets;
2828

29+
import org.junit.Assert;
30+
import org.junit.Test;
31+
2932
import jdk.graal.compiler.graph.Node;
3033
import jdk.graal.compiler.nodes.StructuredGraph;
34+
import jdk.graal.compiler.nodes.ValueNode;
35+
import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext;
36+
import jdk.graal.compiler.nodes.graphbuilderconf.InlineInvokePlugin;
3137
import jdk.graal.compiler.replacements.nodes.EncodeArrayNode;
32-
import org.junit.Assert;
33-
import org.junit.Test;
38+
import jdk.vm.ci.meta.ResolvedJavaMethod;
3439

3540
public class StringGetBytesTest extends MethodSubstitutionTest {
3641

@@ -66,4 +71,12 @@ protected void checkLowTierGraph(StructuredGraph graph) {
6671
}
6772
Assert.fail("intrinsic not found in graph!");
6873
}
74+
75+
@Override
76+
protected InlineInvokePlugin.InlineInfo bytecodeParserShouldInlineInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args) {
77+
if (method.getDeclaringClass().getUnqualifiedName().equals("String") && !method.getName().equals("implEncodeISOArray")) {
78+
return InlineInvokePlugin.InlineInfo.createStandardInlineInfo(method);
79+
}
80+
return super.bytecodeParserShouldInlineInvoke(b, method, args);
81+
}
6982
}

0 commit comments

Comments
 (0)