# HG changeset patch # User Gilles Duboscq # Date 1308645327 -7200 # Node ID b7f45b37dd43af60070a77844b4dc7dd02bb9645 # Parent 4afbc254f02d2a990988023bd35acc9d691df87d Fix bug in FrameState handling for LoopBegin, BitMap -> GraalBitMap in some assertions in graalCodeInstaller diff -r 4afbc254f02d -r b7f45b37dd43 graal/com.oracle.max.graal.compiler/.classpath --- a/graal/com.oracle.max.graal.compiler/.classpath Mon Jun 20 20:02:11 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/.classpath Tue Jun 21 10:35:27 2011 +0200 @@ -1,10 +1,10 @@ - - - - - - - - - - + + + + + + + + + + diff -r 4afbc254f02d -r b7f45b37dd43 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Mon Jun 20 20:02:11 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Tue Jun 21 10:35:27 2011 +0200 @@ -298,16 +298,7 @@ if (existingState == null) { // copy state because it is modified - FrameState duplicate = newState.duplicate(bci); - - // if the block is a loop header, insert all necessary phis - if (target.isLoopHeader && !isVisited(target)) { - LoopBegin loopBegin = loopBegin(target); - assert target.firstInstruction instanceof Placeholder && loopBegin != null; - //System.out.println("insertLoopPhis with " + target.loopHeaderState); - insertLoopPhis(loopBegin, loopBegin.stateAfter()); - } - first.setStateAfter(duplicate); + first.setStateAfter(newState.duplicate(bci)); } else { if (!GraalOptions.AssumeVerifiedBytecode && !existingState.isCompatibleWith(newState)) { // stacks or locks do not match--bytecodes would not verify @@ -1215,7 +1206,13 @@ markVisited(block); // now parse the block if (block.isLoopHeader) { - lastInstr = loopBegin(block); + LoopBegin begin = loopBegin(block); + FrameState preLoopState = block.firstInstruction.stateAfter(); + assert preLoopState != null; + FrameState duplicate = preLoopState.duplicate(preLoopState.bci); + begin.setStateAfter(duplicate); + insertLoopPhis(begin, duplicate); + lastInstr = begin; } else { lastInstr = block.firstInstruction; } diff -r 4afbc254f02d -r b7f45b37dd43 graal/com.oracle.max.graal.graphviz/.classpath --- a/graal/com.oracle.max.graal.graphviz/.classpath Mon Jun 20 20:02:11 2011 +0200 +++ b/graal/com.oracle.max.graal.graphviz/.classpath Tue Jun 21 10:35:27 2011 +0200 @@ -1,9 +1,9 @@ - - - - - - - - - + + + + + + + + + diff -r 4afbc254f02d -r b7f45b37dd43 src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Mon Jun 20 20:02:11 2011 +0200 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Tue Jun 21 10:35:27 2011 +0200 @@ -73,7 +73,7 @@ oop frame_map = (oop) CiDebugInfo::frameRefMap(debug_info); if (register_map != NULL) { - assert(BitMap::size(register_map) == (unsigned) NUM_CPU_REGS, "unexpected register_map length"); + assert(GraalBitMap::size(register_map) == (unsigned) NUM_CPU_REGS, "unexpected register_map length"); for (jint i = 0; i < NUM_CPU_REGS; i++) { bool is_oop = is_bit_set(register_map, i); VMReg reg = get_hotspot_reg(i); @@ -87,7 +87,7 @@ } if (frame_size > 0) { - assert(BitMap::size(frame_map) == frame_size / HeapWordSize, "unexpected frame_map length"); + assert(GraalBitMap::size(frame_map) == frame_size / HeapWordSize, "unexpected frame_map length"); for (jint i = 0; i < frame_size / HeapWordSize; i++) { bool is_oop = is_bit_set(frame_map, i); @@ -100,7 +100,7 @@ } } } else { - assert(frame_map == NULL || BitMap::size(frame_map) == 0, "cannot have frame_map for frames with size 0"); + assert(frame_map == NULL || GraalBitMap::size(frame_map) == 0, "cannot have frame_map for frames with size 0"); } return map;