Skip to content

Commit ae42837

Browse files
author
Christian Wimmer
committed
[GR-30433] Always parse graphs with unresolvedIsError set to false.
PullRequest: graal/16298
2 parents b8e857c + 486751f commit ae42837

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/api/PointstoOptions.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
*/
2525
package com.oracle.graal.pointsto.api;
2626

27-
import static jdk.vm.ci.common.JVMCIError.shouldNotReachHere;
2827
import static jdk.graal.compiler.options.OptionType.Expert;
28+
import static jdk.vm.ci.common.JVMCIError.shouldNotReachHere;
2929

3030
import org.graalvm.collections.EconomicMap;
31+
3132
import jdk.graal.compiler.options.Option;
3233
import jdk.graal.compiler.options.OptionKey;
3334

@@ -131,8 +132,8 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Boolean o
131132
@Option(help = "Allow a type flow state to contain types not compatible with its declared type.")//
132133
public static final OptionKey<Boolean> RelaxTypeFlowStateConstraints = new OptionKey<>(true);
133134

134-
@Option(help = "Report unresolved elements as errors.")//
135-
public static final OptionKey<Boolean> UnresolvedIsError = new OptionKey<>(true);
135+
@Option(help = "Deprecated, option no longer has any effect.", deprecated = true)//
136+
static final OptionKey<Boolean> UnresolvedIsError = new OptionKey<>(true);
136137

137138
@Option(help = "Report analysis statistics.")//
138139
public static final OptionKey<Boolean> PrintPointsToStatistics = new OptionKey<>(false);

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/AnalysisParsedGraph.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
*/
2525
package com.oracle.graal.pointsto.flow;
2626

27+
import com.oracle.graal.pointsto.BigBang;
28+
import com.oracle.graal.pointsto.api.HostVM;
29+
import com.oracle.graal.pointsto.infrastructure.GraphProvider.Purpose;
30+
import com.oracle.graal.pointsto.meta.AnalysisMethod;
31+
import com.oracle.graal.pointsto.phases.SubstrateIntrinsicGraphBuilder;
32+
import com.oracle.graal.pointsto.util.AnalysisError;
33+
import com.oracle.svm.util.ClassUtil;
34+
2735
import jdk.graal.compiler.api.runtime.GraalJVMCICompiler;
2836
import jdk.graal.compiler.bytecode.Bytecode;
2937
import jdk.graal.compiler.bytecode.ResolvedJavaMethodBytecode;
@@ -42,16 +50,6 @@
4250
import jdk.graal.compiler.phases.OptimisticOptimizations;
4351
import jdk.graal.compiler.printer.GraalDebugHandlersFactory;
4452
import jdk.graal.compiler.runtime.RuntimeProvider;
45-
46-
import com.oracle.graal.pointsto.BigBang;
47-
import com.oracle.graal.pointsto.api.HostVM;
48-
import com.oracle.graal.pointsto.api.PointstoOptions;
49-
import com.oracle.graal.pointsto.infrastructure.GraphProvider.Purpose;
50-
import com.oracle.graal.pointsto.meta.AnalysisMethod;
51-
import com.oracle.graal.pointsto.phases.SubstrateIntrinsicGraphBuilder;
52-
import com.oracle.graal.pointsto.util.AnalysisError;
53-
import com.oracle.svm.util.ClassUtil;
54-
5553
import jdk.vm.ci.code.Architecture;
5654
import jdk.vm.ci.runtime.JVMCI;
5755

@@ -136,7 +134,7 @@ public static AnalysisParsedGraph parseBytecode(BigBang bb, AnalysisMethod metho
136134

137135
GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(bb.getProviders(method).getGraphBuilderPlugins())
138136
.withEagerResolving(true)
139-
.withUnresolvedIsError(PointstoOptions.UnresolvedIsError.getValue(bb.getOptions()))
137+
.withUnresolvedIsError(false)
140138
.withNodeSourcePosition(true)
141139
.withBytecodeExceptionMode(BytecodeExceptionMode.CheckAll)
142140
.withRetainLocalVariables(true);

substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/ParseOnceRuntimeCompilationFeature.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import com.oracle.graal.pointsto.BigBang;
5454
import com.oracle.graal.pointsto.PointsToAnalysis;
5555
import com.oracle.graal.pointsto.api.HostVM;
56-
import com.oracle.graal.pointsto.api.PointstoOptions;
5756
import com.oracle.graal.pointsto.flow.InvokeTypeFlow;
5857
import com.oracle.graal.pointsto.flow.MethodFlowsGraph;
5958
import com.oracle.graal.pointsto.heap.ImageHeapScanner;
@@ -282,7 +281,9 @@ static RuntimeGraphBuilderPhase createRuntimeGraphBuilderPhase(BigBang bb, Provi
282281
GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts) {
283282

284283
// Adjust graphbuilderconfig to match analysis phase
285-
var newGraphBuilderConfig = graphBuilderConfig.withEagerResolving(true).withUnresolvedIsError(PointstoOptions.UnresolvedIsError.getValue(bb.getOptions()));
284+
var newGraphBuilderConfig = graphBuilderConfig
285+
.withEagerResolving(true)
286+
.withUnresolvedIsError(false);
286287
return new RuntimeGraphBuilderPhase(providers, newGraphBuilderConfig, optimisticOpts, null, providers.getWordTypes(), (SVMHost) bb.getHostVM());
287288
}
288289

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SVMHost.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ public boolean isInitialized(AnalysisType type) {
328328

329329
@Override
330330
public GraphBuilderConfiguration updateGraphBuilderConfiguration(GraphBuilderConfiguration config, AnalysisMethod method) {
331-
GraphBuilderConfiguration updatedConfig = config.withRetainLocalVariables(retainLocalVariables()).withUnresolvedIsError(linkAtBuildTimeSupport.linkAtBuildTime(method.getDeclaringClass()))
332-
.withFullInfopoints(
333-
SubstrateOptions.getSourceLevelDebug() && SubstrateOptions.getSourceLevelDebugFilter().test(method.getDeclaringClass().toJavaName()));
331+
GraphBuilderConfiguration updatedConfig = config
332+
.withRetainLocalVariables(retainLocalVariables())
333+
.withFullInfopoints(SubstrateOptions.getSourceLevelDebug() && SubstrateOptions.getSourceLevelDebugFilter().test(method.getDeclaringClass().toJavaName()));
334334
if (parsingSupport != null) {
335335
return parsingSupport.updateGraphBuilderConfiguration(updatedConfig, method);
336336
}

0 commit comments

Comments
 (0)