Skip to content

Commit 798a7fc

Browse files
committed
[GR-48116] Remove IntrinsifyMethodHandlesInvocationPlugin.
PullRequest: graal/17252
2 parents 207f9c7 + 8fb4455 commit 798a7fc

File tree

5 files changed

+9
-1021
lines changed

5 files changed

+9
-1021
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ public enum ReportingMode {
10561056
@Option(help = "Enable and disable normal processing of flags relating to experimental options.", type = OptionType.Expert, stability = OptionStability.EXPERIMENTAL) //
10571057
public static final HostedOptionKey<Boolean> UnlockExperimentalVMOptions = new HostedOptionKey<>(false);
10581058

1059-
@Option(help = "Force using legacy method handle intrinsics.", type = Expert, deprecated = true, deprecationMessage = "This option was introduced to simplify migration to GraalVM 23.1 and will be removed in a future release") //
1059+
@Option(help = "Deprecated, option no longer has any effect.", deprecated = true, deprecationMessage = "It no longer has any effect, and no replacement is available")//
10601060
public static final HostedOptionKey<Boolean> UseOldMethodHandleIntrinsics = new HostedOptionKey<>(false);
10611061

10621062
@Option(help = "Include all classes, methods, and fields from given modules", type = OptionType.Debug) //

substratevm/src/com.oracle.svm.graal/src/com/oracle/svm/graal/hosted/runtimecompilation/RuntimeCompilationFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ private void installRuntimeConfig(BeforeAnalysisAccessImpl config) {
396396
FeatureHandler featureHandler = config.getFeatureHandler();
397397
final boolean supportsStubBasedPlugins = !SubstrateOptions.useLLVMBackend();
398398

399-
NativeImageGenerator.registerGraphBuilderPlugins(featureHandler, runtimeConfig, hostedProviders, config.getMetaAccess(), config.getUniverse(), null, config.getNativeLibraries(),
399+
NativeImageGenerator.registerGraphBuilderPlugins(featureHandler, runtimeConfig, hostedProviders, config.getMetaAccess(), config.getUniverse(), config.getNativeLibraries(),
400400
config.getImageClassLoader(), ParsingReason.JITCompilation, ((Inflation) config.getBigBang()).getAnnotationSubstitutionProcessor(),
401401
new SubstrateClassInitializationPlugin(config.getHostVM()), ConfigurationValues.getTarget(), supportsStubBasedPlugins);
402402

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@
248248
import com.oracle.svm.hosted.phases.EarlyConstantFoldLoadFieldPlugin;
249249
import com.oracle.svm.hosted.phases.ImageBuildStatisticsCounterPhase;
250250
import com.oracle.svm.hosted.phases.InjectedAccessorsPlugin;
251-
import com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin;
252251
import com.oracle.svm.hosted.phases.SubstrateClassInitializationPlugin;
253252
import com.oracle.svm.hosted.phases.VerifyDeoptLIRFrameStatesPhase;
254253
import com.oracle.svm.hosted.phases.VerifyNoGuardsPhase;
@@ -599,7 +598,6 @@ protected void doRun(Map<Method, CEntryPointData> entryPoints, JavaMainSupport j
599598
bb.getSnippetReflectionProvider()).build();
600599

601600
registerGraphBuilderPlugins(featureHandler, runtimeConfiguration, (HostedProviders) runtimeConfiguration.getProviders(), bb.getMetaAccess(), aUniverse,
602-
hUniverse,
603601
nativeLibraries, loader, ParsingReason.AOTCompilation, bb.getAnnotationSubstitutionProcessor(),
604602
new SubstrateClassInitializationPlugin((SVMHost) aUniverse.hostVM()),
605603
ConfigurationValues.getTarget(), this.isStubBasedPluginsSupported());
@@ -1145,7 +1143,7 @@ public static void initializeBigBang(Inflation bb, OptionValues options, Feature
11451143
*/
11461144
bb.getMetaAccess().lookupJavaType(com.oracle.svm.core.graal.stackvalue.StackValueNode.StackSlotIdentity.class).registerAsReachable("root class");
11471145

1148-
NativeImageGenerator.registerGraphBuilderPlugins(featureHandler, null, aProviders, aMetaAccess, aUniverse, null, nativeLibraries, loader, ParsingReason.PointsToAnalysis,
1146+
NativeImageGenerator.registerGraphBuilderPlugins(featureHandler, null, aProviders, aMetaAccess, aUniverse, nativeLibraries, loader, ParsingReason.PointsToAnalysis,
11491147
bb.getAnnotationSubstitutionProcessor(), classInitializationPlugin, ConfigurationValues.getTarget(), supportsStubBasedPlugins);
11501148
registerReplacements(debug, featureHandler, null, aProviders, true, initForeignCalls, new GraphEncoder(ConfigurationValues.getTarget().arch));
11511149

@@ -1353,7 +1351,7 @@ public void notifyNoPlugin(ResolvedJavaMethod targetMethod, OptionValues options
13531351
}
13541352

13551353
public static void registerGraphBuilderPlugins(FeatureHandler featureHandler, RuntimeConfiguration runtimeConfig, HostedProviders providers, AnalysisMetaAccess aMetaAccess,
1356-
AnalysisUniverse aUniverse, HostedUniverse hUniverse, NativeLibraries nativeLibs, ImageClassLoader loader, ParsingReason reason,
1354+
AnalysisUniverse aUniverse, NativeLibraries nativeLibs, ImageClassLoader loader, ParsingReason reason,
13571355
AnnotationSubstitutionProcessor annotationSubstitutionProcessor, ClassInitializationPlugin classInitializationPlugin,
13581356
TargetDescription target, boolean supportsStubBasedPlugins) {
13591357
GraphBuilderConfiguration.Plugins plugins = new GraphBuilderConfiguration.Plugins(new SubstitutionInvocationPlugins(annotationSubstitutionProcessor));
@@ -1367,12 +1365,8 @@ public static void registerGraphBuilderPlugins(FeatureHandler featureHandler, Ru
13671365
SubstrateReplacements replacements = (SubstrateReplacements) providers.getReplacements();
13681366
plugins.appendInlineInvokePlugin(replacements);
13691367

1370-
if (!SubstrateOptions.UseOldMethodHandleIntrinsics.getValue()) {
1371-
if (reason.duringAnalysis()) {
1372-
plugins.appendNodePlugin(new MethodHandleWithExceptionPlugin(providers.getConstantReflection().getMethodHandleAccess(), false));
1373-
}
1374-
} else {
1375-
plugins.appendNodePlugin(new IntrinsifyMethodHandlesInvocationPlugin(hostedSnippetReflection, providers, aUniverse, hUniverse));
1368+
if (reason.duringAnalysis()) {
1369+
plugins.appendNodePlugin(new MethodHandleWithExceptionPlugin(providers.getConstantReflection().getMethodHandleAccess(), false));
13761370
}
13771371
plugins.appendNodePlugin(new DeletedFieldsPlugin());
13781372
plugins.appendNodePlugin(new InjectedAccessorsPlugin());

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/methodhandles/MethodHandleFeature.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import com.oracle.graal.pointsto.heap.ImageHeapScanner;
4444
import com.oracle.graal.pointsto.meta.AnalysisMetaAccess;
4545
import com.oracle.graal.pointsto.meta.AnalysisType;
46-
import com.oracle.svm.core.SubstrateOptions;
4746
import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature;
4847
import com.oracle.svm.core.feature.InternalFeature;
4948
import com.oracle.svm.core.fieldvaluetransformer.FieldValueTransformerWithAvailability;
@@ -147,15 +146,9 @@ public void duringSetup(DuringSetupAccess access) {
147146
referencedKeySetAdd = ReflectionUtil.lookupMethod(concurrentWeakInternSetClass, "add", Object.class);
148147
}
149148

150-
if (!SubstrateOptions.UseOldMethodHandleIntrinsics.getValue()) {
151-
/*
152-
* Renaming is not crucial with old method handle intrinsics, so if those are requested
153-
* explicitly, disable renaming to offer a fallback in case it causes problems.
154-
*/
155-
var accessImpl = (DuringSetupAccessImpl) access;
156-
substitutionProcessor = new MethodHandleInvokerRenamingSubstitutionProcessor(accessImpl.getBigBang());
157-
accessImpl.registerSubstitutionProcessor(substitutionProcessor);
158-
}
149+
var accessImpl = (DuringSetupAccessImpl) access;
150+
substitutionProcessor = new MethodHandleInvokerRenamingSubstitutionProcessor(accessImpl.getBigBang());
151+
accessImpl.registerSubstitutionProcessor(substitutionProcessor);
159152
}
160153

161154
@Override

0 commit comments

Comments
 (0)