changeset 2539:fa3bda50cbfd

More clean up on Value.Flags.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 20:22:05 +0200
parents e1ba5a93e997
children 3fc322165071
files graal/GraalCompiler/src/com/sun/c1x/ir/AccessField.java graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java graal/GraalCompiler/src/com/sun/c1x/ir/StoreField.java graal/GraalCompiler/src/com/sun/c1x/ir/StoreIndexed.java graal/GraalCompiler/src/com/sun/c1x/ir/Value.java graal/GraalCompiler/src/com/sun/c1x/opt/LivenessMarker.java
diffstat 6 files changed, 6 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/AccessField.java	Wed Apr 27 20:13:54 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/AccessField.java	Wed Apr 27 20:22:05 2011 +0200
@@ -36,6 +36,7 @@
 
     private Value object;
     protected final RiField field;
+    private boolean needsPatching;
 
     /**
      * Constructs a new access field object.
@@ -53,7 +54,7 @@
         if (!isLoaded || (C1XOptions.TestPatching && !Modifier.isVolatile(field.accessFlags()))) {
             // require patching if the field is not loaded (i.e. resolved),
             // or if patch testing is turned on (but not if the field is volatile)
-            setFlag(Flag.NeedsPatching);
+            needsPatching = true;
         }
         initFlag(Flag.IsLoaded, isLoaded);
         if (isLoaded && object.isNonNull()) {
@@ -115,7 +116,7 @@
      * @return {@code true} if this field access will require patching
      */
     public boolean needsPatching() {
-        return checkFlag(Flag.NeedsPatching);
+        return needsPatching;
     }
 
     /**
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java	Wed Apr 27 20:13:54 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java	Wed Apr 27 20:22:05 2011 +0200
@@ -53,6 +53,7 @@
         this.successors = successors == null ? new ArrayList<BlockBegin>(2) : successors;
         setStateAfter(stateAfter);
         this.isSafepoint = isSafepoint;
+        setFlag(Flag.LiveSideEffect);
     }
 
     public BlockEnd(CiKind kind, FrameState stateAfter, boolean isSafepoint) {
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/StoreField.java	Wed Apr 27 20:13:54 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/StoreField.java	Wed Apr 27 20:22:05 2011 +0200
@@ -49,7 +49,7 @@
     public StoreField(Value object, RiField field, Value value, FrameState stateBefore, boolean isLoaded) {
         super(CiKind.Void, object, field, stateBefore, isLoaded);
         this.value = value;
-        setFlag(Flag.LiveStore);
+        setFlag(Flag.LiveSideEffect);
         if (value.kind != CiKind.Object) {
             setFlag(Flag.NoWriteBarrier);
         }
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/StoreIndexed.java	Wed Apr 27 20:13:54 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/StoreIndexed.java	Wed Apr 27 20:22:05 2011 +0200
@@ -52,7 +52,7 @@
     public StoreIndexed(Value array, Value index, Value length, CiKind elementType, Value value, FrameState stateBefore) {
         super(CiKind.Void, array, index, length, elementType, stateBefore);
         this.value = value;
-        setFlag(Flag.LiveStore);
+        setFlag(Flag.LiveSideEffect);
         if (elementType != CiKind.Object) {
             setFlag(Flag.NoWriteBarrier);
         }
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Value.java	Wed Apr 27 20:13:54 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Value.java	Wed Apr 27 20:22:05 2011 +0200
@@ -47,12 +47,9 @@
         NoReadBarrier,      // does not require read barrier
         NoWriteBarrier,     // does not require write barrier
         IsLoaded,           // field or method is resolved and class is loaded and initialized
-        NeedsPatching,
         LiveValue,          // live because value is used
         LiveDeopt,          // live for deoptimization
-        LiveControl,        // live for control dependencies
         LiveSideEffect,     // live for possible side-effects only
-        LiveStore,          // instruction is a store
         PhiDead,            // phi is illegal because local is dead
         PhiCannotSimplify,  // phi cannot be simplified
         PhiVisited;         // phi has been visited during simplification
@@ -62,7 +59,6 @@
 
     private static final int LIVE_FLAGS = Flag.LiveValue.mask |
                                           Flag.LiveDeopt.mask |
-                                          Flag.LiveControl.mask |
                                           Flag.LiveSideEffect.mask;
     /**
      * The kind of this value. This is {@link CiKind#Void} for instructions that produce no value.
--- a/graal/GraalCompiler/src/com/sun/c1x/opt/LivenessMarker.java	Wed Apr 27 20:13:54 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/opt/LivenessMarker.java	Wed Apr 27 20:22:05 2011 +0200
@@ -148,19 +148,10 @@
             stateBefore.valuesDo(deoptMarker);
             i.inputValuesDo(valueMarker);
             setFlag(i, LiveSideEffect);
-        } else if (i.checkFlag(LiveStore)) {
-            // instruction is a store that cannot be eliminated
-            i.inputValuesDo(valueMarker);
-            setFlag(i, LiveSideEffect);
         } else if (i.checkFlag(LiveSideEffect)) {
             // instruction has a side effect
             i.inputValuesDo(valueMarker);
         }
-        if (i instanceof BlockEnd) {
-            // input values to block ends are control dependencies
-            i.inputValuesDo(valueMarker);
-            setFlag(i, LiveControl);
-        }
         FrameState stateAfter = i.stateAfter();
         if (stateAfter != null) {
             stateAfter.valuesDo(deoptMarker);