use of com.oracle.svm.core.graal.nodes.SubstrateDynamicNewArrayNode in project graal by oracle.
the class SubstrateGraphBuilderPlugins method registerArrayPlugins.
private static void registerArrayPlugins(InvocationPlugins plugins) {
Registration r = new Registration(plugins, Array.class).setAllowOverwrite(true);
r.register2("newInstance", Class.class, int.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode clazz, ValueNode length) {
b.addPush(JavaKind.Object, new SubstrateDynamicNewArrayNode(clazz, length));
return true;
}
});
/*
* We have our own Java-level implementation of Array.getLength(), so we just disable the
* plugin defined in StandardGraphBuilderPlugins.
*/
r.register1("getLength", Object.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver type, ValueNode array) {
return false;
}
});
}
Aggregations