changeset 21196:00bbd2badfd3

{AMD64/SPARC}LIRGenerator: cache SpillMoveFactory (again).
author Josef Eisl <josef.eisl@jku.at>
date Wed, 29 Apr 2015 09:28:58 +0200
parents a4b60873851b
children 50a21b1fe8b7
files graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/PhiResolver.java
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Thu Apr 23 11:30:06 2015 +0200
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Wed Apr 29 09:28:58 2015 +0200
@@ -76,6 +76,7 @@
 public abstract class AMD64LIRGenerator extends LIRGenerator implements AMD64ArithmeticLIRGenerator {
 
     private static final RegisterValue RCX_I = AMD64.rcx.asValue(LIRKind.value(Kind.Int));
+    private AMD64SpillMoveFactory moveFactory;
 
     private class AMD64SpillMoveFactory implements LIRGeneratorTool.SpillMoveFactory {
 
@@ -90,7 +91,10 @@
     }
 
     public SpillMoveFactory getSpillMoveFactory() {
-        return new AMD64SpillMoveFactory();
+        if (moveFactory == null) {
+            moveFactory = new AMD64SpillMoveFactory();
+        }
+        return moveFactory;
     }
 
     @Override
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Thu Apr 23 11:30:06 2015 +0200
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Wed Apr 29 09:28:58 2015 +0200
@@ -70,6 +70,7 @@
 public abstract class SPARCLIRGenerator extends LIRGenerator {
 
     private StackSlotValue tmpStackSlot;
+    private SPARCSpillMoveFactory moveFactory;
 
     private class SPARCSpillMoveFactory implements LIRGeneratorTool.SpillMoveFactory {
 
@@ -84,7 +85,10 @@
     }
 
     public SpillMoveFactory getSpillMoveFactory() {
-        return new SPARCSpillMoveFactory();
+        if (moveFactory == null) {
+            moveFactory = new SPARCSpillMoveFactory();
+        }
+        return moveFactory;
     }
 
     @Override