Skip to content

Commit aa1e104

Browse files
Christian Wimmerntemmar
Christian Wimmer
authored andcommitted
Customize options for compilation only once
1 parent 301243d commit aa1e104

File tree

1 file changed

+6
-5
lines changed
  • substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code

1 file changed

+6
-5
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/CompileQueue.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ public interface CompileFunction {
219219

220220
private SnippetReflectionProvider snippetReflection;
221221
private final FeatureHandler featureHandler;
222+
private final OptionValues compileOptions;
222223

223224
private volatile boolean inliningProgress;
224225

@@ -391,6 +392,7 @@ public CompileQueue(DebugContext debug, FeatureHandler featureHandler, HostedUni
391392
this.executor = new CompletionExecutor(universe.getBigBang(), executorService, universe.getBigBang().getHeartbeatCallback());
392393
this.featureHandler = featureHandler;
393394
this.snippetReflection = snippetReflection;
395+
this.compileOptions = getCustomizedOptions(debug);
394396

395397
callForReplacements(debug, runtimeConfig);
396398
}
@@ -836,13 +838,12 @@ private StructuredGraph transplantGraph(DebugContext debug, HostedMethod hMethod
836838
*/
837839
aMethod.setAnalyzedGraph(null);
838840

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

847848
transplantEscapeAnalysisState(graph);
848849

@@ -1078,7 +1079,7 @@ private void defaultParseFunction(DebugContext debug, HostedMethod method, Compi
10781079
Bytecode code = new ResolvedJavaMethodBytecode(method);
10791080
// DebugContext debug = new DebugContext(options,
10801081
// providers.getSnippetReflection());
1081-
graph = new SubstrateIntrinsicGraphBuilder(getCustomizedOptions(debug), debug, providers,
1082+
graph = new SubstrateIntrinsicGraphBuilder(compileOptions, debug, providers,
10821083
code).buildGraph(plugin);
10831084
}
10841085
}
@@ -1088,7 +1089,7 @@ private void defaultParseFunction(DebugContext debug, HostedMethod method, Compi
10881089
}
10891090
if (graph == null) {
10901091
needParsing = true;
1091-
graph = new StructuredGraph.Builder(getCustomizedOptions(debug), debug)
1092+
graph = new StructuredGraph.Builder(compileOptions, debug)
10921093
.method(method)
10931094
.recordInlinedMethods(false)
10941095
.build();

0 commit comments

Comments
 (0)