changeset 4359:c66ddad845a4

Merge fixes.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 20 Jan 2012 15:13:32 +0100
parents 3d8e80de2c29
children d203d8b25721
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/LinearScanAllocator.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/IntervalPrinter.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java
diffstat 4 files changed, 22 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/LinearScanAllocator.java	Fri Jan 20 15:08:24 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/LinearScanAllocator.java	Fri Jan 20 15:13:32 2012 +0100
@@ -39,16 +39,15 @@
 import com.oracle.max.graal.compiler.lir.LIRPhiMapping.PhiValueProcedure;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.compiler.util.*;
+import com.oracle.max.graal.debug.*;
 
 public class LinearScanAllocator {
-    private final GraalContext context;
     private final LIR lir;
     private final FrameMap frameMap;
 
     private final DataFlowAnalysis dataFlow;
 
-    public LinearScanAllocator(GraalContext context, LIR lir, FrameMap frameMap) {
-        this.context = context;
+    public LinearScanAllocator(LIR lir, FrameMap frameMap) {
         this.lir = lir;
         this.frameMap = frameMap;
 
@@ -159,23 +158,23 @@
         assert LIRVerifier.verify(true, lir, frameMap);
 
         dataFlow.execute();
-        IntervalPrinter.printBeforeAllocation("Before register allocation", context, lir, frameMap.registerConfig, dataFlow);
+        IntervalPrinter.printBeforeAllocation("Before register allocation", lir, frameMap.registerConfig, dataFlow);
 
         allocate();
 
-        IntervalPrinter.printAfterAllocation("After linear scan allocation", context, lir, frameMap.registerConfig, dataFlow, blockEndLocations);
+        IntervalPrinter.printAfterAllocation("After linear scan allocation", lir, frameMap.registerConfig, dataFlow, blockEndLocations);
 
         ResolveDataFlow resolveDataFlow = new ResolveDataFlowImpl(lir, moveResolver, dataFlow);
         resolveDataFlow.execute();
         frameMap.finish();
 
-        IntervalPrinter.printAfterAllocation("After resolve data flow", context, lir, frameMap.registerConfig, dataFlow, blockEndLocations);
+        IntervalPrinter.printAfterAllocation("After resolve data flow", lir, frameMap.registerConfig, dataFlow, blockEndLocations);
         assert RegisterVerifier.verify(lir, frameMap);
 
         AssignRegisters assignRegisters = new AssignRegistersImpl(lir, frameMap);
         assignRegisters.execute();
 
-        context.observable.fireCompilationEvent("After register asignment", lir);
+        Debug.dump(lir, "After register asignment");
         assert LIRVerifier.verify(false, lir, frameMap);
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java	Fri Jan 20 15:08:24 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java	Fri Jan 20 15:13:32 2012 +0100
@@ -133,21 +133,17 @@
         assert LIRVerifier.verify(true, lir, frameMap);
 
         dataFlow.execute();
-        IntervalPrinter.printBeforeAllocation("Before register allocation", context, lir, frameMap.registerConfig, dataFlow);
+        IntervalPrinter.printBeforeAllocation("Before register allocation", lir, frameMap.registerConfig, dataFlow);
 
         allocate();
 
-        IntervalPrinter.printAfterAllocation("After spill all allocation", context, lir, frameMap.registerConfig, dataFlow, blockLocations);
+        IntervalPrinter.printAfterAllocation("After spill all allocation", lir, frameMap.registerConfig, dataFlow, blockLocations);
 
         ResolveDataFlow resolveDataFlow = new ResolveDataFlowImpl(lir, moveResolver, dataFlow);
         resolveDataFlow.execute();
         frameMap.finish();
 
-
-        ResolveDataFlow resolveDataFlow = new ResolveDataFlowImpl(lir, moveResolver);
-        resolveDataFlow.execute();
-
-        IntervalPrinter.printAfterAllocation("After resolve data flow", context, lir, frameMap.registerConfig, dataFlow, blockLocations);
+        IntervalPrinter.printAfterAllocation("After resolve data flow", lir, frameMap.registerConfig, dataFlow, blockLocations);
         assert RegisterVerifier.verify(lir, frameMap);
 
         AssignRegisters assignRegisters = new AssignRegistersImpl(lir, frameMap);
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/IntervalPrinter.java	Fri Jan 20 15:08:24 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/IntervalPrinter.java	Fri Jan 20 15:13:32 2012 +0100
@@ -39,18 +39,18 @@
 
 public final class IntervalPrinter {
 
-    public static void printBeforeAllocation(String label, GraalContext context, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow) {
-        if (context.isObserved()) {
-            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, null);
-            context.observable.fireCompilationEvent(label, lir, printer.execute());
-        }
+    public static void printBeforeAllocation(String label, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow) {
+//        if (context.isObserved()) {
+//            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, null);
+//            context.observable.fireCompilationEvent(label, lir, printer.execute());
+//        }
     }
 
-    public static void printAfterAllocation(String label, GraalContext context, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
-        if (context.isObserved()) {
-            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, blockEndLocations);
-            context.observable.fireCompilationEvent(label, lir, printer.execute());
-        }
+    public static void printAfterAllocation(String label, LIR lir, RiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
+//        if (context.isObserved()) {
+//            IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, blockEndLocations);
+//            context.observable.fireCompilationEvent(label, lir, printer.execute());
+//        }
     }
 
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Fri Jan 20 15:08:24 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Fri Jan 20 15:13:32 2012 +0100
@@ -171,7 +171,7 @@
         if (GraalOptions.Lower) {
             new FloatingReadPhase().apply(graph);
             if (GraalOptions.OptGVN) {
-                new GlobalValueNumberingPhase().apply(graph, context);
+                new GlobalValueNumberingPhase().apply(graph);
             }
             if (GraalOptions.OptReadElimination) {
                 new ReadEliminationPhase().apply(graph);
@@ -244,8 +244,8 @@
 
         Debug.scope("Allocator", new Runnable() {
             public void run() {
-                new LinearScanAllocator(context, lir, frameMap).execute();
-//              new SpillAllAllocator(context, lir, frameMap).execute();
+                new LinearScanAllocator(lir, frameMap).execute();
+//              new SpillAllAllocator(lir, frameMap).execute();
             }
         });
         return frameMap;