@Override public void visitPhi(SSAPhiInstruction instruction) { noIdentity = true; int[] uses = new int[instruction.getNumberOfUses()]; for (int i = 0; i < uses.length; i++) { uses[i] = instruction.getUse(i); } transfer1 = NullPointerState.phiValueMeetFunction(instruction.getDef(), uses); // should not be used as no alternative path exists transfer2 = NullPointerState.identityFunction(); }
@Override protected void placeNewPhiAt(int value, SSACFG.BasicBlock Y) { int[] params = new int[CFG.getPredNodeCount(Y)]; for (int i = 0; i < params.length; i++) params[i] = value; SSAPhiInstruction phi = new SSAPhiInstruction(SSAInstruction.NO_INDEX, value, params); if (DEBUG) System.err.println(("Placing " + phi + " at " + Y)); addPhi(Y, phi); }
@Override public String toString(SymbolTable symbolTable) { StringBuilder s = new StringBuilder(); s.append(getValueString(symbolTable, result)).append(" = phi "); s.append(' ').append(getValueString(symbolTable, params[0])); for (int i = 1; i < params.length; i++) { s.append(',').append(getValueString(symbolTable, params[i])); } return s.toString(); }
continue; PointerKey def = getPointerKeyForLocal(node, phi.getDef()); if (hasNoInterestingUses(node, phi.getDef(), v.du)) { system.recordImplicitPointsToSet(def); } else { if (phi.getUse(n) > 0) { PointerKey use = getPointerKeyForLocal(node, phi.getUse(n)); if (contentsAreInvariant(v.symbolTable, v.du, phi.getUse(n))) { system.recordImplicitPointsToSet(use); InstanceKey[] ik = getInvariantContents(v.symbolTable, v.du, node, phi.getUse(n), this); for (InstanceKey element : ik) { system.newConstraint(def, element);
@Override public String toString() { return "v" + phi.getDef(); }
private OrdinalSet<InstanceKey> computeImplicitPointsToSetAtPhi(CGNode node, SSAPhiInstruction instruction) { MutableSparseIntSet S = MutableSparseIntSet.makeEmpty(); for (int i = 0; i < instruction.getNumberOfUses(); i++) { int vn = instruction.getUse(i); if (vn != -1) { PointerKey lpk = pointerKeys.getPointerKeyForLocal(node, vn); OrdinalSet pointees = getPointsToSet(lpk); IntSet set = pointees.getBackingSet(); if (set != null) { S.addAll(set); } } } return new OrdinalSet<>(S, instanceKeys); }
@Override protected void repairPhiUse(SSACFG.BasicBlock BB, int phiIndex, int rvalIndex, int newRval) { SSAPhiInstruction phi = getPhi(BB, phiIndex); int[] newUses = new int[getNumberOfUses(phi)]; for (int v = 0; v < newUses.length; v++) { int oldUse = getUse(phi, v); int newUse = (v == rvalIndex) ? newRval : oldUse; newUses[v] = newUse; if (v == rvalIndex && topR(oldUse) != null) { topR(oldUse).addUse(BB.getGraphNodeId(), phiIndex, v); } } phi.setValues(newUses); }
int phiUseIndex = 0; for (ISSABasicBlock pb : Iterator2Iterable.make(controlFlowGraph.getPredNodes(bb))) { int use = phi.getUse(phiUseIndex); if (use == AbstractIntStackMachine.TOP) {
for (SSAPhiInstruction phi : Iterator2Iterable.make(bb.iteratePhis())) { if (phi != null) { result.append(" ").append(phi.toString(ir.getSymbolTable())).append("\\l");
@Override protected SSAPhiInstruction repairPhiDefs(SSAPhiInstruction phi, int[] newDefs) { return (SSAPhiInstruction) phi.copyForSSA(CFG.getMethod().getDeclaringClass().getClassLoader().getInstructionFactory(), newDefs, null); }
continue; PointerKey def = getPointerKeyForLocal(node, phi.getDef()); if (hasNoInterestingUses(node, phi.getDef(), v.du)) { system.recordImplicitPointsToSet(def); } else { if (phi.getUse(n) > 0) { PointerKey use = getPointerKeyForLocal(node, phi.getUse(n)); if (contentsAreInvariant(v.symbolTable, v.du, phi.getUse(n))) { system.recordImplicitPointsToSet(use); InstanceKey[] ik = getInvariantContents(v.symbolTable, v.du, node, phi.getUse(n), this); for (InstanceKey element : ik) { system.newConstraint(def, element);
@Override public String toString() { return "v" + phi.getDef(); }
private OrdinalSet<InstanceKey> computeImplicitPointsToSetAtPhi(CGNode node, SSAPhiInstruction instruction) { MutableSparseIntSet S = MutableSparseIntSet.makeEmpty(); for (int i = 0; i < instruction.getNumberOfUses(); i++) { int vn = instruction.getUse(i); if (vn != -1) { PointerKey lpk = pointerKeys.getPointerKeyForLocal(node, vn); OrdinalSet pointees = getPointsToSet(lpk); IntSet set = pointees.getBackingSet(); if (set != null) { S.addAll(set); } } } return new OrdinalSet<>(S, instanceKeys); }
@Override protected void repairPhiUse(SSACFG.BasicBlock BB, int phiIndex, int rvalIndex, int newRval) { SSAPhiInstruction phi = getPhi(BB, phiIndex); int[] newUses = new int[getNumberOfUses(phi)]; for (int v = 0; v < newUses.length; v++) { int oldUse = getUse(phi, v); int newUse = (v == rvalIndex) ? newRval : oldUse; newUses[v] = newUse; if (v == rvalIndex && topR(oldUse) != null) { topR(oldUse).addUse(BB.getGraphNodeId(), phiIndex, v); } } phi.setValues(newUses); }
int phiUseIndex = 0; for (ISSABasicBlock pb : Iterator2Iterable.make(controlFlowGraph.getPredNodes(bb))) { int use = phi.getUse(phiUseIndex); if (use == AbstractIntStackMachine.TOP) {
for (SSAPhiInstruction phi : Iterator2Iterable.make(bb.iteratePhis())) { if (phi != null) { result.append(" ").append(phi.toString(ir.getSymbolTable())).append("\\l");
@Override protected SSAPhiInstruction repairPhiDefs(SSAPhiInstruction phi, int[] newDefs) { return (SSAPhiInstruction) phi.copyForSSA(CFG.getMethod().getDeclaringClass().getClassLoader().getInstructionFactory(), newDefs, null); }
@Override public void visitPhi(SSAPhiInstruction instruction) { noIdentity = true; int[] uses = new int[instruction.getNumberOfUses()]; for (int i = 0; i < uses.length; i++) { uses[i] = instruction.getUse(i); } transfer1 = NullPointerState.phiValueMeetFunction(instruction.getDef(), uses); // should not be used as no alternative path exists transfer2 = NullPointerState.identityFunction(); }