changeset 21728:99fe8116f3e8

Make shared NO_VALUES array
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 03 Jun 2015 19:35:19 -0700
parents 645f170013a4
children e7f5ddef438d
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java
diffstat 2 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java	Mon Jun 01 22:14:34 2015 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java	Wed Jun 03 19:35:19 2015 -0700
@@ -64,8 +64,6 @@
     public static final class LabelOp extends LIRInstruction {
         public static final LIRInstructionClass<LabelOp> TYPE = LIRInstructionClass.create(LabelOp.class);
 
-        private static final Value[] NO_VALUES = new Value[0];
-
         /**
          * In the LIR, every register and variable must be defined before it is used. For method
          * parameters that are passed in fixed registers, exception objects passed to the exception
@@ -83,7 +81,7 @@
             super(TYPE);
             this.label = label;
             this.align = align;
-            this.incomingValues = NO_VALUES;
+            this.incomingValues = Value.NO_VALUES;
         }
 
         public void setIncomingValues(Value[] values) {
@@ -101,7 +99,7 @@
         }
 
         public void clearIncomingValues() {
-            incomingValues = NO_VALUES;
+            incomingValues = Value.NO_VALUES;
         }
 
         @Override
@@ -130,8 +128,6 @@
     public static class JumpOp extends LIRInstruction implements BlockEndOp {
         public static final LIRInstructionClass<JumpOp> TYPE = LIRInstructionClass.create(JumpOp.class);
 
-        private static final Value[] NO_VALUES = new Value[0];
-
         @Alive({REG, STACK, CONST}) private Value[] outgoingValues;
 
         private final LabelRef destination;
@@ -143,7 +139,7 @@
         protected JumpOp(LIRInstructionClass<? extends JumpOp> c, LabelRef destination) {
             super(c);
             this.destination = destination;
-            this.outgoingValues = NO_VALUES;
+            this.outgoingValues = Value.NO_VALUES;
         }
 
         public void setOutgoingValues(Value[] values) {
@@ -161,7 +157,7 @@
         }
 
         public void clearOutgoingValues() {
-            outgoingValues = NO_VALUES;
+            outgoingValues = Value.NO_VALUES;
         }
 
         @Override
--- a/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java	Mon Jun 01 22:14:34 2015 +0200
+++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java	Wed Jun 03 19:35:19 2015 -0700
@@ -28,6 +28,8 @@
  */
 public interface Value extends KindProvider, TrustedInterface {
 
+    Value[] NO_VALUES = new Value[0];
+
     AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) {
 
         @Override