Skip to content

Commit

Permalink
Customize options for compilation only once
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Wimmer committed Mar 24, 2022
1 parent 801436e commit 8360033
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public interface CompileFunction {

private SnippetReflectionProvider snippetReflection;
private final FeatureHandler featureHandler;
private final OptionValues compileOptions;

private volatile boolean inliningProgress;

Expand Down Expand Up @@ -391,6 +392,7 @@ public CompileQueue(DebugContext debug, FeatureHandler featureHandler, HostedUni
this.executor = new CompletionExecutor(universe.getBigBang(), executorService, universe.getBigBang().getHeartbeatCallback());
this.featureHandler = featureHandler;
this.snippetReflection = snippetReflection;
this.compileOptions = getCustomizedOptions(debug);

callForReplacements(debug, runtimeConfig);
}
Expand Down Expand Up @@ -836,13 +838,12 @@ private StructuredGraph transplantGraph(DebugContext debug, HostedMethod hMethod
*/
aMethod.setAnalyzedGraph(null);

OptionValues options = getCustomizedOptions(debug);
/*
* The static analysis always needs NodeSourcePosition. But for AOT compilation, we only
* need to preserve them when explicitly enabled, to reduce memory pressure.
*/
boolean trackNodeSourcePosition = GraalOptions.TrackNodeSourcePosition.getValue(options);
StructuredGraph graph = aGraph.copy(universe.lookup(aGraph.method()), options, debug, trackNodeSourcePosition);
boolean trackNodeSourcePosition = GraalOptions.TrackNodeSourcePosition.getValue(compileOptions);
StructuredGraph graph = aGraph.copy(universe.lookup(aGraph.method()), compileOptions, debug, trackNodeSourcePosition);

transplantEscapeAnalysisState(graph);

Expand Down Expand Up @@ -1078,7 +1079,7 @@ private void defaultParseFunction(DebugContext debug, HostedMethod method, Compi
Bytecode code = new ResolvedJavaMethodBytecode(method);
// DebugContext debug = new DebugContext(options,
// providers.getSnippetReflection());
graph = new SubstrateIntrinsicGraphBuilder(getCustomizedOptions(debug), debug, providers,
graph = new SubstrateIntrinsicGraphBuilder(compileOptions, debug, providers,
code).buildGraph(plugin);
}
}
Expand All @@ -1088,7 +1089,7 @@ private void defaultParseFunction(DebugContext debug, HostedMethod method, Compi
}
if (graph == null) {
needParsing = true;
graph = new StructuredGraph.Builder(getCustomizedOptions(debug), debug)
graph = new StructuredGraph.Builder(compileOptions, debug)
.method(method)
.recordInlinedMethods(false)
.build();
Expand Down

0 comments on commit 8360033

Please sign in to comment.