Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java @ 2764:99912abb3ff7
Phi clean up. Phis no longer save their local/stack index.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Mon, 23 May 2011 15:07:01 +0200 |
parents | 5e8a69041cd7 |
children | 43ffa0e47a46 |
comparison
equal
deleted
inserted
replaced
2763:5e8a69041cd7 | 2764:99912abb3ff7 |
---|---|
259 public Phi setupPhiForStack(BlockBegin block, int i) { | 259 public Phi setupPhiForStack(BlockBegin block, int i) { |
260 Value p = stackAt(i); | 260 Value p = stackAt(i); |
261 if (p != null) { | 261 if (p != null) { |
262 if (p instanceof Phi) { | 262 if (p instanceof Phi) { |
263 Phi phi = (Phi) p; | 263 Phi phi = (Phi) p; |
264 if (phi.block() == block && phi.isOnStack() && phi.stackIndex() == i) { | 264 if (phi.block() == block) { |
265 return phi; | 265 return phi; |
266 } | 266 } |
267 } | 267 } |
268 Phi phi = new Phi(p.kind, block, -i - 1, graph()); | 268 Phi phi = new Phi(p.kind, block, graph()); |
269 inputs().set(localsSize + i, phi); | 269 inputs().set(localsSize + i, phi); |
270 return phi; | 270 return phi; |
271 } | 271 } |
272 return null; | 272 return null; |
273 } | 273 } |
279 */ | 279 */ |
280 public Phi setupPhiForLocal(BlockBegin block, int i) { | 280 public Phi setupPhiForLocal(BlockBegin block, int i) { |
281 Value p = localAt(i); | 281 Value p = localAt(i); |
282 if (p instanceof Phi) { | 282 if (p instanceof Phi) { |
283 Phi phi = (Phi) p; | 283 Phi phi = (Phi) p; |
284 if (phi.block() == block && phi.isLocal() && phi.localIndex() == i) { | 284 if (phi.block() == block) { |
285 return phi; | 285 return phi; |
286 } | 286 } |
287 } | 287 } |
288 Phi phi = new Phi(p.kind, block, i, graph()); | 288 Phi phi = new Phi(p.kind, block, graph()); |
289 storeLocal(i, phi); | 289 storeLocal(i, phi); |
290 return phi; | 290 return phi; |
291 } | 291 } |
292 | 292 |
293 /** | 293 /** |
350 // this is a stack slot | 350 // this is a stack slot |
351 phi = setupPhiForStack(block, i - localsSize); | 351 phi = setupPhiForStack(block, i - localsSize); |
352 } | 352 } |
353 | 353 |
354 Phi originalPhi = phi; | 354 Phi originalPhi = phi; |
355 if (phi.phiInputCount() == 0) { | 355 if (phi.valueCount() == 0) { |
356 int size = block.predecessors().size(); | 356 int size = block.predecessors().size(); |
357 if (blockAppended) { | 357 if (blockAppended) { |
358 size--; | 358 size--; |
359 } | 359 } |
360 for (int j = 0; j < size; ++j) { | 360 for (int j = 0; j < size; ++j) { |