protected void visitBasicBlocks(CFG cfg) { for (BasicBlock basicBlock: cfg.getBasicBlocks()) { BasicBlock(basicBlock); } }
public BasicBlock(CFG cfg, Label label) { this.label = label; this.cfg = cfg; id = cfg.getNextBBID(); isRescueEntry = false; assert label != null : "label is null"; initInstrs(); }
public void addGlobalEnsureBB(BasicBlock geb) { assert globalEnsureBB == null: "CFG for scope " + getScope() + " already has a global ensure block."; addBasicBlock(geb); addEdge(geb, getExitBB(), EdgeType.EXIT); for (BasicBlock b: getBasicBlocks()) { if (b != geb && !bbIsProtected(b) && b != getEntryBB()) { addEdge(b, geb, EdgeType.EXCEPTION); setRescuerBB(b, geb); } } globalEnsureBB = geb; }
public static BasicBlock[] linearize(CFG cfg) { BasicBlock[] list = new BasicBlock[cfg.size()]; BitSet processed = new BitSet(cfg.size()); int listSize = linearizeInner(cfg, list, 0, processed, cfg.getEntryBB()); verifyAllBasicBlocksProcessed(cfg, processed); fixupList(cfg, list, listSize); return list; }
private BasicBlock createBB(Label label, Stack<ExceptionRegion> nestedExceptionRegions) { BasicBlock basicBlock = new BasicBlock(this, label); addBasicBlock(basicBlock); if (!nestedExceptionRegions.empty()) nestedExceptionRegions.peek().addBB(basicBlock); return basicBlock; }
@Override public String toStringInstrs() { return "\nCFG:\n" + cfg.toStringGraph() + "\nInstructions:\n" + cfg.toStringInstrs(); }
private SimpleCloneInfo cloneHostInstrs() { SimpleCloneInfo ii = new SimpleCloneInfo(hostScope, false); for (BasicBlock b : cfg.getBasicBlocks()) { b.cloneInstrs(ii); } return ii; }
public LinkedList<BasicBlock> postOrderList() { // SSS FIXME: This caching is fragile -- requires invalidation // on change of CFG state. We need a better setup than this. if (postOrderList == null) postOrderList = buildPostOrderList(); return postOrderList; }
public BasicBlock[] linearizeBasicBlocks() { linearizedBBList = CFGLinearizer.linearize(cfg); return linearizedBBList; }
/** * Returns the scope into which code is being inlined. */ public IRScope getInlineHostScope() { return callerCFG.getScope(); }
public void addGlobalEnsureBB(BasicBlock geb) { assert globalEnsureBB == null: "CFG for scope " + getScope() + " already has a global ensure block."; addBasicBlock(geb); addEdge(geb, getExitBB(), EdgeType.EXIT); for (BasicBlock b: getBasicBlocks()) { if (b != geb && !bbIsProtected(b) && b != getEntryBB()) { addEdge(b, geb, EdgeType.EXCEPTION); setRescuerBB(b, geb); } } globalEnsureBB = geb; }
private BasicBlock createBB(Label label, Stack<ExceptionRegion> nestedExceptionRegions) { BasicBlock basicBlock = new BasicBlock(this, label); addBasicBlock(basicBlock); if (!nestedExceptionRegions.empty()) nestedExceptionRegions.peek().addBB(basicBlock); return basicBlock; }
protected void visitBasicBlocks(CFG cfg) { for (BasicBlock basicBlock: cfg.getBasicBlocks()) { BasicBlock(basicBlock); } }
public BasicBlock(CFG cfg, Label label) { this.label = label; this.cfg = cfg; id = cfg.getNextBBID(); isRescueEntry = false; assert label != null : "label is null"; initInstrs(); }
public LinkedList<BasicBlock> postOrderList() { // SSS FIXME: This caching is fragile -- requires invalidation // on change of CFG state. We need a better setup than this. if (postOrderList == null) postOrderList = buildPostOrderList(); return postOrderList; }
private BasicBlock createBB(Label label, Stack<ExceptionRegion> nestedExceptionRegions) { BasicBlock basicBlock = new BasicBlock(this, label); addBasicBlock(basicBlock); if (label.isGlobalEnsureBlockLabel()) { globalEnsureBB = basicBlock; } if (!nestedExceptionRegions.empty()) nestedExceptionRegions.peek().addBB(basicBlock); return basicBlock; }
private BasicBlock createBB(Label label, Stack<ExceptionRegion> nestedExceptionRegions) { BasicBlock basicBlock = new BasicBlock(this, label); addBasicBlock(basicBlock); if (label.isGlobalEnsureBlockLabel()) { globalEnsureBB = basicBlock; } if (!nestedExceptionRegions.empty()) nestedExceptionRegions.peek().addBB(basicBlock); return basicBlock; }