@SuppressWarnings("try") public StructuredGraph buildGraph(InvocationPlugin plugin) { NodeSourcePosition position = graph.trackNodeSourcePosition() ? NodeSourcePosition.placeholder(method) : null; try (DebugCloseable context = graph.withNodeSourcePosition(position)) { Receiver receiver = method.isStatic() ? null : this; if (plugin.execute(this, method, receiver, arguments)) { assert (returnValue != null) == (method.getSignature().getReturnKind() != JavaKind.Void) : method; append(new ReturnNode(returnValue)); return graph; } return null; } }
commit = (CommitAllocationNode) fixed.predecessor(); } else { try (DebugCloseable context = graph.withNodeSourcePosition(NodeSourcePosition.placeholder(graph.method()))) { commit = graph.add(new CommitAllocationNode()); graph.addBeforeFixed(fixed, commit);
protected FixedNode makeStubNode(MethodScope methodScope, LoopScope loopScope, int nodeOrderId) { if (nodeOrderId == GraphEncoder.NULL_ORDER_ID) { return null; } FixedNode node = (FixedNode) lookupNode(loopScope, nodeOrderId); if (node != null) { return node; } long readerByteIndex = methodScope.reader.getByteIndex(); methodScope.reader.setByteIndex(methodScope.encodedGraph.nodeStartOffsets[nodeOrderId]); NodeClass<?> nodeClass = methodScope.encodedGraph.getNodeClasses()[methodScope.reader.getUVInt()]; Node stubNode = nodeClass.allocateInstance(); if (graph.trackNodeSourcePosition()) { stubNode.setNodeSourcePosition(NodeSourcePosition.placeholder(graph.method())); } node = (FixedNode) graph.add(stubNode); /* Properties and edges are not filled yet, the node remains uninitialized. */ methodScope.reader.setByteIndex(readerByteIndex); registerNode(loopScope, nodeOrderId, node, false, false); loopScope.nodesToProcess.set(nodeOrderId); return node; }