protected static void extractToMethodToAvoidC2Crash(Instr instr, Throwable t) { if (!(t instanceof Unrescuable) && !instr.canRaiseException()) { System.err.println("BUG: Got exception " + t + " but instr " + instr + " is not supposed to be raising exceptions!"); } }
protected static void extractToMethodToAvoidC2Crash(Instr instr, Throwable t) { if (!(t instanceof Unrescuable) && !instr.canRaiseException()) { System.err.println("BUG: Got exception " + t + " but instr " + instr + " is not supposed to be raising exceptions!"); } }
public boolean canRaiseExceptions() { for (Instr i: getInstrs()) { if (i.canRaiseException()) return true; } return false; }
public boolean canRaiseExceptions() { for (Instr i: getInstrs()) { if (i.canRaiseException()) return true; } return false; }
/** * Can this instruction be deleted? LVA will preserve instructions based on whether operands (variables) * are living but even if there are no living variables then the instruction itself may not be able to be removed * during DCE for other reasons (like if it unconditionally has a side-effect) */ public boolean isDeletable() { return !(hasSideEffects() || operation.isDebugOp() || canRaiseException() || transfersControl()); }
/** * Can this instruction be deleted? LVA will preserve instructions based on whether operands (variables) * are living but even if there are no living variables then the instruction itself may not be able to be removed * during DCE for other reasons (like if it unconditionally has a side-effect) */ public boolean isDeletable() { return !(hasSideEffects() || operation.isDebugOp() || canRaiseException() || transfersControl()); }
private void optimize() { // SSS FIXME: Can't we not add some of these exception edges in the first place?? // Remove exception edges from blocks that couldn't possibly thrown an exception! List<Edge> toRemove = new ArrayList<Edge>(); for (BasicBlock b : graph.allData()) { boolean noExceptions = true; for (Instr i : b.getInstrs()) { if (i.canRaiseException()) { noExceptions = false; break; } } if (noExceptions) { for (Edge<BasicBlock> e : graph.findVertexFor(b).getOutgoingEdgesOfType(EdgeType.EXCEPTION)) { BasicBlock source = e.getSource().getData(); BasicBlock destination = e.getDestination().getData(); toRemove.add(e); if (rescuerMap.get(source) == destination) rescuerMap.remove(source); if (ensurerMap.get(source) == destination) ensurerMap.remove(source); } } } if (!toRemove.isEmpty()) { for (Edge edge: toRemove) { graph.removeEdge(edge); } } deleteOrphanedBlocks(graph); collapseStraightLineBBs(); }
private void optimize() { // SSS FIXME: Can't we not add some of these exception edges in the first place?? // Remove exception edges from blocks that couldn't possibly thrown an exception! List<Edge> toRemove = new ArrayList<Edge>(); for (BasicBlock b : graph.allData()) { boolean noExceptions = true; for (Instr i : b.getInstrs()) { if (i.canRaiseException()) { noExceptions = false; break; } } if (noExceptions) { for (Edge<BasicBlock> e : graph.findVertexFor(b).getOutgoingEdgesOfType(EdgeType.EXCEPTION)) { BasicBlock source = e.getSource().getData(); BasicBlock destination = e.getDestination().getData(); toRemove.add(e); if (rescuerMap.get(source) == destination) rescuerMap.remove(source); if (ensurerMap.get(source) == destination) ensurerMap.remove(source); } } } if (!toRemove.isEmpty()) { for (Edge edge: toRemove) { graph.removeEdge(edge); } } deleteOrphanedBlocks(graph); collapseStraightLineBBs(); }
if (i.canRaiseException() && (rescueNode != null)) { dirtyVars.clear();
if (i.canRaiseException() && (rescueNode != null)) { dirtyVars.clear();
if (i.canRaiseException()) makeOutExceptionVariablesLiving();
if (i.canRaiseException()) makeOutExceptionVariablesLiving();
if (i.canRaiseException()) makeOutExceptionVariablesLiving();
if (i.canRaiseException()) makeOutExceptionVariablesLiving();
makeOutExceptionVariablesLiving(living); } else if (i.canRaiseException()) { makeOutExceptionVariablesLiving(living);
makeOutExceptionVariablesLiving(living); } else if (i.canRaiseException()) { makeOutExceptionVariablesLiving(living);