public void addGlobalEnsureBB(BasicBlock geb) { assert globalEnsureBB == null: "CFG for scope " + getScope() + " already has a global ensure block."; globalEnsureBB = geb; addEdge(geb, getExitBB(), EdgeType.EXIT); for (BasicBlock b: getBasicBlocks()) { if (b != geb && !bbIsProtected(b)) { addEdge(b, geb, EdgeType.EXCEPTION); setRescuerBB(b, geb); setEnsurerBB(b, geb); } } // We are not creating a global exception region and adding it to the list of // exc. regions because in graph form, we dont know what the "last BB" is. // That requires a linearized form of the CFG's bbs. So, the JIT can add // a special case for this global exception block since it has access to the // linearized form. }
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 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 void addGlobalEnsureBB(BasicBlock geb) { assert globalEnsureBB == null: "CFG for scope " + getScope() + " already has a global ensure block."; globalEnsureBB = geb; addEdge(geb, getExitBB(), EdgeType.EXIT); for (BasicBlock b: getBasicBlocks()) { if (b != geb && !bbIsProtected(b)) { addEdge(b, geb, EdgeType.EXCEPTION); setRescuerBB(b, geb); setEnsurerBB(b, geb); } } // We are not creating a global exception region and adding it to the list of // exc. regions because in graph form, we dont know what the "last BB" is. // That requires a linearized form of the CFG's bbs. So, the JIT can add // a special case for this global exception block since it has access to the // linearized form. }
private BasicBlock createPrologueBlock(CFG cfg) { BasicBlock entryBB = cfg.getEntryBB(); BasicBlock oldStart = cfg.getOutgoingDestinationOfType(entryBB, CFG.EdgeType.FALL_THROUGH); BasicBlock prologueBB = new BasicBlock(cfg, cfg.getScope().getNewLabel()); cfg.removeEdge(entryBB, oldStart); cfg.addBasicBlock(prologueBB); cfg.addEdge(entryBB, prologueBB, CFG.EdgeType.FALL_THROUGH); cfg.addEdge(prologueBB, oldStart, CFG.EdgeType.FALL_THROUGH); // If there's already a GEB, make sure we have an edge to it and use it to rescue these instrs if (cfg.getGlobalEnsureBB() != null) { BasicBlock geb = cfg.getGlobalEnsureBB(); cfg.addEdge(prologueBB, geb, CFG.EdgeType.EXCEPTION); cfg.setRescuerBB(prologueBB, geb); } return prologueBB; }
private BasicBlock createPrologueBlock(CFG cfg) { BasicBlock entryBB = cfg.getEntryBB(); BasicBlock oldStart = cfg.getOutgoingDestinationOfType(entryBB, CFG.EdgeType.FALL_THROUGH); BasicBlock prologueBB = new BasicBlock(cfg, cfg.getScope().getNewLabel()); cfg.removeEdge(entryBB, oldStart); cfg.addBasicBlock(prologueBB); cfg.addEdge(entryBB, prologueBB, CFG.EdgeType.FALL_THROUGH); cfg.addEdge(prologueBB, oldStart, CFG.EdgeType.FALL_THROUGH); // If there's already a GEB, make sure we have an edge to it and use it to rescue these instrs if (cfg.getGlobalEnsureBB() != null) { BasicBlock geb = cfg.getGlobalEnsureBB(); cfg.addEdge(prologueBB, geb, CFG.EdgeType.EXCEPTION); cfg.setRescuerBB(prologueBB, geb); } return prologueBB; }
for (Edge<BasicBlock> edge : getOutgoingEdges(bb)) { BasicBlock newDestination = cloneBBMap.get(edge.getDestination().getData()); newCFG.addEdge(newSource, newDestination, edge.getType());
for (Edge<BasicBlock> edge : getOutgoingEdges(bb)) { BasicBlock newDestination = cloneBBMap.get(edge.getDestination().getData()); newCFG.addEdge(newSource, newDestination, edge.getType());
for (Edge<BasicBlock> e : getOutgoingEdges(x)) { BasicBlock b = e.getDestination().getData(); clone.addEdge(rx, cloneBBMap.get(b), e.getType());
for (Edge<BasicBlock> e : getOutgoingEdges(x)) { BasicBlock b = e.getDestination().getData(); clone.addEdge(rx, cloneBBMap.get(b), e.getType());
private void connectOuterEdges(BasicBlock beforeInlineBB, BasicBlock afterInlineBB) { cfg.addBasicBlock(afterInlineBB); for (Edge<BasicBlock> e : cfg.getOutgoingEdges(beforeInlineBB)) { cfg.addEdge(afterInlineBB, e.getDestination().getData(), e.getType()); } cfg.removeAllOutgoingEdgesForBB(beforeInlineBB); }
private void connectOuterEdges(BasicBlock beforeInlineBB, BasicBlock afterInlineBB) { cfg.addBasicBlock(afterInlineBB); for (Edge<BasicBlock> e : cfg.getOutgoingEdges(beforeInlineBB)) { cfg.addEdge(afterInlineBB, e.getDestination().getData(), e.getType()); } cfg.removeAllOutgoingEdgesForBB(beforeInlineBB); }
private CFG cloneSelf(InlinerInfo ii) { CFG selfClone = new CFG(cfg.getScope()); // clone bbs BasicBlock entry = cfg.getEntryBB(); BasicBlock exit = cfg.getExitBB(); for (BasicBlock b : cfg.getBasicBlocks()) { if ((b != entry) && (b != exit)) { selfClone.addBasicBlock(b.cloneForInlinedMethod(ii)); } } // clone edges for (BasicBlock b: cfg.getBasicBlocks()) { if ((b != entry) && (b != exit)) { BasicBlock rb = ii.getRenamedBB(b); for (Edge<BasicBlock> e : cfg.getOutgoingEdges(b)) { BasicBlock destination = e.getDestination().getData(); if (destination != exit) selfClone.addEdge(rb, ii.getRenamedBB(destination), e.getType()); } } } return selfClone; }
private CFG cloneSelf(InlineCloneInfo ii) { CFG selfClone = new CFG(hostScope); // clone bbs for (BasicBlock b : cfg.getBasicBlocks()) { if (!b.isEntryBB() && !b.isExitBB()) selfClone.addBasicBlock(b.cloneForInlining(ii)); } // clone edges for (BasicBlock b: cfg.getBasicBlocks()) { if (b.isEntryBB() || b.isExitBB()) continue; BasicBlock rb = ii.getRenamedBB(b); for (Edge<BasicBlock> e : cfg.getOutgoingEdges(b)) { BasicBlock destination = e.getDestination().getData(); if (!destination.isExitBB()) selfClone.addEdge(rb, ii.getRenamedBB(destination), e.getType()); } } return selfClone; }
private CFG cloneSelf(InlineCloneInfo ii) { CFG selfClone = new CFG(hostScope); // clone bbs for (BasicBlock b : cfg.getBasicBlocks()) { if (!b.isEntryBB() && !b.isExitBB()) selfClone.addBasicBlock(b.cloneForInlining(ii)); } // clone edges for (BasicBlock b: cfg.getBasicBlocks()) { if (b.isEntryBB() || b.isExitBB()) continue; BasicBlock rb = ii.getRenamedBB(b); for (Edge<BasicBlock> e : cfg.getOutgoingEdges(b)) { BasicBlock destination = e.getDestination().getData(); if (!destination.isExitBB()) selfClone.addEdge(rb, ii.getRenamedBB(destination), e.getType()); } } return selfClone; }
private CFG cloneSelf(InlinerInfo ii) { CFG selfClone = new CFG(cfg.getScope()); // clone bbs BasicBlock entry = cfg.getEntryBB(); BasicBlock exit = cfg.getExitBB(); for (BasicBlock b : cfg.getBasicBlocks()) { if ((b != entry) && (b != exit)) { selfClone.addBasicBlock(b.cloneForInlinedMethod(ii)); } } // clone edges for (BasicBlock b: cfg.getBasicBlocks()) { if ((b != entry) && (b != exit)) { BasicBlock rb = ii.getRenamedBB(b); for (Edge<BasicBlock> e : cfg.getOutgoingEdges(b)) { BasicBlock destination = e.getDestination().getData(); if (destination != exit) selfClone.addEdge(rb, ii.getRenamedBB(destination), e.getType()); } } } return selfClone; }
addEdge(a, e.getDestination().getData(), e.getType());
addEdge(a, e.getDestination().getData(), e.getType());