use of org.graalvm.compiler.hotspot.nodes.HotSpotStoreReservedReferenceNode in project graal by oracle.
the class HotSpotGraphBuilderPlugins method registerTrufflePlugins.
private static void registerTrufflePlugins(InvocationPlugins plugins, WordTypes wordTypes, GraalHotSpotVMConfig config) {
if (config.jvmciReservedReference0Offset == -1) {
// cannot install intrinsics without
return;
}
Registration tl = new Registration(plugins, "org.graalvm.compiler.truffle.runtime.hotspot.HotSpotFastThreadLocal");
tl.register(new InvocationPlugin("get", Receiver.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
int jvmciReservedReference0Offset = config.jvmciReservedReference0Offset;
GraalError.guarantee(jvmciReservedReference0Offset != -1, "jvmciReservedReference0Offset is not available but used.");
b.addPush(JavaKind.Object, new HotSpotLoadReservedReferenceNode(b.getMetaAccess(), wordTypes, jvmciReservedReference0Offset));
return true;
}
});
tl.register(new InvocationPlugin("set", Receiver.class, Object[].class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value) {
int jvmciReservedReference0Offset = config.jvmciReservedReference0Offset;
GraalError.guarantee(jvmciReservedReference0Offset != -1, "jvmciReservedReference0Offset is not available but used.");
b.add(new HotSpotStoreReservedReferenceNode(wordTypes, value, jvmciReservedReference0Offset));
return true;
}
});
}
use of org.graalvm.compiler.hotspot.nodes.HotSpotStoreReservedReferenceNode in project graal by oracle.
the class HotSpotTruffleGraphBuilderPlugins method registerHotspotThreadLocalStubPlugins.
/**
* These HotSpot thread local plugins are intended for the interpreter access stubs.
*/
static void registerHotspotThreadLocalStubPlugins(InvocationPlugins plugins, WordTypes wordTypes, int jvmciReservedReference0Offset) {
GraalError.guarantee(jvmciReservedReference0Offset != -1, "jvmciReservedReference0Offset is not available but used.");
InvocationPlugins.Registration tl = new InvocationPlugins.Registration(plugins, "org.graalvm.compiler.truffle.runtime.hotspot.HotSpotFastThreadLocal");
tl.register(new RequiredInvocationPlugin("getJVMCIReservedReference") {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
b.addPush(JavaKind.Object, new HotSpotLoadReservedReferenceNode(b.getMetaAccess(), wordTypes, jvmciReservedReference0Offset));
return true;
}
});
tl.register(new RequiredInvocationPlugin("setJVMCIReservedReference", Object[].class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value) {
b.add(new HotSpotStoreReservedReferenceNode(wordTypes, value, jvmciReservedReference0Offset));
return true;
}
});
}
Aggregations