comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2705:d669ab61c7c7

Removed IsOnWorklistFlag
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 18 May 2011 17:32:14 +0200
parents 42450f536d24
children 5a784215351a
comparison
equal deleted inserted replaced
2704:efbdb3ea95c9 2705:d669ab61c7c7
203 finishStartBlock(startBlock, entryBlock); 203 finishStartBlock(startBlock, entryBlock);
204 204
205 // 4A.3 setup an exception handler to unlock the root method synchronized object 205 // 4A.3 setup an exception handler to unlock the root method synchronized object
206 syncHandler = new BlockBegin(Instruction.SYNCHRONIZATION_ENTRY_BCI, ir.nextBlockNumber(), graph); 206 syncHandler = new BlockBegin(Instruction.SYNCHRONIZATION_ENTRY_BCI, ir.nextBlockNumber(), graph);
207 syncHandler.setExceptionEntry(); 207 syncHandler.setExceptionEntry();
208 syncHandler.setBlockFlag(BlockBegin.BlockFlag.IsOnWorkList); 208 markOnWorkList(syncHandler);
209 209
210 ExceptionHandler h = new ExceptionHandler(new CiExceptionHandler(0, rootMethod.code().length, -1, 0, null)); 210 ExceptionHandler h = new ExceptionHandler(new CiExceptionHandler(0, rootMethod.code().length, -1, 0, null));
211 h.setEntryBlock(syncHandler); 211 h.setEntryBlock(syncHandler);
212 addExceptionHandler(h); 212 addExceptionHandler(h);
213 } else { 213 } else {
223 223
224 if (syncHandler != null && syncHandler.stateBefore() != null) { 224 if (syncHandler != null && syncHandler.stateBefore() != null) {
225 // generate unlocking code if the exception handler is reachable 225 // generate unlocking code if the exception handler is reachable
226 fillSyncHandler(rootMethodSynchronizedObject, syncHandler); 226 fillSyncHandler(rootMethodSynchronizedObject, syncHandler);
227 } 227 }
228 }
229
230 private Set<BlockBegin> blocksOnWorklist = new HashSet<BlockBegin>();
231
232 private void markOnWorkList(BlockBegin block) {
233 blocksOnWorklist.add(block);
234 }
235
236 private boolean isOnWorkList(BlockBegin block) {
237 return blocksOnWorklist.contains(block);
228 } 238 }
229 239
230 private void finishStartBlock(BlockBegin startBlock, BlockBegin stdEntry) { 240 private void finishStartBlock(BlockBegin startBlock, BlockBegin stdEntry) {
231 assert curBlock == startBlock; 241 assert curBlock == startBlock;
232 FrameState stateAfter = frameState.create(bci()); 242 FrameState stateAfter = frameState.create(bci());
1402 * This method will keep the worklist topologically stored (i.e. the lower 1412 * This method will keep the worklist topologically stored (i.e. the lower
1403 * DFNs are earlier in the list). 1413 * DFNs are earlier in the list).
1404 * @param block the block to add to the work list 1414 * @param block the block to add to the work list
1405 */ 1415 */
1406 private void addToWorkList(BlockBegin block) { 1416 private void addToWorkList(BlockBegin block) {
1407 if (!block.isOnWorkList()) { 1417 if (!isOnWorkList(block)) {
1408 block.setOnWorkList(true); 1418 markOnWorkList(block);
1409 sortIntoWorkList(block); 1419 sortIntoWorkList(block);
1410 } 1420 }
1411 } 1421 }
1412 1422
1413 private void sortIntoWorkList(BlockBegin top) { 1423 private void sortIntoWorkList(BlockBegin top) {