Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java @ 9089:5ab06146e985
Rename "node()" methods in interfaces to "asNode"
Remove erroneous javadoc in CyclicMaterializeStoreNode
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 12 Apr 2013 14:15:59 +0200 |
parents | 81ef56feff1b |
children | 0c8ec85fa013 |
comparison
equal
deleted
inserted
replaced
9088:89e4d67fdd2a | 9089:5ab06146e985 |
---|---|
181 replace(invoke, graph.unique(new ComputeAddressNode(arguments.get(0), arguments.get(1), StampFactory.forKind(wordKind)))); | 181 replace(invoke, graph.unique(new ComputeAddressNode(arguments.get(0), arguments.get(1), StampFactory.forKind(wordKind)))); |
182 break; | 182 break; |
183 | 183 |
184 case TO_OBJECT: | 184 case TO_OBJECT: |
185 assert arguments.size() == 1; | 185 assert arguments.size() == 1; |
186 replace(invoke, graph.unique(new UnsafeCastNode(arguments.get(0), invoke.node().stamp()))); | 186 replace(invoke, graph.unique(new UnsafeCastNode(arguments.get(0), invoke.asNode().stamp()))); |
187 break; | 187 break; |
188 | 188 |
189 default: | 189 default: |
190 throw new GraalInternalError("Unknown opcode: %s", operation.opcode()); | 190 throw new GraalInternalError("Unknown opcode: %s", operation.opcode()); |
191 } | 191 } |
225 private ValueNode nodeClassOp(StructuredGraph graph, Class<? extends ValueNode> nodeClass, ValueNode left, ValueNode right, Invoke invoke) { | 225 private ValueNode nodeClassOp(StructuredGraph graph, Class<? extends ValueNode> nodeClass, ValueNode left, ValueNode right, Invoke invoke) { |
226 try { | 226 try { |
227 Constructor<? extends ValueNode> constructor = nodeClass.getConstructor(Kind.class, ValueNode.class, ValueNode.class); | 227 Constructor<? extends ValueNode> constructor = nodeClass.getConstructor(Kind.class, ValueNode.class, ValueNode.class); |
228 ValueNode result = graph.add(constructor.newInstance(wordKind, left, right)); | 228 ValueNode result = graph.add(constructor.newInstance(wordKind, left, right)); |
229 if (result instanceof FixedWithNextNode) { | 229 if (result instanceof FixedWithNextNode) { |
230 graph.addBeforeFixed(invoke.node(), (FixedWithNextNode) result); | 230 graph.addBeforeFixed(invoke.asNode(), (FixedWithNextNode) result); |
231 } | 231 } |
232 return result; | 232 return result; |
233 } catch (Throwable ex) { | 233 } catch (Throwable ex) { |
234 throw new GraalInternalError(ex).addContext(nodeClass.getName()); | 234 throw new GraalInternalError(ex).addContext(nodeClass.getName()); |
235 } | 235 } |
265 return materialize; | 265 return materialize; |
266 } | 266 } |
267 | 267 |
268 private static ValueNode readOp(StructuredGraph graph, ValueNode base, ValueNode offset, Invoke invoke, Kind readKind, Object locationIdentity) { | 268 private static ValueNode readOp(StructuredGraph graph, ValueNode base, ValueNode offset, Invoke invoke, Kind readKind, Object locationIdentity) { |
269 IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, readKind, 0, offset, graph, 1); | 269 IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, readKind, 0, offset, graph, 1); |
270 ReadNode read = graph.add(new ReadNode(base, location, invoke.node().stamp())); | 270 ReadNode read = graph.add(new ReadNode(base, location, invoke.asNode().stamp())); |
271 graph.addBeforeFixed(invoke.node(), read); | 271 graph.addBeforeFixed(invoke.asNode(), read); |
272 // The read must not float outside its block otherwise it may float above an explicit zero | 272 // The read must not float outside its block otherwise it may float above an explicit zero |
273 // check on its base address | 273 // check on its base address |
274 read.dependencies().add(BeginNode.prevBegin(invoke.node())); | 274 read.dependencies().add(BeginNode.prevBegin(invoke.asNode())); |
275 return read; | 275 return read; |
276 } | 276 } |
277 | 277 |
278 private static ValueNode writeOp(StructuredGraph graph, ValueNode base, ValueNode offset, ValueNode value, Invoke invoke, Kind writeKind, Object locationIdentity) { | 278 private static ValueNode writeOp(StructuredGraph graph, ValueNode base, ValueNode offset, ValueNode value, Invoke invoke, Kind writeKind, Object locationIdentity) { |
279 IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, writeKind, 0, offset, graph, 1); | 279 IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, writeKind, 0, offset, graph, 1); |
280 WriteNode write = graph.add(new WriteNode(base, value, location, false)); | 280 WriteNode write = graph.add(new WriteNode(base, value, location, false)); |
281 write.setStateAfter(invoke.stateAfter()); | 281 write.setStateAfter(invoke.stateAfter()); |
282 graph.addBeforeFixed(invoke.node(), write); | 282 graph.addBeforeFixed(invoke.asNode(), write); |
283 return write; | 283 return write; |
284 } | 284 } |
285 | 285 |
286 private static void replace(Invoke invoke, ValueNode value) { | 286 private static void replace(Invoke invoke, ValueNode value) { |
287 FixedNode next = invoke.next(); | 287 FixedNode next = invoke.next(); |
288 invoke.setNext(null); | 288 invoke.setNext(null); |
289 invoke.node().replaceAtPredecessor(next); | 289 invoke.asNode().replaceAtPredecessor(next); |
290 invoke.node().replaceAtUsages(value); | 290 invoke.asNode().replaceAtUsages(value); |
291 GraphUtil.killCFG(invoke.node()); | 291 GraphUtil.killCFG(invoke.asNode()); |
292 } | 292 } |
293 | 293 |
294 public boolean isWord(ValueNode node) { | 294 public boolean isWord(ValueNode node) { |
295 /* | 295 /* |
296 * If we already know that we have a word type, we do not need to infer the stamp. This | 296 * If we already know that we have a word type, we do not need to infer the stamp. This |