Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2582:768d77a1c7af
new node layout: Instruction
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 05 May 2011 13:47:14 +0200 |
parents | 4a36a0bd6d18 |
children | 421da5f53b5e |
comparison
equal
deleted
inserted
replaced
2581:4a36a0bd6d18 | 2582:768d77a1c7af |
---|---|
180 BlockBegin syncHandler = null; | 180 BlockBegin syncHandler = null; |
181 | 181 |
182 // 3. setup internal state for appending instructions | 182 // 3. setup internal state for appending instructions |
183 curBlock = startBlock; | 183 curBlock = startBlock; |
184 lastInstr = startBlock; | 184 lastInstr = startBlock; |
185 lastInstr.setNext(null, -1); | 185 lastInstr.appendNext(null, -1); |
186 curState = initialState; | 186 curState = initialState; |
187 | 187 |
188 if (isSynchronized(rootMethod.accessFlags())) { | 188 if (isSynchronized(rootMethod.accessFlags())) { |
189 // 4A.1 add a monitor enter to the start block | 189 // 4A.1 add a monitor enter to the start block |
190 rootMethodSynchronizedObject = synchronizedObject(initialState, compilation.method); | 190 rootMethodSynchronizedObject = synchronizedObject(initialState, compilation.method); |
1163 assert x.next() == null : "instruction should not have been appended yet"; | 1163 assert x.next() == null : "instruction should not have been appended yet"; |
1164 assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")"; | 1164 assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")"; |
1165 if (lastInstr instanceof Base) { | 1165 if (lastInstr instanceof Base) { |
1166 assert false : "may only happen when inlining intrinsics"; | 1166 assert false : "may only happen when inlining intrinsics"; |
1167 } else { | 1167 } else { |
1168 lastInstr = lastInstr.setNext(x, bci); | 1168 lastInstr = lastInstr.appendNext(x, bci); |
1169 } | 1169 } |
1170 if (++stats.nodeCount >= C1XOptions.MaximumInstructionCount) { | 1170 if (++stats.nodeCount >= C1XOptions.MaximumInstructionCount) { |
1171 // bailout if we've exceeded the maximum inlining size | 1171 // bailout if we've exceeded the maximum inlining size |
1172 throw new CiBailout("Method and/or inlining is too large"); | 1172 throw new CiBailout("Method and/or inlining is too large"); |
1173 } | 1173 } |
1287 // now parse the block | 1287 // now parse the block |
1288 killMemoryMap(); | 1288 killMemoryMap(); |
1289 curBlock = b; | 1289 curBlock = b; |
1290 curState = b.stateBefore().copy(); | 1290 curState = b.stateBefore().copy(); |
1291 lastInstr = b; | 1291 lastInstr = b; |
1292 b.setNext(null, -1); | 1292 b.appendNext(null, -1); |
1293 | 1293 |
1294 iterateBytecodesForBlock(b.bci(), false); | 1294 iterateBytecodesForBlock(b.bci(), false); |
1295 } | 1295 } |
1296 } | 1296 } |
1297 } | 1297 } |
1319 } | 1319 } |
1320 } | 1320 } |
1321 if (nextBlock != null && nextBlock != block) { | 1321 if (nextBlock != null && nextBlock != block) { |
1322 // we fell through to the next block, add a goto and break | 1322 // we fell through to the next block, add a goto and break |
1323 end = new Goto(nextBlock, null, false); | 1323 end = new Goto(nextBlock, null, false); |
1324 lastInstr = lastInstr.setNext(end, prevBCI); | 1324 lastInstr = lastInstr.appendNext(end, prevBCI); |
1325 break; | 1325 break; |
1326 } | 1326 } |
1327 // read the opcode | 1327 // read the opcode |
1328 int opcode = stream.currentBC(); | 1328 int opcode = stream.currentBC(); |
1329 | 1329 |