comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java @ 20926:35e1b66f2810

Rename Stamp.illegal() to Stamp.empty().
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 14 Apr 2015 14:40:36 +0200
parents a7ee2e1f0d4e
children 48c1ebd24120
comparison
equal deleted inserted replaced
20925:cea0b7285190 20926:35e1b66f2810
82 } 82 }
83 return null; 83 return null;
84 } 84 }
85 85
86 /** 86 /**
87 * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#isLegal() legal} pointer 87 * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#hasValues() legal}
88 * value which is known to be always null. 88 * pointer value which is known to be always null.
89 * 89 *
90 * @param node the node to check 90 * @param node the node to check
91 * @return true if this node represents a legal object value which is known to be always null 91 * @return true if this node represents a legal object value which is known to be always null
92 */ 92 */
93 public static boolean isPointerAlwaysNull(ValueNode node) { 93 public static boolean isPointerAlwaysNull(ValueNode node) {
94 return isPointerAlwaysNull(node.stamp()); 94 return isPointerAlwaysNull(node.stamp());
95 } 95 }
96 96
97 /** 97 /**
98 * Checks whether this {@link Stamp} represents a {@linkplain Stamp#isLegal() legal} pointer 98 * Checks whether this {@link Stamp} represents a {@linkplain Stamp#hasValues() legal} pointer
99 * stamp whose values are known to be always null. 99 * stamp whose values are known to be always null.
100 * 100 *
101 * @param stamp the stamp to check 101 * @param stamp the stamp to check
102 * @return true if this stamp represents a legal object stamp whose values are known to be 102 * @return true if this stamp represents a legal object stamp whose values are known to be
103 * always null 103 * always null
104 */ 104 */
105 public static boolean isPointerAlwaysNull(Stamp stamp) { 105 public static boolean isPointerAlwaysNull(Stamp stamp) {
106 if (stamp instanceof AbstractPointerStamp && stamp.isLegal()) { 106 if (stamp instanceof AbstractPointerStamp && stamp.hasValues()) {
107 return ((AbstractPointerStamp) stamp).alwaysNull(); 107 return ((AbstractPointerStamp) stamp).alwaysNull();
108 } 108 }
109 return false; 109 return false;
110 } 110 }
111 111
112 /** 112 /**
113 * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#isLegal() legal} pointer 113 * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#hasValues() legal}
114 * value which is known to never be null. 114 * pointer value which is known to never be null.
115 * 115 *
116 * @param node the node to check 116 * @param node the node to check
117 * @return true if this node represents a legal object value which is known to never be null 117 * @return true if this node represents a legal object value which is known to never be null
118 */ 118 */
119 public static boolean isPointerNonNull(ValueNode node) { 119 public static boolean isPointerNonNull(ValueNode node) {
120 return isPointerNonNull(node.stamp()); 120 return isPointerNonNull(node.stamp());
121 } 121 }
122 122
123 /** 123 /**
124 * Checks whether this {@link Stamp} represents a {@linkplain Stamp#isLegal() legal} pointer 124 * Checks whether this {@link Stamp} represents a {@linkplain Stamp#hasValues() legal} pointer
125 * stamp whose values are known to never be null. 125 * stamp whose values are known to never be null.
126 * 126 *
127 * @param stamp the stamp to check 127 * @param stamp the stamp to check
128 * @return true if this stamp represents a legal object stamp whose values are known to be 128 * @return true if this stamp represents a legal object stamp whose values are known to be
129 * always null 129 * always null
130 */ 130 */
131 public static boolean isPointerNonNull(Stamp stamp) { 131 public static boolean isPointerNonNull(Stamp stamp) {
132 if (stamp instanceof AbstractPointerStamp && stamp.isLegal()) { 132 if (stamp instanceof AbstractPointerStamp && stamp.hasValues()) {
133 return ((AbstractPointerStamp) stamp).nonNull(); 133 return ((AbstractPointerStamp) stamp).nonNull();
134 } 134 }
135 return false; 135 return false;
136 } 136 }
137 137
138 /** 138 /**
139 * Returns the {@linkplain ResolvedJavaType Java type} this {@linkplain ValueNode} has if it is 139 * Returns the {@linkplain ResolvedJavaType Java type} this {@linkplain ValueNode} has if it is
140 * a {@linkplain Stamp#isLegal() legal} Object value. 140 * a {@linkplain Stamp#hasValues() legal} Object value.
141 * 141 *
142 * @param node the node to check 142 * @param node the node to check
143 * @return the Java type this value has if it is a legal Object type, null otherwise 143 * @return the Java type this value has if it is a legal Object type, null otherwise
144 */ 144 */
145 public static ResolvedJavaType typeOrNull(ValueNode node) { 145 public static ResolvedJavaType typeOrNull(ValueNode node) {
146 return typeOrNull(node.stamp()); 146 return typeOrNull(node.stamp());
147 } 147 }
148 148
149 /** 149 /**
150 * Returns the {@linkplain ResolvedJavaType Java type} this {@linkplain Stamp} has if it is a 150 * Returns the {@linkplain ResolvedJavaType Java type} this {@linkplain Stamp} has if it is a
151 * {@linkplain Stamp#isLegal() legal} Object stamp. 151 * {@linkplain Stamp#hasValues() legal} Object stamp.
152 * 152 *
153 * @param stamp the stamp to check 153 * @param stamp the stamp to check
154 * @return the Java type this stamp has if it is a legal Object stamp, null otherwise 154 * @return the Java type this stamp has if it is a legal Object stamp, null otherwise
155 */ 155 */
156 public static ResolvedJavaType typeOrNull(Stamp stamp) { 156 public static ResolvedJavaType typeOrNull(Stamp stamp) {
157 if (stamp instanceof AbstractObjectStamp && stamp.isLegal()) { 157 if (stamp instanceof AbstractObjectStamp && stamp.hasValues()) {
158 return ((AbstractObjectStamp) stamp).type(); 158 return ((AbstractObjectStamp) stamp).type();
159 } 159 }
160 return null; 160 return null;
161 } 161 }
162 162
163 /** 163 /**
164 * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#isLegal() legal} Object 164 * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#hasValues() legal}
165 * value whose Java type is known exactly. If this method returns true then the 165 * Object value whose Java type is known exactly. If this method returns true then the
166 * {@linkplain ResolvedJavaType Java type} returned by {@link #typeOrNull(ValueNode)} is the 166 * {@linkplain ResolvedJavaType Java type} returned by {@link #typeOrNull(ValueNode)} is the
167 * concrete dynamic/runtime Java type of this value. 167 * concrete dynamic/runtime Java type of this value.
168 * 168 *
169 * @param node the node to check 169 * @param node the node to check
170 * @return true if this node represents a legal object value whose Java type is known exactly 170 * @return true if this node represents a legal object value whose Java type is known exactly
172 public static boolean isExactType(ValueNode node) { 172 public static boolean isExactType(ValueNode node) {
173 return isExactType(node.stamp()); 173 return isExactType(node.stamp());
174 } 174 }
175 175
176 /** 176 /**
177 * Checks whether this {@link Stamp} represents a {@linkplain Stamp#isLegal() legal} Object 177 * Checks whether this {@link Stamp} represents a {@linkplain Stamp#hasValues() legal} Object
178 * stamp whose {@linkplain ResolvedJavaType Java type} is known exactly. If this method returns 178 * stamp whose {@linkplain ResolvedJavaType Java type} is known exactly. If this method returns
179 * true then the Java type returned by {@link #typeOrNull(Stamp)} is the only concrete 179 * true then the Java type returned by {@link #typeOrNull(Stamp)} is the only concrete
180 * dynamic/runtime Java type possible for values of this stamp. 180 * dynamic/runtime Java type possible for values of this stamp.
181 * 181 *
182 * @param stamp the stamp to check 182 * @param stamp the stamp to check
183 * @return true if this node represents a legal object stamp whose Java type is known exactly 183 * @return true if this node represents a legal object stamp whose Java type is known exactly
184 */ 184 */
185 public static boolean isExactType(Stamp stamp) { 185 public static boolean isExactType(Stamp stamp) {
186 if (stamp instanceof AbstractObjectStamp && stamp.isLegal()) { 186 if (stamp instanceof AbstractObjectStamp && stamp.hasValues()) {
187 return ((AbstractObjectStamp) stamp).isExactType(); 187 return ((AbstractObjectStamp) stamp).isExactType();
188 } 188 }
189 return false; 189 return false;
190 } 190 }
191 } 191 }