# HG changeset patch # User Thomas Wuerthinger # Date 1327068812 -3600 # Node ID c66ddad845a463529dfea208923c848c4f141bc3 # Parent 3d8e80de2c29d4cd753c9be0223ecd2db62770bc Merge fixes. diff -r 3d8e80de2c29 -r c66ddad845a4 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/LinearScanAllocator.java --- 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); } diff -r 3d8e80de2c29 -r c66ddad845a4 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java --- 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); diff -r 3d8e80de2c29 -r c66ddad845a4 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/IntervalPrinter.java --- 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()); +// } } diff -r 3d8e80de2c29 -r c66ddad845a4 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java --- 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;