@Override public boolean enterBlock(final Block block) { if (block.isCatchBlock()) { return false; } final long weight = WeighNodes.weigh(block, weightCache); if (weight < SPLIT_THRESHOLD) { weightCache.put(block, weight); return false; } return true; }
@Override public Node leaveBlock(final Block block) { assert !block.isCatchBlock(); Block newBlock = block; // Block was heavier than SLIT_THRESHOLD in enter, but a sub-block may have // been split already, so weigh again before splitting. long weight = WeighNodes.weigh(block, weightCache); if (weight >= SPLIT_THRESHOLD) { final FunctionNode currentFunction = lc.getCurrentFunction(); newBlock = splitBlock(block, currentFunction); weight = WeighNodes.weigh(newBlock, weightCache); lc.setFlag(currentFunction, FunctionNode.IS_SPLIT); } weightCache.put(newBlock, weight); return newBlock; }