changeset 17126:7a0bff31df98

Encapsulate creation of LinearScan object
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 16 Sep 2014 18:40:04 -0700
parents ce1b6453c544
children 3db919d1c8d5
files graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java	Tue Sep 16 18:36:59 2014 -0700
+++ b/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java	Tue Sep 16 18:40:04 2014 -0700
@@ -158,7 +158,7 @@
                 try (Scope s = Debug.scope("Allocator")) {
 
                     if (backend.shouldAllocateRegisters()) {
-                        new LinearScan(target, lir, frameMap).allocate();
+                        GraalCompiler.runLinearScan(target, lir, frameMap);
                     }
                 } catch (Throwable e) {
                     throw Debug.handle(e);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Tue Sep 16 18:36:59 2014 -0700
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Tue Sep 16 18:40:04 2014 -0700
@@ -269,7 +269,7 @@
 
             try (Scope s = Debug.scope("Allocator", nodeLirGen)) {
                 if (backend.shouldAllocateRegisters()) {
-                    new LinearScan(target, lir, frameMap).allocate();
+                    LinearScan.allocate(target, lir, frameMap);
                 }
             } catch (Throwable e) {
                 throw Debug.handle(e);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Tue Sep 16 18:36:59 2014 -0700
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Tue Sep 16 18:40:04 2014 -0700
@@ -1856,7 +1856,11 @@
         }
     }
 
-    public void allocate() {
+    public static void allocate(TargetDescription target, LIR lir, FrameMap frameMap) {
+        new LinearScan(target, lir, frameMap).allocate();
+    }
+
+    private void allocate() {
 
         /*
          * This is the point to enable debug logging for the whole register allocation.