Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2801:2af109bec0c0
Make block contains a list of nodes instead a list of instructions.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Fri, 27 May 2011 15:11:34 +0200 |
parents | aeccd2af4e9e |
children | c3f64b66fc78 |
comparison
equal
deleted
inserted
replaced
2800:e3a0630a1dab | 2801:2af109bec0c0 |
---|---|
22 */ | 22 */ |
23 package com.sun.c1x.graph; | 23 package com.sun.c1x.graph; |
24 | 24 |
25 import java.util.*; | 25 import java.util.*; |
26 | 26 |
27 import com.oracle.graal.graph.*; | |
27 import com.oracle.max.graal.schedule.*; | 28 import com.oracle.max.graal.schedule.*; |
28 import com.sun.c1x.*; | 29 import com.sun.c1x.*; |
29 import com.sun.c1x.debug.*; | 30 import com.sun.c1x.debug.*; |
30 import com.sun.c1x.ir.*; | 31 import com.sun.c1x.ir.*; |
31 import com.sun.c1x.lir.*; | 32 import com.sun.c1x.lir.*; |
60 */ | 61 */ |
61 public IR(C1XCompilation compilation) { | 62 public IR(C1XCompilation compilation) { |
62 this.compilation = compilation; | 63 this.compilation = compilation; |
63 } | 64 } |
64 | 65 |
65 public Map<Value, LIRBlock> valueToBlock; | 66 public Map<Node, LIRBlock> valueToBlock; |
66 | 67 |
67 /** | 68 /** |
68 * Builds the graph, optimizes it, and computes the linear scan block order. | 69 * Builds the graph, optimizes it, and computes the linear scan block order. |
69 */ | 70 */ |
70 public void build() { | 71 public void build() { |
114 finder.splitCriticalEdges(); | 115 finder.splitCriticalEdges(); |
115 | 116 |
116 | 117 |
117 orderedBlocks = lirBlocks; | 118 orderedBlocks = lirBlocks; |
118 | 119 |
119 valueToBlock = new HashMap<Value, LIRBlock>(); | 120 valueToBlock = new HashMap<Node, LIRBlock>(); |
120 for (LIRBlock b : orderedBlocks) { | 121 for (LIRBlock b : orderedBlocks) { |
121 for (Instruction i : b.getInstructions()) { | 122 for (Node i : b.getInstructions()) { |
122 valueToBlock.put(i, b); | 123 valueToBlock.put(i, b); |
123 } | 124 } |
124 } | 125 } |
125 startBlock = lirBlocks.get(0); | 126 startBlock = lirBlocks.get(0); |
126 assert startBlock != null; | 127 assert startBlock != null; |