|
32 | 32 | import org.graalvm.compiler.core.common.type.StampFactory; |
33 | 33 | import org.graalvm.compiler.debug.DebugContext; |
34 | 34 | import org.graalvm.compiler.debug.GraalError; |
| 35 | +import org.graalvm.compiler.graph.NodeSourcePosition; |
35 | 36 | import org.graalvm.compiler.nodes.CallTargetNode.InvokeKind; |
36 | 37 | import org.graalvm.compiler.nodes.ConstantNode; |
37 | 38 | import org.graalvm.compiler.nodes.FixedNode; |
@@ -103,7 +104,11 @@ public int getModifiers() { |
103 | 104 |
|
104 | 105 | @Override |
105 | 106 | public StructuredGraph buildGraph(DebugContext debug, ResolvedJavaMethod method, HostedProviders providers, Purpose purpose) { |
106 | | - HostedGraphKit kit = new HostedGraphKit(debug, providers, method); |
| 107 | + // Needed to match type flows to invokes so invoked methods can be inlined in runtime |
| 108 | + // compilations, see GraalFeature.processMethod() and MethodTypeFlowBuilder.uniqueKey() |
| 109 | + boolean trackNodeSourcePosition = (purpose == Purpose.ANALYSIS); |
| 110 | + |
| 111 | + HostedGraphKit kit = new HostedGraphKit(debug, providers, method, trackNodeSourcePosition); |
107 | 112 | boolean isDeoptTarget = (method instanceof SharedMethod) && ((SharedMethod) method).isDeoptTarget(); |
108 | 113 |
|
109 | 114 | ResolvedJavaType factoryType = method.getDeclaringClass(); |
@@ -168,7 +173,9 @@ private static int invokeConstructor(HostedGraphKit kit, ResolvedJavaMethod meth |
168 | 173 |
|
169 | 174 | /** @see com.oracle.svm.hosted.phases.HostedGraphBuilderPhase */ |
170 | 175 | private static int invokeWithDeoptAndExceptionUnwind(HostedGraphKit kit, boolean isDeoptTarget, int initialNextDeoptIndex, ResolvedJavaMethod target, InvokeKind invokeKind, ValueNode... args) { |
171 | | - InvokeWithExceptionNode invoke = kit.startInvokeWithException(target, invokeKind, kit.getFrameState(), kit.bci(), args); |
| 176 | + int bci = kit.bci(); |
| 177 | + InvokeWithExceptionNode invoke = kit.startInvokeWithException(target, invokeKind, kit.getFrameState(), bci, args); |
| 178 | + invoke.setNodeSourcePosition(NodeSourcePosition.placeholder(kit.getGraph().method(), bci)); |
172 | 179 | kit.exceptionPart(); |
173 | 180 | ExceptionObjectNode exception = kit.exceptionObject(); |
174 | 181 |
|
|
0 commit comments