diff graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2623:b129b7da1397

Some fixes around LIRGenerator / frame state. New option C1X:TraceLIRGeneratorLevel
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Tue, 10 May 2011 14:34:03 +0200
parents 91d3952f7eb7
children 569228710be8 c93adece95d2
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Tue May 10 12:37:46 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Tue May 10 14:34:03 2011 +0200
@@ -225,15 +225,29 @@
         blockDoProlog(block);
         this.currentBlock = block;
 
+        if (C1XOptions.TraceLIRGeneratorLevel >= 1) {
+            TTY.println("BEGIN Generating LIR for block B" + block.blockID);
+        }
+
         for (Instruction instr = block; instr != null; instr = instr.next()) {
             FrameState stateAfter = instr.stateAfter();
-            if (stateAfter != null) {
-                lastState = stateAfter;
-            }
             if (!(instr instanceof BlockBegin)) {
                 walkState(instr, stateAfter);
                 doRoot(instr);
             }
+            if (stateAfter != null) {
+                lastState = stateAfter;
+                if (C1XOptions.TraceLIRGeneratorLevel >= 2) {
+                    TTY.println("STATE CHANGE");
+                    if (C1XOptions.TraceLIRGeneratorLevel >= 3) {
+                        TTY.println(stateAfter.toString());
+                    }
+                }
+            }
+        }
+
+        if (C1XOptions.TraceLIRGeneratorLevel >= 1) {
+            TTY.println("END Generating LIR for block B" + block.blockID);
         }
 
         this.currentBlock = null;
@@ -256,7 +270,7 @@
     public void visitBase(Base x) {
         // emit phi-instruction move after safepoint since this simplifies
         // describing the state at the safepoint.
-        moveToPhi();
+        //moveToPhi();
 
         // all blocks with a successor must end with an unconditional jump
         // to the successor even if they are consecutive
@@ -1234,6 +1248,9 @@
     }
 
     void doRoot(Instruction instr) {
+        if (C1XOptions.TraceLIRGeneratorLevel >= 2) {
+            TTY.println("Emitting LIR for instruction " + instr.toString());
+        }
         currentInstruction = instr;
         assert !instr.hasSubst() : "shouldn't have missed substitution";