Skip to content

[GR-64350] Refactor frame immutable field read intrinsics and fix them for native-image hosts. #11074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -518,4 +518,16 @@ public final boolean inlineOnly() {
return true;
}
}

public abstract static class OptionalInlineOnlyInvocationPlugin extends OptionalInvocationPlugin {

public OptionalInlineOnlyInvocationPlugin(String name, Type... argumentTypes) {
super(name, argumentTypes);
}

@Override
public final boolean inlineOnly() {
return true;
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ public final class TruffleKnownHostTypes extends AbstractKnownTruffleTypes {

// Checkstyle: stop field name check

// truffle.api.frame
public final ResolvedJavaType FrameDescriptor = lookupTypeCached("com.oracle.truffle.api.frame.FrameDescriptor");

// truffle.api.impl
public final ResolvedJavaType FrameWithoutBoxing = lookupType("com.oracle.truffle.api.impl.FrameWithoutBoxing");
public final ResolvedJavaType OptimizedCallTarget = lookupTypeCached("com.oracle.truffle.runtime.OptimizedCallTarget");
public final ResolvedJavaMethod OptimizedCallTarget_call = findMethod(OptimizedCallTarget, "call", lookupType(Object[].class));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
import java.util.concurrent.ThreadFactory;
import java.util.function.Supplier;

import jdk.graal.compiler.core.GraalCompiler;
import jdk.graal.compiler.hotspot.HotSpotGraalServiceThread;
import jdk.graal.compiler.truffle.host.TruffleHostEnvironment.TruffleRuntimeScope;
import org.graalvm.collections.EconomicMap;

import com.oracle.truffle.compiler.TruffleCompilable;
Expand All @@ -50,6 +47,7 @@
import jdk.graal.compiler.api.runtime.GraalJVMCICompiler;
import jdk.graal.compiler.code.CompilationResult;
import jdk.graal.compiler.core.CompilationWrapper.ExceptionAction;
import jdk.graal.compiler.core.GraalCompiler;
import jdk.graal.compiler.core.common.CompilationIdentifier;
import jdk.graal.compiler.core.target.Backend;
import jdk.graal.compiler.debug.DebugContext;
Expand All @@ -66,6 +64,7 @@
import jdk.graal.compiler.hotspot.HotSpotGraalCompilerFactory;
import jdk.graal.compiler.hotspot.HotSpotGraalOptionValues;
import jdk.graal.compiler.hotspot.HotSpotGraalRuntimeProvider;
import jdk.graal.compiler.hotspot.HotSpotGraalServiceThread;
import jdk.graal.compiler.hotspot.HotSpotGraalServices;
import jdk.graal.compiler.hotspot.HotSpotGraphBuilderInstance;
import jdk.graal.compiler.hotspot.meta.HotSpotLoweringProvider;
Expand Down Expand Up @@ -100,7 +99,7 @@
import jdk.graal.compiler.truffle.TruffleCompilerImpl;
import jdk.graal.compiler.truffle.TruffleTierConfiguration;
import jdk.graal.compiler.truffle.host.HostInliningPhase;
import jdk.graal.compiler.truffle.host.InjectImmutableFrameFieldsPhase;
import jdk.graal.compiler.truffle.host.TruffleHostEnvironment.TruffleRuntimeScope;
import jdk.vm.ci.code.CodeCacheProvider;
import jdk.vm.ci.code.CompiledCode;
import jdk.vm.ci.code.InstalledCode;
Expand Down Expand Up @@ -153,9 +152,7 @@ public static HotSpotTruffleCompilerImpl create(final TruffleCompilerRuntime run
/*
* Host inlining is not necessary for Truffle guest compilation so disable it.
*/
options = new OptionValues(options,
HostInliningPhase.Options.TruffleHostInlining, Boolean.FALSE,
InjectImmutableFrameFieldsPhase.Options.TruffleImmutableFrameFields, Boolean.FALSE);
options = new OptionValues(options, HostInliningPhase.Options.TruffleHostInlining, Boolean.FALSE);

HotSpotGraalRuntimeProvider graalRuntime = (HotSpotGraalRuntimeProvider) getCompiler(options).getGraalRuntime();
SnippetReflectionProvider snippetReflection = graalRuntime.getRequiredCapability(SnippetReflectionProvider.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@
*/
package jdk.graal.compiler.truffle.hotspot;

import java.util.function.Supplier;

import com.oracle.truffle.compiler.TruffleCompilerRuntime;

import jdk.graal.compiler.core.phases.CommunityCompilerConfiguration;
import jdk.graal.compiler.core.phases.HighTier;
import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
import jdk.graal.compiler.nodes.spi.Replacements;
import jdk.graal.compiler.options.OptionValues;
import jdk.graal.compiler.truffle.host.InjectImmutableFrameFieldsPhase;
import jdk.graal.compiler.truffle.host.HostInliningPhase;
import jdk.graal.compiler.truffle.substitutions.TruffleInvocationPlugins;

import com.oracle.truffle.compiler.TruffleCompilerRuntime;

import jdk.vm.ci.code.Architecture;

import java.util.function.Supplier;

/**
* Central place to register Truffle related compiler phases and plugins for host Java compilation
* on HotSpot.
Expand All @@ -63,7 +61,6 @@ public HighTier createHighTier(OptionValues options) {

public static void installCommunityHighTier(OptionValues options, HighTier defaultHighTier) {
HostInliningPhase.install(defaultHighTier, options);
InjectImmutableFrameFieldsPhase.install(defaultHighTier, options);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
public static void registerFrameWithoutBoxingPlugins(InvocationPlugins plugins, KnownTruffleTypes types, boolean canDelayIntrinsification) {
Registration r = new Registration(plugins, new ResolvedJavaSymbol(types.FrameWithoutBoxing));
registerFrameMethods(r, types);
registerUnsafeCast(r, types, canDelayIntrinsification);
registerUnsafeLoadStorePlugins(r, canDelayIntrinsification, null, JavaKind.Long, JavaKind.Object);
registerFrameAccessors(r, types, JavaKind.Object);
registerFrameAccessors(r, types, JavaKind.Long);
Expand Down
Loading
Loading