Skip to content

Commit be8b52f

Browse files
committed
expose TruffleJavaDebugMethod over compilation identifier to match
truffle graphs in absence of method filter and scopes
1 parent d659727 commit be8b52f

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/common/CompilationIdentifier.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
package jdk.graal.compiler.core.common;
2626

2727
import jdk.vm.ci.code.CompilationRequest;
28+
import jdk.vm.ci.meta.JavaMethod;
2829

2930
/**
3031
* A unique identifier for a compilation. Compiled code can be mapped to a single compilation id.
@@ -77,4 +78,9 @@ public CompilationRequest getRequest() {
7778
* {@link Verbosity}.
7879
*/
7980
String toString(Verbosity verbosity);
81+
82+
default JavaMethod asJavaMethod() {
83+
return null;
84+
}
85+
8086
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/HotSpotCompilationIdentifier.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import jdk.graal.compiler.core.common.CompilationIdentifier;
2828
import jdk.graal.compiler.core.common.CompilationRequestIdentifier;
2929
import jdk.graal.compiler.debug.GraalError;
30-
3130
import jdk.vm.ci.hotspot.HotSpotCompilationRequest;
31+
import jdk.vm.ci.meta.JavaMethod;
3232
import jdk.vm.ci.runtime.JVMCICompiler;
3333

3434
/**
@@ -98,4 +98,8 @@ public HotSpotCompilationRequest getRequest() {
9898
return request;
9999
}
100100

101+
@Override
102+
public JavaMethod asJavaMethod() {
103+
return getRequest().getMethod();
104+
}
101105
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/hotspot/HotSpotTruffleCompilationIdentifier.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929

3030
import jdk.graal.compiler.hotspot.HotSpotCompilationIdentifier;
3131
import jdk.graal.compiler.truffle.TruffleCompilationIdentifier;
32+
import jdk.graal.compiler.truffle.TruffleDebugJavaMethod;
3233
import jdk.vm.ci.hotspot.HotSpotCompilationRequest;
34+
import jdk.vm.ci.meta.JavaMethod;
3335

3436
/**
3537
* A {@link HotSpotCompilationIdentifier} for Truffle compilations.
@@ -74,4 +76,9 @@ protected StringBuilder buildID(StringBuilder sb) {
7476
public long getTruffleCompilationId() {
7577
return getRequest().getId();
7678
}
79+
80+
@Override
81+
public JavaMethod asJavaMethod() {
82+
return new TruffleDebugJavaMethod(getTask(), getCompilable());
83+
}
7784
}

substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/SubstrateTruffleCompilationIdentifier.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
import jdk.graal.compiler.debug.GraalError;
3232
import jdk.graal.compiler.truffle.TruffleCompilationIdentifier;
33+
import jdk.graal.compiler.truffle.TruffleDebugJavaMethod;
34+
import jdk.vm.ci.meta.JavaMethod;
3335

3436
public final class SubstrateTruffleCompilationIdentifier extends SubstrateCompilationIdentifier implements TruffleCompilationIdentifier {
3537

@@ -81,4 +83,9 @@ public TruffleCompilable getCompilable() {
8183
public long getTruffleCompilationId() {
8284
return id;
8385
}
86+
87+
@Override
88+
public JavaMethod asJavaMethod() {
89+
return new TruffleDebugJavaMethod(getTask(), getCompilable());
90+
}
8491
}

substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/isolated/IsolatedTruffleCompilationIdentifier.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import com.oracle.truffle.compiler.TruffleCompilationTask;
3838

3939
import jdk.graal.compiler.truffle.TruffleCompilationIdentifier;
40+
import jdk.graal.compiler.truffle.TruffleDebugJavaMethod;
41+
import jdk.vm.ci.meta.JavaMethod;
4042

4143
final class IsolatedTruffleCompilationIdentifier extends IsolatedObjectProxy<TruffleCompilationIdentifier> implements TruffleCompilationIdentifier {
4244

@@ -95,4 +97,9 @@ private static long getTruffleCompilationId0(@SuppressWarnings("unused") ClientI
9597
TruffleCompilationIdentifier id = IsolatedCompileClient.get().unhand(idHandle);
9698
return id.getTruffleCompilationId();
9799
}
100+
101+
@Override
102+
public JavaMethod asJavaMethod() {
103+
return new TruffleDebugJavaMethod(getTask(), getCompilable());
104+
}
98105
}

0 commit comments

Comments
 (0)