diff graal/GraalCompiler/src/com/sun/c1x/gen/LIRItem.java @ 2537:4a016ff4d2df

Clean up on LIRGenerator and related.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 19:53:46 +0200
parents 16b9a8b5ad39
children
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRItem.java	Wed Apr 27 19:30:56 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRItem.java	Wed Apr 27 19:53:46 2011 +0200
@@ -75,34 +75,13 @@
      */
     private CiValue intermediateOperand;
 
-    public LIRItem(Value value, LIRGenerator gen) {
+    public LIRItem(Value instruction, LIRGenerator gen) {
         this.gen = gen;
-        setInstruction(value);
-    }
-
-    public void setInstruction(Value instruction) {
         this.instruction = instruction;
-        if (instruction != null) {
-            resultOperand = gen.makeOperand(instruction);
-        } else {
-            resultOperand = CiValue.IllegalValue;
-        }
+        resultOperand = gen.makeOperand(instruction);
         intermediateOperand = CiValue.IllegalValue;
     }
 
-    public LIRItem(LIRGenerator gen) {
-        this.gen = gen;
-        setInstruction(null);
-    }
-
-    public void loadItem(CiKind kind) {
-        if (kind == CiKind.Byte || kind == CiKind.Boolean) {
-            loadByteItem();
-        } else {
-            loadItem();
-        }
-    }
-
     public void loadForStore(CiKind kind) {
         if (gen.canStoreAsConstant(instruction, kind)) {
             resultOperand = instruction.operand();
@@ -168,25 +147,12 @@
     }
 
     public void loadNonconstant() {
-        if (gen.compilation.target.arch.isX86()) {
-            CiValue r = instruction.operand();
-            if (r.isConstant()) {
-                resultOperand = r;
-            } else {
-                loadItem();
-            }
-        } else if (gen.compilation.target.arch.isSPARC()) {
-            CiValue r = instruction.operand();
-            if (gen.canInlineAsConstant(instruction)) {
-                if (!r.isConstant()) {
-                    r = instruction.asConstant();
-                }
-                resultOperand = r;
-            } else {
-                loadItem();
-            }
+        assert gen.compilation.target.arch.isX86();
+        CiValue r = instruction.operand();
+        if (r.isConstant()) {
+            resultOperand = r;
         } else {
-            Util.shouldNotReachHere();
+            loadItem();
         }
     }