use of com.oracle.svm.core.graal.stackvalue.StackValueNode in project graal by oracle.
the class SubstrateGraphBuilderPlugins method registerStackValuePlugins.
private static void registerStackValuePlugins(InvocationPlugins plugins) {
Registration r = new Registration(plugins, StackValue.class);
r.register1("get", int.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode sizeNode) {
long size = longValue(b, targetMethod, sizeNode, "size");
StackSlotIdentity slotIdentity = new StackSlotIdentity(b.getGraph().method().asStackTraceElement(b.bci()).toString());
b.addPush(JavaKind.Object, new StackValueNode(1, size, slotIdentity));
return true;
}
});
r.register2("get", int.class, int.class, new InvocationPlugin() {
@Override
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode numElementsNode, ValueNode elementSizeNode) {
long numElements = longValue(b, targetMethod, numElementsNode, "numElements");
long elementSize = longValue(b, targetMethod, elementSizeNode, "elementSize");
StackSlotIdentity slotIdentity = new StackSlotIdentity(b.getGraph().method().asStackTraceElement(b.bci()).toString());
b.addPush(JavaKind.Object, new StackValueNode(numElements, elementSize, slotIdentity));
return true;
}
});
}
Aggregations