Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/ir/Value.java @ 2546:e1b3db8031ee
Removed liveness marking.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Apr 2011 21:54:31 +0200 |
parents | 0f9eeb15e636 |
children | 4a36a0bd6d18 |
comparison
equal
deleted
inserted
replaced
2545:bb050fe2901d | 2546:e1b3db8031ee |
---|---|
35 public abstract class Value { | 35 public abstract class Value { |
36 | 36 |
37 public enum Flag { | 37 public enum Flag { |
38 NonNull, // this value is non-null | 38 NonNull, // this value is non-null |
39 | 39 |
40 LiveValue, // live because value is used | |
41 LiveDeopt, // live for deoptimization | |
42 LiveSideEffect, // live for possible side-effects only | |
43 | |
44 PhiDead, // phi is illegal because local is dead | 40 PhiDead, // phi is illegal because local is dead |
45 PhiCannotSimplify, // phi cannot be simplified | 41 PhiCannotSimplify, // phi cannot be simplified |
46 PhiVisited; // phi has been visited during simplification | 42 PhiVisited; // phi has been visited during simplification |
47 | 43 |
48 public final int mask = 1 << ordinal(); | 44 public final int mask = 1 << ordinal(); |
49 } | 45 } |
50 | 46 |
51 private static final int LIVE_FLAGS = Flag.LiveValue.mask | | |
52 Flag.LiveDeopt.mask | | |
53 Flag.LiveSideEffect.mask; | |
54 /** | 47 /** |
55 * The kind of this value. This is {@link CiKind#Void} for instructions that produce no value. | 48 * The kind of this value. This is {@link CiKind#Void} for instructions that produce no value. |
56 * This kind is guaranteed to be a {@linkplain CiKind#stackKind() stack kind}. | 49 * This kind is guaranteed to be a {@linkplain CiKind#stackKind() stack kind}. |
57 */ | 50 */ |
58 public final CiKind kind; | 51 public final CiKind kind; |
81 * @param kind the type of this value | 74 * @param kind the type of this value |
82 */ | 75 */ |
83 public Value(CiKind kind) { | 76 public Value(CiKind kind) { |
84 assert kind == kind.stackKind() : kind + " != " + kind.stackKind(); | 77 assert kind == kind.stackKind() : kind + " != " + kind.stackKind(); |
85 this.kind = kind; | 78 this.kind = kind; |
86 } | |
87 | |
88 /** | |
89 * Checks whether this instruction is live (i.e. code should be generated for it). | |
90 * This is computed in a dedicated pass by {@link LivenessMarker}. | |
91 * An instruction is live because its value is needed by another live instruction, | |
92 * because its value is needed for deoptimization, or the program is control dependent | |
93 * upon it. | |
94 * @return {@code true} if this instruction should be considered live | |
95 */ | |
96 public final boolean isLive() { | |
97 return C1XOptions.PinAllInstructions || (flags & LIVE_FLAGS) != 0; | |
98 } | |
99 | |
100 /** | |
101 * Clears all liveness flags. | |
102 */ | |
103 public final void clearLive() { | |
104 flags = flags & ~LIVE_FLAGS; | |
105 } | 79 } |
106 | 80 |
107 /** | 81 /** |
108 * Gets the instruction that should be substituted for this one. Note that this | 82 * Gets the instruction that should be substituted for this one. Note that this |
109 * method is recursive; if the substituted instruction has a substitution, then | 83 * method is recursive; if the substituted instruction has a substitution, then |