public boolean canRaiseExceptions() { for (Instr i: getInstrs()) { if (i.canRaiseException()) return true; } return false; }
/** Builds the data-flow variables (or facts) for a particular node. Need only create the DF_Var for them to be added to the problem. Goes over the instructions in this basic block and collect all relevant LOCAL data flow vars for this problem! */ public void buildDataFlowVars() { for (Instr i: basicBlock.getInstrs()) { buildDataFlowVars(i); } }
public boolean canRaiseExceptions() { for (Instr i: getInstrs()) { if (i.canRaiseException()) return true; } return false; }
public String toStringInstrs() { StringBuilder buf = new StringBuilder(toString() + "\n"); for (Instr instr : getInstrs()) { buf.append('\t').append(instr).append('\n'); } return buf.toString(); } }
/** Builds the data-flow variables (or facts) for a particular node. Need only create the DF_Var for them to be added to the problem. Goes over the instructions in this basic block and collect all relevant LOCAL data flow vars for this problem! */ public void buildDataFlowVars() { for (Instr i: basicBlock.getInstrs()) { buildDataFlowVars(i); } }
/** Builds the data-flow variables (or facts) for a particular node. Need only create the DF_Var for them to be added to the problem. Goes over the instructions in this basic block and collect all relevant LOCAL data flow vars for this problem! */ public void buildDataFlowVars() { for (Instr i: basicBlock.getInstrs()) { buildDataFlowVars(i); } }
public String toStringInstrs() { StringBuilder buf = new StringBuilder(toString() + "\n"); for (Instr instr : getInstrs()) { buf.append('\t').append(instr).append('\n'); } return buf.toString(); } }
/** Builds the data-flow variables (or facts) for a particular node. Need only create the DF_Var for them to be added to the problem. Goes over the instructions in this basic block and collect all relevant LOCAL data flow vars for this problem! */ public void buildDataFlowVars() { for (Instr i: basicBlock.getInstrs()) { buildDataFlowVars(i); } }
@Override public void instrChanged(BasicBlock basicBlock, Instr oldInstr, Instr newInstr, int index, OperationType op) { switch(op) { case REMOVE: { if (index > 0) { Instr previousInstr = basicBlock.getInstrs().get(index - 1); removedEdges.add(new Tuple<Instr, Instr>(previousInstr, oldInstr)); } removedList(basicBlock).add(oldInstr); } } }
@Override public void instrChanged(BasicBlock basicBlock, Instr oldInstr, Instr newInstr, int index, OperationType op) { switch(op) { case REMOVE: { if (index > 0) { Instr previousInstr = basicBlock.getInstrs().get(index - 1); removedEdges.add(new Tuple<Instr, Instr>(previousInstr, oldInstr)); } removedList(basicBlock).add(oldInstr); } } }
public BasicBlock findBasicBlockOf(long callsiteId) { for (BasicBlock basicBlock: linearizeBasicBlocks()) { for (Instr instr: basicBlock.getInstrs()) { if (instr instanceof Site) { Site site = (Site) instr; if (site.getCallSiteId() == callsiteId) return basicBlock; } } } throw new RuntimeException("Bug: Looking for callsiteId: " + callsiteId + " in " + this); } }
public BasicBlock findBasicBlockOf(long callsiteId) { for (BasicBlock basicBlock: linearizeBasicBlocks()) { for (Instr instr: basicBlock.getInstrs()) { if (instr instanceof Site) { Site site = (Site) instr; if (site.getCallSiteId() == callsiteId) return basicBlock; } } } throw new RuntimeException("Bug: Looking for callsiteId: " + callsiteId + " in " + this); } }
@Override public void computeScopeFlagsFromInstructions() { for (BasicBlock b: cfg.getBasicBlocks()) { for (Instr i: b.getInstrs()) { i.computeScopeFlags(getScope()); } } }
@Override public void computeScopeFlagsFromInstructions() { for (BasicBlock b: cfg.getBasicBlocks()) { for (Instr i: b.getInstrs()) { i.computeScopeFlags(getScope()); } } }
/** * Wrapped IRClosures in dead BB are lexically rooted to that dead BB so they can * be removed from the parent scope if the BB they live in died. */ private void removeNestedScopesFromBB(BasicBlock bb) { for (Instr instr: bb.getInstrs()) { for (Operand oper: instr.getOperands()) { if (oper instanceof WrappedIRClosure) { scope.removeClosure(((WrappedIRClosure) oper).getClosure()); break; // Only one WrappedIRClosure possible per instr } } } }
public int getEnsurerPC(Instr excInstr) { depends(cfg()); for (BasicBlock b : linearizedBBList) { for (Instr i : b.getInstrs()) { if (i == excInstr) { BasicBlock ensurerBB = cfg.getEnsurerBBFor(b); return (ensurerBB == null) ? -1 : ensurerBB.getLabel().getTargetPC(); } } } // SSS FIXME: Cannot happen! Throw runtime exception LOG.error("Fell through looking for ensurer ipc for " + excInstr); return -1; }
public BasicBlock findCallsiteBB(CallBase call) { long callSiteId = call.getCallSiteId(); if (debug) LOG.info("LOOKING FOR CALLSITEID: " + callSiteId); for (BasicBlock bb: cfg.getBasicBlocks()) { for (Instr i: bb.getInstrs()) { // Some instrs reuse instrs (like LineNumberInstr) so we need to add call check. if (i instanceof CallBase && ((CallBase) i).getCallSiteId() == callSiteId) { if (debug) LOG.info("Found it!!!! -- " + call + ", i: " + i); return bb; } } } if (debug) LOG.info("Did not find it"); return null; }
public int getRescuerPC(Instr excInstr) { depends(cfg()); for (BasicBlock b : linearizedBBList) { for (Instr i : b.getInstrs()) { if (i == excInstr) { BasicBlock rescuerBB = cfg().getRescuerBBFor(b); return (rescuerBB == null) ? -1 : rescuerBB.getLabel().getTargetPC(); } } } // SSS FIXME: Cannot happen! Throw runtime exception LOG.error("Fell through looking for rescuer ipc for " + excInstr); return -1; }