Skip to content

Commit b3287a6

Browse files
committed
Remove partial evaluator parameter
1 parent c9bffa0 commit b3287a6

File tree

7 files changed

+11
-16
lines changed

7 files changed

+11
-16
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/AgnosticInliningPhaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public boolean hasNextTier() {
8585
return false;
8686
}
8787
}, null);
88-
final AgnosticInliningPhase agnosticInliningPhase = new AgnosticInliningPhase(partialEvaluator,
88+
final AgnosticInliningPhase agnosticInliningPhase = new AgnosticInliningPhase(
8989
new PostPartialEvaluationSuite(compiler.getOrCreateCompilerOptions(callTarget), false));
9090
agnosticInliningPhase.apply(context.graph, context);
9191
return context.graph;

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/TruffleCompilerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public void initialize(TruffleCompilable compilable, boolean firstInitialization
323323

324324
// Hook for SVM
325325
protected TruffleTier newTruffleTier(OptionValues options) {
326-
return new TruffleTier(options, partialEvaluator,
326+
return new TruffleTier(options,
327327
new InstrumentationSuite(partialEvaluator.instrumentationCfg, partialEvaluator.getInstrumentation()),
328328
new PostPartialEvaluationSuite(options, TruffleCompilerOptions.IterativePartialEscape.getValue(options)));
329329
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/phases/TruffleTier.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import jdk.graal.compiler.core.phases.BaseTier;
2828
import jdk.graal.compiler.options.OptionValues;
29-
import jdk.graal.compiler.truffle.PartialEvaluator;
3029
import jdk.graal.compiler.truffle.PostPartialEvaluationSuite;
3130
import jdk.graal.compiler.truffle.TruffleCompilerOptions;
3231
import jdk.graal.compiler.truffle.TruffleTierContext;
@@ -35,8 +34,8 @@
3534
public class TruffleTier extends BaseTier<TruffleTierContext> {
3635

3736
@SuppressWarnings("this-escape")
38-
public TruffleTier(OptionValues options, PartialEvaluator partialEvaluator, InstrumentationSuite instrumentationSuite, PostPartialEvaluationSuite postPartialEvaluationSuite) {
39-
appendPhase(new AgnosticInliningPhase(partialEvaluator, postPartialEvaluationSuite));
37+
public TruffleTier(OptionValues options, InstrumentationSuite instrumentationSuite, PostPartialEvaluationSuite postPartialEvaluationSuite) {
38+
appendPhase(new AgnosticInliningPhase(postPartialEvaluationSuite));
4039
appendPhase(instrumentationSuite);
4140
appendPhase(new ReportPerformanceWarningsPhase());
4241
appendPhase(new VerifyFrameDoesNotEscapePhase());

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/phases/inlining/AgnosticInliningPhase.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import jdk.graal.compiler.phases.BasePhase;
3333
import jdk.graal.compiler.phases.util.GraphOrder;
3434
import jdk.graal.compiler.serviceprovider.GraalServices;
35-
import jdk.graal.compiler.truffle.PartialEvaluator;
3635
import jdk.graal.compiler.truffle.PostPartialEvaluationSuite;
3736
import jdk.graal.compiler.truffle.TruffleCompilerOptions;
3837
import jdk.graal.compiler.truffle.TruffleInliningScope;
@@ -52,11 +51,9 @@ public final class AgnosticInliningPhase extends BasePhase<TruffleTierContext> {
5251
POLICY_PROVIDERS = providers;
5352
}
5453

55-
private final PartialEvaluator partialEvaluator;
5654
private final PostPartialEvaluationSuite postPartialEvaluationSuite;
5755

58-
public AgnosticInliningPhase(PartialEvaluator partialEvaluator, PostPartialEvaluationSuite postPartialEvaluationSuite) {
59-
this.partialEvaluator = partialEvaluator;
56+
public AgnosticInliningPhase(PostPartialEvaluationSuite postPartialEvaluationSuite) {
6057
this.postPartialEvaluationSuite = postPartialEvaluationSuite;
6158
}
6259

@@ -78,7 +75,7 @@ private static InliningPolicyProvider getInliningPolicyProvider(TruffleTierConte
7875
@Override
7976
protected void run(StructuredGraph graph, TruffleTierContext context) {
8077
final InliningPolicy policy = getInliningPolicyProvider(context).get(context.compilerOptions, context);
81-
final CallTree tree = new CallTree(partialEvaluator, postPartialEvaluationSuite, context, policy);
78+
final CallTree tree = new CallTree(postPartialEvaluationSuite, context, policy);
8279
TruffleInliningScope scope = TruffleInliningScope.getCurrent(context.debug);
8380
if (scope != null) {
8481
scope.setCallTree(tree);

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/phases/inlining/CallTree.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import jdk.graal.compiler.debug.DebugContext;
2828
import jdk.graal.compiler.graph.Graph;
29-
import jdk.graal.compiler.truffle.PartialEvaluator;
3029
import jdk.graal.compiler.truffle.PostPartialEvaluationSuite;
3130
import jdk.graal.compiler.truffle.TruffleCompilerOptions;
3231
import jdk.graal.compiler.truffle.TruffleTierContext;
@@ -46,11 +45,11 @@ public final class CallTree extends Graph {
4645
int frontierSize;
4746
private int nextId = 0;
4847

49-
CallTree(PartialEvaluator partialEvaluator, PostPartialEvaluationSuite postPartialEvaluationSuite, TruffleTierContext context, InliningPolicy policy) {
48+
CallTree(PostPartialEvaluationSuite postPartialEvaluationSuite, TruffleTierContext context, InliningPolicy policy) {
5049
super(context.graph.getOptions(), context.debug);
5150
this.policy = policy;
5251
this.context = context;
53-
this.graphManager = new GraphManager(partialEvaluator, postPartialEvaluationSuite, context);
52+
this.graphManager = new GraphManager(postPartialEvaluationSuite, context);
5453
this.useSize = TruffleCompilerOptions.InliningUseSize.getValue(context.compilerOptions);
5554
// Should be kept as the last call in the constructor, as this is an argument.
5655
this.root = CallNode.makeRoot(context, this);

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/phases/inlining/GraphManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ final class GraphManager {
6464
private final PostPartialEvaluationSuite postPartialEvaluationSuite;
6565
private final boolean useSize;
6666

67-
GraphManager(PartialEvaluator partialEvaluator, PostPartialEvaluationSuite postPartialEvaluationSuite, TruffleTierContext rootContext) {
68-
this.partialEvaluator = partialEvaluator;
67+
GraphManager(PostPartialEvaluationSuite postPartialEvaluationSuite, TruffleTierContext rootContext) {
68+
this.partialEvaluator = rootContext.partialEvaluator;
6969
this.postPartialEvaluationSuite = postPartialEvaluationSuite;
7070
this.rootContext = rootContext;
7171
this.graphCacheForInlining = partialEvaluator.getOrCreateEncodedGraphCache();

substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/api/SubstrateTruffleCompilerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void initialize(TruffleCompilable compilable, boolean firstInitialization
8585

8686
@Override
8787
protected TruffleTier newTruffleTier(OptionValues options) {
88-
return new TruffleTier(options, partialEvaluator,
88+
return new TruffleTier(options,
8989
new InstrumentationSuite(partialEvaluator.instrumentationCfg, partialEvaluator.getInstrumentation()),
9090
new SubstratePostPartialEvaluationSuite(getGraalOptions(), TruffleCompilerOptions.IterativePartialEscape.getValue(options)));
9191
}

0 commit comments

Comments
 (0)