|
5 | 5 | import static jdk.graal.compiler.nodes.Invoke.CYCLES_UNKNOWN_RATIONALE;
|
6 | 6 | import static jdk.graal.compiler.nodes.Invoke.SIZE_UNKNOWN_RATIONALE;
|
7 | 7 |
|
| 8 | +import java.util.Map; |
| 9 | + |
8 | 10 | import jdk.graal.compiler.core.common.type.Stamp;
|
9 | 11 | import jdk.graal.compiler.core.common.type.StampFactory;
|
10 | 12 | import jdk.graal.compiler.core.common.type.StampPair;
|
|
14 | 16 | import jdk.graal.compiler.graph.NodeClass;
|
15 | 17 | import jdk.graal.compiler.graph.NodeInputList;
|
16 | 18 | import jdk.graal.compiler.nodeinfo.NodeInfo;
|
| 19 | +import jdk.graal.compiler.nodeinfo.Verbosity; |
17 | 20 | import jdk.graal.compiler.nodes.CallTargetNode;
|
18 | 21 | import jdk.graal.compiler.nodes.DeoptimizingFixedWithNextNode;
|
19 | 22 | import jdk.graal.compiler.nodes.InliningLog;
|
@@ -65,14 +68,23 @@ public class InvokeJavaMethodNode extends DeoptimizingFixedWithNextNode implemen
|
65 | 68 | * {@code HotSpotTruffleSafepointLoweringSnippet#pollSnippet} for usage details.
|
66 | 69 | */
|
67 | 70 | public static final class MethodWrapper {
|
68 |
| - ResolvedJavaMethod targetMethod; |
| 71 | + private final String name; |
| 72 | + private ResolvedJavaMethod targetMethod; |
| 73 | + |
| 74 | + public MethodWrapper(String name) { |
| 75 | + this.name = name; |
| 76 | + } |
69 | 77 |
|
70 | 78 | public void setTargetMethod(ResolvedJavaMethod targetMethod) {
|
71 | 79 | this.targetMethod = targetMethod;
|
72 | 80 | }
|
| 81 | + |
| 82 | + public String getName() { |
| 83 | + return name; |
| 84 | + } |
73 | 85 | }
|
74 | 86 |
|
75 |
| - public static final MethodWrapper TRUFFLE_SAFEPOINT = new MethodWrapper(); |
| 87 | + public static final MethodWrapper TRUFFLE_SAFEPOINT = new MethodWrapper("HotSpotThreadLocalHandshake.doHandshake"); |
76 | 88 |
|
77 | 89 | @Input protected NodeInputList<ValueNode> arguments;
|
78 | 90 |
|
@@ -167,6 +179,29 @@ public StampPair getReturnStamp() {
|
167 | 179 | return returnStamp;
|
168 | 180 | }
|
169 | 181 |
|
| 182 | + @Override |
| 183 | + public String toString(Verbosity verbosity) { |
| 184 | + if (verbosity == Verbosity.Name) { |
| 185 | + StringBuilder sb = new StringBuilder(); |
| 186 | + sb.append(super.toString(verbosity)); |
| 187 | + sb.append("#"); |
| 188 | + if (targetMethod == null) { |
| 189 | + sb.append(methodWrapper.getName()); |
| 190 | + } else { |
| 191 | + sb.append(targetMethod.format("%h.%n")); |
| 192 | + } |
| 193 | + return sb.toString(); |
| 194 | + } |
| 195 | + return super.toString(verbosity); |
| 196 | + } |
| 197 | + |
| 198 | + @Override |
| 199 | + public Map<Object, Object> getDebugProperties(Map<Object, Object> map) { |
| 200 | + Map<Object, Object> debugProperties = super.getDebugProperties(map); |
| 201 | + debugProperties.put("targetMethod", targetMethod == null ? methodWrapper.getName() : targetMethod.format("%h.%n")); |
| 202 | + return debugProperties; |
| 203 | + } |
| 204 | + |
170 | 205 | public static boolean intrinsify(GraphBuilderContext b, @InjectedNodeParameter Stamp returnStamp, MethodWrapper method, ValueNode... args) {
|
171 | 206 | GraphBuilderContext nonIntrinsicAncestor = b.getNonIntrinsicAncestor();
|
172 | 207 | int bci = nonIntrinsicAncestor == null ? BytecodeFrame.UNKNOWN_BCI : b.bci();
|
|
0 commit comments