Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gluon-bot committed Oct 22, 2023
2 parents ea08331 + 692f52a commit 3792a42
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 36 deletions.
1 change: 1 addition & 0 deletions substratevm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This changelog summarizes major changes to GraalVM Native Image.
* (GR-48612) Enable `--strict-image-heap` by default. The option is now deprecated and can be removed from your argument list. A blog post with more information will follow shortly.
* (GR-48354) Remove native-image-agent legacy `build`-option
* (GR-49221) Support for thread dumps can now be enabled with `--enable-monitoring=threaddump`. The option `-H:±DumpThreadStacksOnSignal` is deprecated and marked for removal.
* (GR-48579) Options ParseOnce, ParseOnceJIT, and InlineBeforeAnalysis are deprecated and no longer have any effect.

## GraalVM for JDK 21 (Internal Version 23.1.0)
* (GR-35746) Lower the default aligned chunk size from 1 MB to 512 KB for the serial and epsilon GCs, reducing memory usage and image size in many cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
*/
package com.oracle.graal.pointsto.phases;

import com.oracle.graal.pointsto.BigBang;
import com.oracle.graal.pointsto.flow.AnalysisParsedGraph;
import com.oracle.graal.pointsto.meta.AnalysisMethod;
import com.oracle.svm.util.ClassUtil;

import jdk.compiler.graal.debug.DebugContext;
import jdk.compiler.graal.nodes.GraphDecoder;
import jdk.compiler.graal.nodes.StructuredGraph;
import jdk.compiler.graal.options.Option;
import jdk.compiler.graal.options.OptionKey;
import jdk.compiler.graal.printer.GraalDebugHandlersFactory;

import com.oracle.graal.pointsto.BigBang;
import com.oracle.graal.pointsto.flow.AnalysisParsedGraph;
import com.oracle.graal.pointsto.meta.AnalysisMethod;
import com.oracle.svm.util.ClassUtil;

/**
* Inlining before the static analysis improves the precision of the analysis especially when
* constants are propagated. So the goal is to inline callees that are folded to constants.
Expand All @@ -54,7 +54,7 @@
public class InlineBeforeAnalysis {

public static class Options {
@Option(help = "Inline methods before static analysis")//
@Option(help = "Deprecated, option no longer has any effect", deprecated = true, deprecationMessage = "It no longer has any effect, and no replacement is available")//
public static final OptionKey<Boolean> InlineBeforeAnalysis = new OptionKey<>(true);
}

Expand All @@ -71,7 +71,7 @@ public static StructuredGraph decodeGraph(BigBang bb, AnalysisMethod method, Ana

try (DebugContext.Scope s = debug.scope("InlineBeforeAnalysis", result)) {

if (bb.strengthenGraalGraphs() && Options.InlineBeforeAnalysis.getValue(bb.getOptions())) {
if (bb.strengthenGraalGraphs()) {
InlineBeforeAnalysisGraphDecoder decoder = bb.getHostVM().createInlineBeforeAnalysisGraphDecoder(bb, method, result);
decoder.decode(method);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,13 @@

import org.graalvm.collections.EconomicMap;
import org.graalvm.collections.UnmodifiableEconomicMap;
import jdk.compiler.graal.api.replacements.Fold;
import jdk.compiler.graal.core.common.GraalOptions;
import jdk.compiler.graal.options.Option;
import jdk.compiler.graal.options.OptionKey;
import jdk.compiler.graal.options.OptionStability;
import jdk.compiler.graal.options.OptionType;
import jdk.compiler.graal.options.OptionValues;
import org.graalvm.nativeimage.ImageInfo;
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.c.libc.LibCBase;
import com.oracle.svm.core.c.libc.MuslLibC;
import com.oracle.svm.core.deopt.DeoptimizationSupport;
import com.oracle.svm.core.heap.ReferenceHandler;
import com.oracle.svm.core.option.APIOption;
import com.oracle.svm.core.option.APIOptionGroup;
Expand All @@ -70,15 +62,21 @@
import com.oracle.svm.util.ModuleSupport;
import com.oracle.svm.util.ReflectionUtil;

import jdk.compiler.graal.api.replacements.Fold;
import jdk.compiler.graal.core.common.GraalOptions;
import jdk.compiler.graal.options.Option;
import jdk.compiler.graal.options.OptionKey;
import jdk.compiler.graal.options.OptionStability;
import jdk.compiler.graal.options.OptionType;
import jdk.compiler.graal.options.OptionValues;
import jdk.internal.misc.Unsafe;

public class SubstrateOptions {

@Option(help = "When true, compiler graphs are parsed only once before static analysis. When false, compiler graphs are parsed for static analysis and again for AOT compilation.")//
@Option(help = "Deprecated, option no longer has any effect.", deprecated = true, deprecationMessage = "It no longer has any effect, and no replacement is available")//
public static final HostedOptionKey<Boolean> ParseOnce = new HostedOptionKey<>(true);
@Option(help = "When true, each compiler graph version (DeoptTarget, AOT, JIT) needed for runtime compilation will be separately analyzed during static analysis." +
"When false, only one version of the compiler graph (AOT) will be used in static analysis, and then three new versions will be parsed for compilation.")//
public static final HostedOptionKey<Boolean> ParseOnceJIT = new HostedOptionKey<>(true);
@Option(help = "Deprecated, option no longer has any effect.", deprecated = true, deprecationMessage = "It no longer has any effect, and no replacement is available")//
static final HostedOptionKey<Boolean> ParseOnceJIT = new HostedOptionKey<>(true);
@Option(help = "Preserve the local variable information for every Java source line to allow line-by-line stepping in the debugger. Allow the lookup of Java-level method information, e.g., in stack traces.")//
public static final HostedOptionKey<Boolean> SourceLevelDebug = new HostedOptionKey<>(false);
@Option(help = "Constrain debug info generation to the comma-separated list of package prefixes given to this option.")//
Expand All @@ -89,10 +87,10 @@ public class SubstrateOptions {

public static boolean parseOnce() {
/*
* Parsing all graphs before static analysis is work-in-progress and for JIT compilation is
* only enabled when ParseOnceJIT is set.
* GR-48579: Old code only reachable when this method would return false will be deleted
* later.
*/
return ParseOnce.getValue() && (ParseOnceJIT.getValue() || !DeoptimizationSupport.enabled());
return true;
}

@Option(help = "Module containing the class that contains the main entry point. Optional if --shared is used.", type = OptionType.User)//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
import com.oracle.graal.pointsto.meta.AnalysisMetaAccess;
import com.oracle.graal.pointsto.meta.AnalysisMethod;
import com.oracle.graal.pointsto.meta.PointsToAnalysisMethod;
import com.oracle.svm.core.SubstrateOptions;
import com.oracle.svm.core.config.ConfigurationValues;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.graal.GraalSupport;
Expand Down Expand Up @@ -195,7 +194,7 @@ public List<Class<? extends Feature>> getRequiredFeatures() {

@Override
public void afterRegistration(AfterRegistrationAccess access) {
VMError.guarantee(!SubstrateOptions.ParseOnceJIT.getValue(), "This feature is only supported when ParseOnceJIT is not set");
VMError.shouldNotReachHere("GR-48579: dead code that will be deleted later");

ImageSingletons.add(RuntimeCompilationFeature.class, this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType;

/**
* Runtime compilation strategy used when {@link com.oracle.svm.core.SubstrateOptions#ParseOnceJIT}
* is enabled.
*/
public class ParseOnceRuntimeCompilationFeature extends RuntimeCompilationFeature implements Feature, RuntimeCompilationSupport {

public static class Options {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,7 @@ public static RuntimeCompilationFeature singleton() {
}

public static Class<? extends Feature> getRuntimeCompilationFeature() {
if (SubstrateOptions.ParseOnceJIT.getValue()) {
return ParseOnceRuntimeCompilationFeature.class;
} else {
return LegacyRuntimeCompilationFeature.class;
}
return ParseOnceRuntimeCompilationFeature.class;
}

public interface RuntimeCompilationCandidatePredicate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
import com.oracle.graal.pointsto.meta.AnalysisUniverse;
import com.oracle.graal.pointsto.meta.HostedProviders;
import com.oracle.graal.pointsto.meta.PointsToAnalysisFactory;
import com.oracle.graal.pointsto.phases.InlineBeforeAnalysis;
import com.oracle.graal.pointsto.reports.AnalysisReporter;
import com.oracle.graal.pointsto.reports.ReportUtils;
import com.oracle.graal.pointsto.typestate.DefaultAnalysisPolicy;
Expand Down Expand Up @@ -1377,8 +1376,6 @@ public static void registerGraphBuilderPlugins(FeatureHandler featureHandler, Ru
plugins.appendInlineInvokePlugin(replacements);

boolean useInlineBeforeAnalysisMethodHandleSupport = !SubstrateOptions.UseOldMethodHandleIntrinsics.getValue() &&
SubstrateOptions.parseOnce() &&
InlineBeforeAnalysis.Options.InlineBeforeAnalysis.getValue(aUniverse.getBigbang().getOptions()) &&
!DeoptimizationSupport.enabled();
if (useInlineBeforeAnalysisMethodHandleSupport) {
if (reason.duringAnalysis()) {
Expand Down

0 comments on commit 3792a42

Please sign in to comment.