use of com.oracle.svm.core.graal.nodes.SubstrateDynamicNewInstanceNode in project graal by oracle.
the class SubstrateGraphBuilderPlugins method registerUnsafePlugins.
private static void registerUnsafePlugins(InvocationPlugins plugins) {
Registration r = new Registration(plugins, Unsafe.class).setAllowOverwrite(true);
r.register2("allocateInstance", Receiver.class, Class.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode clazz) {
ValueNode clazzNonNull = b.nullCheckedValue(clazz, DeoptimizationAction.None);
b.addPush(JavaKind.Object, new SubstrateDynamicNewInstanceNode(clazzNonNull));
return true;
}
});
}
Aggregations