@Override public UnaryOperator<NullPointerState> getNodeTransferFunction(final T node) { final ArrayList<UnaryOperator<NullPointerState>> phiTransferFunctions = new ArrayList<>(1); for (SSAPhiInstruction phi : Iterator2Iterable.make(node.iteratePhis())) { int[] uses = new int[phi.getNumberOfUses()]; for (int i = 0; i < uses.length; i++) { uses[i] = phi.getUse(i); } phiTransferFunctions.add(NullPointerState.phiValueMeetFunction(phi.getDef(), uses)); } if (phiTransferFunctions.size() > 0) { return NullPointerState.phisFunction(phiTransferFunctions); } else { return NullPointerState.identityFunction(); } }
@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 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 public UnaryOperator<NullPointerState> getNodeTransferFunction(final T node) { final ArrayList<UnaryOperator<NullPointerState>> phiTransferFunctions = new ArrayList<>(1); for (SSAPhiInstruction phi : Iterator2Iterable.make(node.iteratePhis())) { int[] uses = new int[phi.getNumberOfUses()]; for (int i = 0; i < uses.length; i++) { uses[i] = phi.getUse(i); } phiTransferFunctions.add(NullPointerState.phiValueMeetFunction(phi.getDef(), uses)); } if (phiTransferFunctions.size() > 0) { return NullPointerState.phisFunction(phiTransferFunctions); } else { return NullPointerState.identityFunction(); } }
@Override public void visitPhi(SSAPhiInstruction instruction) { int phi = instruction.getDef(); ArrayBoundsGraphBuilder.this.lowerBoundGraph.addPhi(phi); ArrayBoundsGraphBuilder.this.upperBoundGraph.addPhi(phi); for (int i = 0; i < instruction.getNumberOfUses(); i++) { int use = instruction.getUse(i); todo.push(use); ArrayBoundsGraphBuilder.this.lowerBoundGraph.addEdge(use, phi); ArrayBoundsGraphBuilder.this.upperBoundGraph.addEdge(use, phi); } }
@Override public void visitPhi(SSAPhiInstruction instruction) { int phi = instruction.getDef(); ArrayBoundsGraphBuilder.this.lowerBoundGraph.addPhi(phi); ArrayBoundsGraphBuilder.this.upperBoundGraph.addPhi(phi); for (int i = 0; i < instruction.getNumberOfUses(); i++) { int use = instruction.getUse(i); todo.push(use); ArrayBoundsGraphBuilder.this.lowerBoundGraph.addEdge(use, phi); ArrayBoundsGraphBuilder.this.upperBoundGraph.addEdge(use, phi); } }
@Override public void visitPhi(SSAPhiInstruction phi) { int n = phi.getNumberOfUses(); VarVertex w = factory.makeVarVertex(func, phi.getDef()); for(int i=0;i<n;++i) { VarVertex v = factory.makeVarVertex(func, phi.getUse(i)); flowgraph.addEdge(v, w); } }
@Override public void visitPhi(SSAPhiInstruction phi) { int n = phi.getNumberOfUses(); VarVertex w = factory.makeVarVertex(func, phi.getDef()); for(int i=0;i<n;++i) { VarVertex v = factory.makeVarVertex(func, phi.getUse(i)); flowgraph.addEdge(v, w); } }
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); }
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 public void visitPhi(SSAPhiInstruction instruction) { if (ir.getMethod() instanceof AbstractRootMethod) { PointerKey dst = getPointerKeyForLocal(instruction.getDef()); if (hasNoInterestingUses(instruction.getDef())) { system.recordImplicitPointsToSet(dst); } else { for (int i = 0; i < instruction.getNumberOfUses(); i++) { PointerKey use = getPointerKeyForLocal(instruction.getUse(i)); if (contentsAreInvariant(symbolTable, du, instruction.getUse(i))) { system.recordImplicitPointsToSet(use); InstanceKey[] ik = getInvariantContents(instruction.getUse(i)); for (InstanceKey element : ik) { system.newConstraint(dst, element); } } else { system.newConstraint(dst, assignOperator, use); } } } } }
@Override public void visitPhi(SSAPhiInstruction instruction) { if (ir.getMethod() instanceof AbstractRootMethod) { PointerKey dst = getPointerKeyForLocal(instruction.getDef()); if (hasNoInterestingUses(instruction.getDef())) { system.recordImplicitPointsToSet(dst); } else { for (int i = 0; i < instruction.getNumberOfUses(); i++) { PointerKey use = getPointerKeyForLocal(instruction.getUse(i)); if (contentsAreInvariant(symbolTable, du, instruction.getUse(i))) { system.recordImplicitPointsToSet(use); InstanceKey[] ik = getInvariantContents(instruction.getUse(i)); for (InstanceKey element : ik) { system.newConstraint(dst, element); } } else { system.newConstraint(dst, assignOperator, use); } } } } }