use of com.oracle.svm.core.identityhashcode.SubstrateIdentityHashCodeNode in project graal by oracle.
the class SubstrateGraphBuilderPlugins method registerSystemPlugins.
private static void registerSystemPlugins(MetaAccessProvider metaAccess, InvocationPlugins plugins) {
Registration r = new Registration(plugins, System.class);
if (SubstrateOptions.FoldSecurityManagerGetter.getValue()) {
r.register(new RequiredInvocationPlugin("getSecurityManager") {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
/* System.getSecurityManager() always returns null. */
b.addPush(JavaKind.Object, ConstantNode.forConstant(SubstrateObjectConstant.forObject(null), metaAccess, b.getGraph()));
return true;
}
});
}
r.register(new RequiredInvocationPlugin("identityHashCode", Object.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode object) {
b.addPush(JavaKind.Int, new SubstrateIdentityHashCodeNode(object, b.bci()));
return true;
}
});
}
use of com.oracle.svm.core.identityhashcode.SubstrateIdentityHashCodeNode in project graal by oracle.
the class SubstrateGraphBuilderPlugins method registerObjectPlugins.
private static void registerObjectPlugins(InvocationPlugins plugins) {
Registration r = new Registration(plugins, Object.class);
r.register(new RequiredInvocationPlugin("clone", Receiver.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
ValueNode object = receiver.get();
b.addPush(JavaKind.Object, new SubstrateObjectCloneWithExceptionNode(MacroParams.of(b, targetMethod, object)));
return true;
}
});
r.register(new RequiredInvocationPlugin("hashCode", Receiver.class) {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) {
ValueNode object = receiver.get();
b.addPush(JavaKind.Int, new SubstrateIdentityHashCodeNode(object, b.bci()));
return true;
}
});
}
Aggregations