Skip to content

Commit

Permalink
[GR-52284] Improve runtime method call tracing.
Browse files Browse the repository at this point in the history
PullRequest: graal/17068
  • Loading branch information
teshull committed Feb 24, 2024
2 parents adab8a8 + 478802a commit fa9d817
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void initializeCallerInfo() {
* the deopt method variant as a callee.
*/
if (deoptInvokeTypeFlow || SubstrateCompilationDirectives.isRuntimeCompiledMethod(callee)) {
MethodNode calleeMethodNode = analysisMethodMap.computeIfAbsent(callee, MethodNode::new);
MethodNode calleeMethodNode = analysisMethodMap.computeIfAbsent(callee.getMultiMethod(RUNTIME_COMPILED_METHOD), MethodNode::new);
InvokeNode invoke = new InvokeNode(callerMethodNode, invokeInfo.getPosition());
calleeMethodNode.addCaller(invoke);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ private boolean handleNeverPartOfCompilation(GraphBuilderContext b, ResolvedJava
callTree.add(cur.getMethod().format("%H.%n(%p)"));
cur = cur.outerFrameState();
}
callTree.removeLast(); // this method will be b.getMethod
neverPartOfCompilationViolations.add(Pair.create(b.getMethod(), String.join(",", callTree)));
}
}
Expand Down Expand Up @@ -822,8 +821,8 @@ private void checkBlockList(CallTreeInfo treeInfo) {
if (neverPartOfCompilationViolations.size() > 0) {
System.out.println("Error: CompilerAsserts.neverPartOfCompilation reachable for runtime compilation from " + neverPartOfCompilationViolations.size() + " places:");
for (Pair<ResolvedJavaMethod, String> violation : neverPartOfCompilationViolations) {
System.out.println("called from");
System.out.println("(inlined call path): " + violation.getRight());
System.out.println("called from: " + violation.getRight());
System.out.println("runtime trace: ");
for (String item : runtimeCompilation.getCallTrace(treeInfo, (AnalysisMethod) violation.getLeft())) {
System.out.println(" " + item);
}
Expand Down

0 comments on commit fa9d817

Please sign in to comment.