use of org.graalvm.compiler.hotspot.replacements.HotSpotIdentityHashCodeNode in project graal by oracle.
the class HotSpotGraphBuilderPlugins method registerSystemPlugins.
private static void registerSystemPlugins(InvocationPlugins plugins) {
Registration r = new Registration(plugins, System.class);
r.register(new ForeignCallPlugin(HotSpotHostForeignCallsProvider.JAVA_TIME_MILLIS, "currentTimeMillis"));
r.register(new ForeignCallPlugin(HotSpotHostForeignCallsProvider.JAVA_TIME_NANOS, "nanoTime"));
r.register(new InlineOnlyInvocationPlugin("identityHashCode", Object.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode object) {
b.addPush(JavaKind.Int, new HotSpotIdentityHashCodeNode(object, b.bci()));
return true;
}
});
ArrayCopySnippets.registerSystemArraycopyPlugin(r);
}
use of org.graalvm.compiler.hotspot.replacements.HotSpotIdentityHashCodeNode in project graal by oracle.
the class HotSpotGraphBuilderPlugins method registerObjectPlugins.
private static void registerObjectPlugins(InvocationPlugins plugins, GraalHotSpotVMConfig config, Replacements replacements) {
Registration r = new Registration(plugins, Object.class, replacements);
r.register(new InlineOnlyInvocationPlugin("clone", Receiver.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
ValueNode object = receiver.get();
b.addPush(JavaKind.Object, new ObjectCloneNode(MacroParams.of(b, targetMethod, object)));
return true;
}
});
r.register(new InlineOnlyInvocationPlugin("hashCode", Receiver.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
ValueNode object = receiver.get();
b.addPush(JavaKind.Int, new HotSpotIdentityHashCodeNode(object, b.bci()));
return true;
}
});
if (config.inlineNotify()) {
r.register(new InlineOnlyInvocationPlugin("notify", Receiver.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
ValueNode object = receiver.get();
b.add(new FastNotifyNode(object, false, b.bci()));
return true;
}
});
}
if (config.inlineNotifyAll()) {
r.register(new InlineOnlyInvocationPlugin("notifyAll", Receiver.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
ValueNode object = receiver.get();
b.add(new FastNotifyNode(object, true, b.bci()));
return true;
}
});
}
}
Aggregations