# HG changeset patch # User Thomas Wuerthinger # Date 1330119163 -3600 # Node ID 9d48ccb3929230c17b16f88883746034e7305b43 # Parent fc42b5b6941a16af8331a6ea8b1a77fcad8ab376 Fixed a wrong frame state for the exception edge after a polymorphic inlining. Removed a NPE allocation in a runtime call branch introduced for Graal. diff -r fc42b5b6941a -r 9d48ccb39292 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java Fri Feb 24 20:39:12 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java Fri Feb 24 22:32:43 2012 +0100 @@ -135,6 +135,7 @@ throw new CiBailout("unbalanced monitors: found monitor for unknown frame"); } } + assert state.bci >= 0 || state.bci == FrameState.BEFORE_BCI; CiFrame frame = new CiFrame(caller, state.method(), state.bci, state.rethrowException(), state.duringCall(), values, state.localsSize(), state.stackSize(), numLocks); return frame; } diff -r fc42b5b6941a -r 9d48ccb39292 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Fri Feb 24 20:39:12 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Fri Feb 24 22:32:43 2012 +0100 @@ -29,11 +29,13 @@ import com.oracle.max.cri.ci.*; import com.oracle.max.cri.ri.*; import com.oracle.max.cri.ri.RiType.Representation; +import com.oracle.max.criutils.*; import com.oracle.max.graal.compiler.*; import com.oracle.max.graal.compiler.phases.*; import com.oracle.max.graal.cri.*; import com.oracle.max.graal.debug.*; import com.oracle.max.graal.graph.*; +import com.oracle.max.graal.graph.Node.Verbosity; import com.oracle.max.graal.nodes.*; import com.oracle.max.graal.nodes.DeoptimizeNode.DeoptAction; import com.oracle.max.graal.nodes.PhiNode.PhiType; @@ -281,11 +283,11 @@ exceptionMerge = graph.add(new MergeNode()); exceptionMerge.setProbability(exceptionEdge.probability()); - exceptionMerge.setStateAfter(exceptionEdge.stateAfter().duplicate(invoke.stateAfter().bci)); FixedNode exceptionSux = exceptionObject.next(); graph.addBeforeFixed(exceptionSux, exceptionMerge); exceptionObjectPhi = graph.unique(new PhiNode(CiKind.Object, exceptionMerge, PhiType.Value)); + exceptionMerge.setStateAfter(exceptionEdge.stateAfter().duplicateModified(invoke.stateAfter().bci, true, CiKind.Void, exceptionObjectPhi)); } // create one separate block for each invoked method diff -r fc42b5b6941a -r 9d48ccb39292 graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Fri Feb 24 20:39:12 2012 +0100 +++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java Fri Feb 24 22:32:43 2012 +0100 @@ -359,6 +359,7 @@ } } + // TODO(tw): Merge BeginNode with ExceptionObject node to get a correct and uniform FrameState. BeginNode p = currentGraph.add(new BeginNode()); p.setStateAfter(frameState.duplicateWithoutStack(bci)); diff -r fc42b5b6941a -r 9d48ccb39292 src/share/vm/c1/c1_Runtime1.cpp --- a/src/share/vm/c1/c1_Runtime1.cpp Fri Feb 24 20:39:12 2012 +0100 +++ b/src/share/vm/c1/c1_Runtime1.cpp Fri Feb 24 22:32:43 2012 +0100 @@ -462,11 +462,6 @@ thread->set_is_method_handle_return(false); Handle exception(thread, ex); -#ifdef GRAAL - if (exception.is_null()) { - exception = Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL); - } -#endif nm = CodeCache::find_nmethod(pc); assert(nm != NULL, "this is not an nmethod"); // Adjust the pc as needed/