Skip to content

Commit fa90c78

Browse files
committed
simplify safepoint handling, WIP
1 parent 566f893 commit fa90c78

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/analysis/tesa/AbstractTesa.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ public T getState(TesaEngine engine, Invoke invoke) {
233233
public void applyResults(TesaEngine engine, HostedUniverse universe, HostedMethod method, StructuredGraph graph) {
234234
var state = getState(method.wrapped);
235235
if (hasOptimizationPotential(state)) {
236-
onOptimizableMethodDiscovered(method, state, graph);
237236
optimizableMethodsCounter.incrementAndGet();
238237
}
239238
for (Node node : graph.getNodes()) {
@@ -247,15 +246,6 @@ public void applyResults(TesaEngine engine, HostedUniverse universe, HostedMetho
247246
}
248247
}
249248

250-
/**
251-
* Hook for subclasses to perform any postprocessing or correctness checks for methods found as
252-
* optimizable.
253-
*/
254-
@SuppressWarnings("unused")
255-
protected void onOptimizableMethodDiscovered(HostedMethod method, T state, StructuredGraph graph) {
256-
257-
}
258-
259249
/**
260250
* Hook for subclasses to check if the given {@code invoke} can be optimized by the given
261251
* analysis. By default, try to optimize all invokes.

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/analysis/tesa/KilledLocationTesa.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import com.oracle.svm.core.graal.nodes.SubstrateFieldLocationIdentity;
3333
import com.oracle.svm.hosted.analysis.tesa.effect.LocationEffect;
3434
import com.oracle.svm.hosted.code.AnalysisToHostedGraphTransplanter;
35-
import com.oracle.svm.hosted.meta.HostedMethod;
3635
import com.oracle.svm.hosted.meta.HostedUniverse;
3736

3837
import jdk.graal.compiler.graph.Node;
@@ -65,6 +64,7 @@ protected LocationEffect anyEffect() {
6564
protected LocationEffect computeInitialState(AnalysisMethod method, StructuredGraph graph) {
6665
LocationEffect location = noEffect();
6766
for (Node node : graph.getNodes()) {
67+
assert !(node instanceof SafepointNode) : KilledLocationTesa.class.getSimpleName() + " does not support safepoints.";
6868
if (!isSupportedNode(node)) {
6969
return anyEffect();
7070
}
@@ -101,23 +101,6 @@ public static LocationIdentity[] extractLocationIdentities(Node node) {
101101
};
102102
}
103103

104-
@Override
105-
protected void onOptimizableMethodDiscovered(HostedMethod method, LocationEffect state, StructuredGraph graph) {
106-
assert checkNoSafepointNodes(method, state, graph);
107-
}
108-
109-
/**
110-
* Methods containing {@link SafepointNode} can kill multiple locations, which we do not track
111-
* precisely at the moment. To guarantee correctness, we verify that only methods without
112-
* safepoints have more precise killed location than {@code any}.
113-
*/
114-
private static boolean checkNoSafepointNodes(HostedMethod method, LocationEffect state, StructuredGraph graph) {
115-
for (Node node : graph.getNodes()) {
116-
AnalysisError.guarantee(!(node instanceof SafepointNode), "Method %s has a safepoint node in its graph, but its killed location is not any: %s", method.getQualifiedName(), state);
117-
}
118-
return true;
119-
}
120-
121104
@Override
122105
protected void optimizeInvoke(HostedUniverse universe, StructuredGraph graph, Invoke invoke, LocationEffect targetState) {
123106
switch (targetState) {

0 commit comments

Comments
 (0)