public boolean isExitBB() { return cfg.getExitBB() == this; }
public boolean isExitBB() { return cfg.getExitBB() == this; }
public U getExceptionTargetNode() { // If there is a rescue node, on exception, control goes to the rescuer bb. If not, it goes to the scope exit. return problem.getFlowGraphNode(rescuer == null ? getCFG().getExitBB() : rescuer); }
public U getExceptionTargetNode() { // If there is a rescue node, on exception, control goes to the rescuer bb. If not, it goes to the scope exit. return problem.getFlowGraphNode(rescuer == null ? getCFG().getExitBB() : rescuer); }
public U getExitNode() { return getFlowGraphNode(scope.getCFG().getExitBB()); }
public U getExitNode() { return getFlowGraphNode(scope.getCFG().getExitBB()); }
public void initSolnForNode() { LiveVariablesProblem p = (LiveVariablesProblem) problem; in = new BitSet(setSize); if (basicBlock == p.getScope().cfg().getExitBB()) { Collection<LocalVariable> lv = p.getVarsLiveOnScopeExit(); if (lv != null && !lv.isEmpty()) { for (Variable v: lv) { in.set(p.getDFVar(v).getId()); } } } // System.out.println("Init state for BB " + basicBlock.getID() + " is " + toString()); }
public void initSolnForNode() { LiveVariablesProblem p = (LiveVariablesProblem) problem; in = new BitSet(setSize); if (basicBlock == p.getScope().cfg().getExitBB()) { Collection<LocalVariable> lv = p.getVarsLiveOnScopeExit(); if (lv != null && !lv.isEmpty()) { for (Variable v: lv) { in.set(p.getDFVar(v).getId()); } } } // System.out.println("Init state for BB " + basicBlock.getID() + " is " + toString()); }
public void initSolnForNode() { if (basicBlock == problem.getScope().cfg().getExitBB()) { inRequiredLoads = ((LoadLocalVarPlacementProblem) problem).getLoadsOnScopeExit(); } }
public void initSolnForNode() { if (basicBlock == problem.getScope().cfg().getExitBB()) { inRequiredLoads = ((LoadLocalVarPlacementProblem) problem).getLoadsOnScopeExit(); } }
public FlowGraphNode getExceptionTargetNode() { // If there is a rescue node, on exception, control goes to the rescuer bb. If not, it goes to the scope exit. return problem.getFlowGraphNode(rescuer == null ? problem.getScope().cfg().getExitBB() : rescuer); }
public FlowGraphNode getExceptionTargetNode() { // If there is a rescue node, on exception, control goes to the rescuer bb. If not, it goes to the scope exit. return problem.getFlowGraphNode(rescuer == null ? problem.getScope().cfg().getExitBB() : rescuer); }
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. }
public BasicBlock cloneForInlining(InlineCloneInfo ii) { BasicBlock clonedBB = ii.getOrCreateRenamedBB(this); for (Instr i: getInstrs()) { Instr clonedInstr = i.clone(ii); if (clonedInstr != null) { clonedBB.addInstr(clonedInstr); if (clonedInstr instanceof YieldInstr) { ii.recordYieldSite(clonedBB, (YieldInstr)clonedInstr); } else if (i instanceof NonlocalReturnInstr && clonedInstr instanceof CopyInstr) { // non-local returns assign to method return variable but must jump to proper exit point clonedBB.addInstr(new JumpInstr(ii.getHostScope().getCFG().getExitBB().getLabel())); // FIXME: enebo...I see no guarantee that this copy will be part of a return? This behavior is // masked in any case I can see with optimization to not use a copy but convert non-local to local return. } } } return clonedBB; }
public BasicBlock cloneForInlining(InlineCloneInfo ii) { BasicBlock clonedBB = ii.getOrCreateRenamedBB(this); for (Instr i: getInstrs()) { Instr clonedInstr = i.clone(ii); if (clonedInstr != null) { clonedBB.addInstr(clonedInstr); if (clonedInstr instanceof YieldInstr) { ii.recordYieldSite(clonedBB, (YieldInstr)clonedInstr); } else if (i instanceof NonlocalReturnInstr && clonedInstr instanceof CopyInstr) { // non-local returns assign to method return variable but must jump to proper exit point clonedBB.addInstr(new JumpInstr(ii.getHostScope().getCFG().getExitBB().getLabel())); // FIXME: enebo...I see no guarantee that this copy will be part of a return? This behavior is // masked in any case I can see with optimization to not use a copy but convert non-local to local return. } } } return clonedBB; }
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(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; }