From e037274e24e77c947788f33a07eb01e080b7d4fb Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Mon, 5 Aug 2024 14:00:53 +0200 Subject: [PATCH] Avoid getHostBackend when instantiating UnimplementedGraalIntrinsics. --- .../hotspot/meta/HotSpotGraphBuilderPlugins.java | 2 +- .../compiler/hotspot/meta/HotSpotInvocationPlugins.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java index 1e6e5172d398..93b18c50ad86 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java @@ -212,7 +212,7 @@ public static Plugins create(HotSpotGraalRuntimeProvider graalRuntime, OptionValues options, TargetDescription target, BarrierSet barrierSet) { - InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(graalRuntime, config, compilerConfiguration, options); + InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(graalRuntime, config, compilerConfiguration, options, target); Plugins plugins = new Plugins(invocationPlugins); plugins.appendNodePlugin(new HotSpotExceptionDispatchPlugin(config, wordTypes.getWordKind())); diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotInvocationPlugins.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotInvocationPlugins.java index 697fb9464461..015a271d8ca7 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotInvocationPlugins.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotInvocationPlugins.java @@ -24,8 +24,8 @@ */ package jdk.graal.compiler.hotspot.meta; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.graal.compiler.hotspot.HotSpotGraalServices.isIntrinsicAvailable; +import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import java.lang.reflect.Type; import java.util.ArrayList; @@ -37,6 +37,7 @@ import org.graalvm.collections.EconomicSet; import org.graalvm.collections.MapCursor; import org.graalvm.collections.Pair; + import jdk.graal.compiler.debug.GraalError; import jdk.graal.compiler.debug.TTY; import jdk.graal.compiler.graph.Node; @@ -49,7 +50,7 @@ import jdk.graal.compiler.options.OptionValues; import jdk.graal.compiler.phases.tiers.CompilerConfiguration; import jdk.graal.compiler.replacements.nodes.MacroInvokable; - +import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.hotspot.VMIntrinsicMethod; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; @@ -73,11 +74,11 @@ record MethodKey(String name, String descriptor) { private final EconomicMap> disabledIntrinsics = EconomicMap.create(); - HotSpotInvocationPlugins(HotSpotGraalRuntimeProvider graalRuntime, GraalHotSpotVMConfig config, CompilerConfiguration compilerConfiguration, OptionValues options) { + HotSpotInvocationPlugins(HotSpotGraalRuntimeProvider graalRuntime, GraalHotSpotVMConfig config, CompilerConfiguration compilerConfiguration, OptionValues options, TargetDescription target) { this.graalRuntime = graalRuntime; this.config = config; if (Options.WarnMissingIntrinsic.getValue(options)) { - this.unimplementedIntrinsics = new UnimplementedGraalIntrinsics(graalRuntime.getTarget().arch); + this.unimplementedIntrinsics = new UnimplementedGraalIntrinsics(target.arch); } else { this.unimplementedIntrinsics = null; }