use of com.oracle.svm.core.graal.nodes.NewPinnedArrayNode in project graal by oracle.
the class SubstrateGraphBuilderPlugins method registerPinnedAllocatorPlugins.
private static void registerPinnedAllocatorPlugins(ConstantReflectionProvider constantReflection, InvocationPlugins plugins) {
Registration r = new Registration(plugins, PinnedAllocator.class);
r.register2("newInstance", Receiver.class, Class.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver pinnedAllocator, ValueNode instanceClassNode) {
ResolvedJavaType instanceClass = typeValue(constantReflection, b, targetMethod, instanceClassNode, "instanceClass");
ValueNode pinnedAllocatorNode = pinnedAllocator.get();
b.addPush(JavaKind.Object, new NewPinnedInstanceNode(instanceClass, pinnedAllocatorNode));
return true;
}
});
r.register3("newArray", Receiver.class, Class.class, int.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver pinnedAllocator, ValueNode componentTypeNode, ValueNode length) {
ResolvedJavaType componentType = typeValue(constantReflection, b, targetMethod, componentTypeNode, "componentType");
ValueNode pinnedAllocatorNode = pinnedAllocator.get();
b.addPush(JavaKind.Object, new NewPinnedArrayNode(componentType, length, pinnedAllocatorNode));
return true;
}
});
}
Aggregations