# HG changeset patch # User Mick Jordan # Date 1363969718 25200 # Node ID 3e85441907dedad60548e7d2229bb9a59603d846 # Parent 9208719445e22d02f7b574f21bb47ee0e158b95b GraphBuilderPhase: add createInvokeNode method by refactoring appendInvoke, for use by subclasses overriding handleUnresolvedInvoke diff -r 9208719445e2 -r 3e85441907de graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Fri Mar 22 15:09:53 2013 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Fri Mar 22 09:28:38 2013 -0700 @@ -1116,12 +1116,17 @@ returnType = returnType.resolve(targetMethod.getDeclaringClass()); } MethodCallTargetNode callTarget = currentGraph.add(new MethodCallTargetNode(invokeKind, targetMethod, args, returnType)); + createInvokeNode(callTarget, resultType); + } + + protected Invoke createInvokeNode(MethodCallTargetNode callTarget, Kind resultType) { // be conservative if information was not recorded (could result in endless recompiles // otherwise) if (graphBuilderConfig.omitAllExceptionEdges() || (optimisticOpts.useExceptionProbability() && profilingInfo.getExceptionSeen(bci()) == ExceptionSeen.FALSE)) { - ValueNode result = appendWithBCI(currentGraph.add(new InvokeNode(callTarget, bci()))); + InvokeNode invoke = new InvokeNode(callTarget, bci()); + ValueNode result = appendWithBCI(currentGraph.add(invoke)); frameState.pushReturn(resultType, result); - + return invoke; } else { ExceptionObjectNode exceptionEdge = (ExceptionObjectNode) handleException(null, bci()); InvokeWithExceptionNode invoke = currentGraph.add(new InvokeWithExceptionNode(callTarget, exceptionEdge, bci())); @@ -1134,6 +1139,7 @@ invoke.setNext(createTarget(nextBlock, frameState)); invoke.setStateAfter(frameState.create(nextBlock.startBci)); + return invoke; } }