changeset 4278:b49981617b10

Fixes after removal of GraalCompilation
author Christian Wimmer <Christian.Wimmer@Oracle.com>
date Thu, 12 Jan 2012 13:44:57 -0800
parents 9a3a0cdb6e34
children cdcd26f86af5
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinter.java graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java
diffstat 4 files changed, 21 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Thu Jan 12 13:44:18 2012 -0800
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Thu Jan 12 13:44:57 2012 -0800
@@ -305,7 +305,7 @@
                 }
 
                 if (context.isObserved()) {
-                    context.observable.fireCompilationEvent("After LIR generation", graph, lir);
+                    context.observable.fireCompilationEvent("After LIR generation", graph, lir, lirGenerator);
                 }
                 if (GraalOptions.PrintLIR && !TTY.isSuppressed()) {
                     LIR.printLIR(lir.linearScanOrder());
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java	Thu Jan 12 13:44:18 2012 -0800
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java	Thu Jan 12 13:44:57 2012 -0800
@@ -154,7 +154,7 @@
 
         } else if (value != null) {
             CiValue operand = nodeOperands.get(value);
-            assert operand != null && operand instanceof Variable || operand instanceof CiConstant;
+            assert operand != null && (operand instanceof Variable || operand instanceof CiConstant);
             return operand;
 
         } else {
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinter.java	Thu Jan 12 13:44:18 2012 -0800
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinter.java	Thu Jan 12 13:44:57 2012 -0800
@@ -51,8 +51,8 @@
     public final ByteArrayOutputStream buffer;
     public final CiTarget target;
     public final RiRuntime runtime;
-    private LIR lir;
-    private LIRGenerator lirGenerator;
+    public LIR lir;
+    public LIRGenerator lirGenerator;
 
     /**
      * Creates a control flow graph printer.
@@ -66,11 +66,6 @@
         this.runtime = runtime;
     }
 
-    public void setLIR(LIR lir, LIRGenerator lirGenerator) {
-        this.lir = lir;
-        this.lirGenerator = lirGenerator;
-    }
-
     /**
      * Prints the control flow graph denoted by a given block map.
      *
@@ -129,18 +124,17 @@
      *
      * @param label A label describing the compilation phase that produced the control flow graph.
      * @param blocks The list of blocks to be printed.
-     * @param printNodes If {@code true} the nodes in the block will be printed.
      */
-    public void printCFG(String label, List<? extends Block> blocks, boolean printNodes) {
+    public void printCFG(String label, List<? extends Block> blocks) {
         begin("cfg");
         out.print("name \"").print(label).println('"');
         for (Block block : blocks) {
-            printBlock(block, printNodes);
+            printBlock(block);
         }
         end("cfg");
     }
 
-    private void printBlock(Block block, boolean printNodes) {
+    private void printBlock(Block block) {
         begin("block");
 
         out.print("name \"").print(blockToString(block)).println('"');
@@ -184,9 +178,7 @@
         out.print("loop_index ").println(block.loopIndex());
         out.print("loop_depth ").println(block.loopDepth());
 
-        if (printNodes) {
-            printNodes(block);
-        }
+        printNodes(block);
 
         if (block instanceof LIRBlock) {
             printLIR((LIRBlock) block);
@@ -228,13 +220,14 @@
         } else if (node instanceof FloatingNode) {
             out.print("f ").print(HOVER_START).print("~").print(HOVER_SEP).print("floating").print(HOVER_END).println(COLUMN_END);
         }
-        if (lirGenerator != null && lirGenerator.nodeOperands != null && node instanceof ValueNode) {
+        out.print("tid ").print(nodeToString(node)).println(COLUMN_END);
+
+        if (lirGenerator != null) {
             CiValue operand = lirGenerator.nodeOperands.get(node);
             if (operand != null) {
                 out.print("result ").print(operand.toString()).println(COLUMN_END);
             }
         }
-        out.print("tid ").print(nodeToString(node)).println(COLUMN_END);
 
         if (node instanceof StateSplit) {
             StateSplit stateSplit = (StateSplit) node;
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java	Thu Jan 12 13:44:18 2012 -0800
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java	Thu Jan 12 13:44:57 2012 -0800
@@ -77,11 +77,16 @@
         }
 
         RiRuntime runtime = cfgPrinter.runtime;
-        cfgPrinter.setLIR(event.debugObject(LIR.class), event.debugObject(LIRGenerator.class));
+        if (event.debugObject(LIR.class) != null) {
+            cfgPrinter.lir = event.debugObject(LIR.class);
+        }
+        if (event.debugObject(LIRGenerator.class) != null) {
+            cfgPrinter.lirGenerator = event.debugObject(LIRGenerator.class);
+        }
+
         BlockMap blockMap = event.debugObject(BlockMap.class);
         Graph graph = event.debugObject(Graph.class);
         IdentifyBlocksPhase schedule = event.debugObject(IdentifyBlocksPhase.class);
-        LIR lir = event.debugObject(LIR.class);
         LinearScan allocator = event.debugObject(LinearScan.class);
         Interval[] intervals = event.debugObject(Interval[].class);
         CiTargetMethod targetMethod = event.debugObject(CiTargetMethod.class);
@@ -90,8 +95,8 @@
             cfgPrinter.printCFG(event.label, blockMap);
             cfgPrinter.printBytecodes(runtime.disassemble(blockMap.method));
         }
-        if (lir != null) {
-            cfgPrinter.printCFG(event.label, lir.codeEmittingOrder(), graph != null);
+        if (cfgPrinter.lir != null) {
+            cfgPrinter.printCFG(event.label, cfgPrinter.lir.codeEmittingOrder());
             if (targetMethod != null) {
                 cfgPrinter.printMachineCode(runtime.disassemble(targetMethod), null);
             }
@@ -110,7 +115,7 @@
                 }
             }
             if (blocks != null) {
-                cfgPrinter.printCFG(event.label, blocks, true);
+                cfgPrinter.printCFG(event.label, blocks);
             }
         }
         if (allocator != null && intervals != null) {