use of jdk.vm.ci.meta.MethodHandleAccessProvider in project graal by oracle.
the class MethodHandleNode method simplify.
@Override
public void simplify(SimplifierTool tool) {
MethodHandleAccessProvider methodHandleAccess = tool.getConstantReflection().getMethodHandleAccess();
ValueNode[] argumentsArray = arguments.toArray(new ValueNode[arguments.size()]);
final FixedNode before = this;
GraphAdder adder = new GraphAdder(graph()) {
@Override
public <T extends ValueNode> T add(T node) {
T added = graph().addOrUnique(node);
if (added instanceof FixedWithNextNode) {
graph().addBeforeFixed(before, (FixedWithNextNode) added);
}
return added;
}
};
InvokeNode invoke = tryResolveTargetInvoke(adder, methodHandleAccess, intrinsicMethod, targetMethod, bci, returnStamp, argumentsArray);
if (invoke != null) {
assert invoke.graph() == null;
invoke = graph().addOrUniqueWithInputs(invoke);
invoke.setStateAfter(stateAfter());
FixedNode currentNext = next();
replaceAtUsages(invoke);
GraphUtil.removeFixedWithUnusedInputs(this);
graph().addBeforeFixed(currentNext, invoke);
}
}
Aggregations