Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2706:5a784215351a
Removed WasVisited flag
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 18 May 2011 17:35:14 +0200 |
parents | d669ab61c7c7 |
children | 4272b7af2d17 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Wed May 18 17:32:14 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Wed May 18 17:35:14 2011 +0200 @@ -237,6 +237,16 @@ return blocksOnWorklist.contains(block); } + private Set<BlockBegin> blocksVisited = new HashSet<BlockBegin>(); + + private void markVisited(BlockBegin block) { + blocksVisited.add(block); + } + + private boolean isVisited(BlockBegin block) { + return blocksVisited.contains(block); + } + private void finishStartBlock(BlockBegin startBlock, BlockBegin stdEntry) { assert curBlock == startBlock; FrameState stateAfter = frameState.create(bci()); @@ -336,7 +346,7 @@ exceptionHandlers.add(newHandler); // fill in exception handler subgraph lazily - if (!entry.wasVisited()) { + if (!isVisited(entry)) { addToWorkList(entry); } else { // This will occur for exception handlers that cover themselves. This code @@ -1048,8 +1058,8 @@ private void iterateAllBlocks() { BlockBegin b; while ((b = removeFromWorkList()) != null) { - if (!b.wasVisited()) { - b.setWasVisited(true); + if (!isVisited(b)) { + markVisited(b); // now parse the block curBlock = b; frameState.initializeFrom(b.stateBefore());