public void addSetInstance(final FieldReference ref, final int baseObject, final int value) { statements.add(insts.PutInstruction(statements.size(), baseObject, value, ref)); }
public void addSetInstance(final FieldReference ref, final int baseObject, final int value) { statements.add(insts.PutInstruction(statements.size(), baseObject, value, ref)); }
public void addSetStatic(final FieldReference ref, final int value) { statements.add(insts.PutInstruction(statements.size(), value, ref)); }
public void addSetStatic(final FieldReference ref, final int value) { statements.add(insts.PutInstruction(statements.size(), value, ref)); }
@Override public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] uses) { if (isStatic()) return insts.PutInstruction(iindex, uses == null ? val : uses[0], getDeclaredField()); else return insts.PutInstruction(iindex, uses == null ? getRef() : uses[0], uses == null ? val : uses[1], getDeclaredField()); }
@Override public SSAInstruction copyForSSA(SSAInstructionFactory insts, int[] defs, int[] uses) { if (isStatic()) return insts.PutInstruction(iindex, uses == null ? val : uses[0], getDeclaredField()); else return insts.PutInstruction(iindex, uses == null ? getRef() : uses[0], uses == null ? val : uses[1], getDeclaredField()); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ @Override public void visitPutField(PutField instruction) { int value = workingState.getLocal(instruction.source); FieldReference f = FieldReference.findOrCreate(loader, instruction.clazzName, instruction.fieldName, instruction.fieldType); // int value = workingState.pop(); if (instruction instanceof PutField.PutStaticField) { // if (instruction.isStatic()) { emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), value, f)); } else if (instruction instanceof PutField.PutInstanceField) { // } else { int ref = workingState.getLocal(((PutField.PutInstanceField)instruction).instance); // int ref = workingState.pop(); emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), ref, value, f)); } else { throw new IllegalArgumentException("Unknown subclass of PutField: "+instruction); } }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ @Override public void visitPutField(PutField instruction) { int value = workingState.getLocal(instruction.source); FieldReference f = FieldReference.findOrCreate(loader, instruction.clazzName, instruction.fieldName, instruction.fieldType); // int value = workingState.pop(); if (instruction instanceof PutField.PutStaticField) { // if (instruction.isStatic()) { emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), value, f)); } else if (instruction instanceof PutField.PutInstanceField) { // } else { int ref = workingState.getLocal(((PutField.PutInstanceField)instruction).instance); // int ref = workingState.pop(); emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), ref, value, f)); } else { throw new IllegalArgumentException("Unknown subclass of PutField: "+instruction); } }
SSAPutInstruction P = insts.PutInstruction(governingMethod.getNumberOfStatements(), refNumber.intValue(), valueNumber.intValue(), field); governingMethod.addStatement(P);
SSAPutInstruction P = insts.PutInstruction(governingMethod.getNumberOfStatements(), refNumber.intValue(), valueNumber.intValue(), field); governingMethod.addStatement(P);
@Override protected void doFieldWrite(WalkContext context, int receiver, CAstNode elt, CAstNode parent, int rval) { FieldReference fieldRef = (FieldReference) elt.getValue(); if (receiver == -1) { // a static field: AstTranslator.getValue() produces // -1 for null, we hope context.cfg().addInstruction(insts.PutInstruction(context.cfg().getCurrentInstruction(), rval, fieldRef)); } else { context.cfg().addInstruction(insts.PutInstruction(context.cfg().getCurrentInstruction(), receiver, rval, fieldRef)); processExceptions(parent, context); } }
SSAGetInstruction G = insts.GetInstruction(statements.size(), tempValue, 1, f.getReference()); statements.add(G); SSAPutInstruction P = insts.PutInstruction(statements.size(), retValue, tempValue, f.getReference()); statements.add(P);
@Override protected void doFieldWrite(WalkContext context, int receiver, CAstNode elt, CAstNode parent, int rval) { FieldReference fieldRef = (FieldReference) elt.getValue(); if (receiver == -1) { // a static field: AstTranslator.getValue() produces // -1 for null, we hope context.cfg().addInstruction(insts.PutInstruction(context.cfg().getCurrentInstruction(), rval, fieldRef)); } else { context.cfg().addInstruction(insts.PutInstruction(context.cfg().getCurrentInstruction(), receiver, rval, fieldRef)); processExceptions(parent, context); } }
SSAGetInstruction G = insts.GetInstruction(statements.size(), tempValue, 1, f.getReference()); statements.add(G); SSAPutInstruction P = insts.PutInstruction(statements.size(), retValue, tempValue, f.getReference()); statements.add(P);
/** * Process an element indicating a putstatic. */ private void processPutStatic(Attributes atts) { Language lang = scope.getLanguage(governingLoader.getLanguage()); SSAInstructionFactory insts = lang.instructionFactory(); // deduce the field written String classString = atts.getValue(A_CLASS); TypeReference type = TypeReference.findOrCreate(governingLoader, TypeName.string2TypeName(classString)); String fieldString = atts.getValue(A_FIELD); Atom fieldName = Atom.findOrCreateAsciiAtom(fieldString); String ftString = atts.getValue(A_FIELD_TYPE); TypeReference fieldType = TypeReference.findOrCreate(governingLoader, TypeName.string2TypeName(ftString)); FieldReference field = FieldReference.findOrCreate(type, fieldName, fieldType); // get the value stored String V = atts.getValue(A_VALUE); if (V == null) { Assertions.UNREACHABLE("Must specify value for putstatic " + governingMethod); } Integer valueNumber = symbolTable.get(V); if (valueNumber == null) { Assertions.UNREACHABLE("Cannot lookup value: " + V); } SSAPutInstruction P = insts.PutInstruction(governingMethod.getNumberOfStatements(), valueNumber.intValue(), field); governingMethod.addStatement(P); }
/** * Process an element indicating a putstatic. */ private void processPutStatic(Attributes atts) { Language lang = scope.getLanguage(governingLoader.getLanguage()); SSAInstructionFactory insts = lang.instructionFactory(); // deduce the field written String classString = atts.getValue(A_CLASS); TypeReference type = TypeReference.findOrCreate(governingLoader, TypeName.string2TypeName(classString)); String fieldString = atts.getValue(A_FIELD); Atom fieldName = Atom.findOrCreateAsciiAtom(fieldString); String ftString = atts.getValue(A_FIELD_TYPE); TypeReference fieldType = TypeReference.findOrCreate(governingLoader, TypeName.string2TypeName(ftString)); FieldReference field = FieldReference.findOrCreate(type, fieldName, fieldType); // get the value stored String V = atts.getValue(A_VALUE); if (V == null) { Assertions.UNREACHABLE("Must specify value for putstatic " + governingMethod); } Integer valueNumber = symbolTable.get(V); if (valueNumber == null) { Assertions.UNREACHABLE("Cannot lookup value: " + V); } SSAPutInstruction P = insts.PutInstruction(governingMethod.getNumberOfStatements(), valueNumber.intValue(), field); governingMethod.addStatement(P); }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ @Override public void visitPut(IPutInstruction instruction) { int value = workingState.pop(); if (instruction.isStatic()) { FieldReference f = FieldReference.findOrCreate(loader, instruction.getClassType(), instruction.getFieldName(), instruction.getFieldType()); emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), value, f)); } else { int ref = workingState.pop(); FieldReference f = FieldReference.findOrCreate(loader, instruction.getClassType(), instruction.getFieldName(), instruction.getFieldType()); emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), ref, value, f)); } }
/** * @see com.ibm.wala.shrikeBT.IInstruction.Visitor#visitGet(IGetInstruction) */ @Override public void visitPut(IPutInstruction instruction) { int value = workingState.pop(); if (instruction.isStatic()) { FieldReference f = FieldReference.findOrCreate(loader, instruction.getClassType(), instruction.getFieldName(), instruction.getFieldType()); emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), value, f)); } else { int ref = workingState.pop(); FieldReference f = FieldReference.findOrCreate(loader, instruction.getClassType(), instruction.getFieldName(), instruction.getFieldType()); emitInstruction(insts.PutInstruction(getCurrentInstructionIndex(), ref, value, f)); } }
for(int i = 0; i < site.getDeclaredTarget().getNumberOfParameters(); i++) { summary.addStatement( insts.PutInstruction(index++, v, i+1, lambda.getField(Atom.findOrCreateUnicodeAtom("c" + i)).getReference()));
for(int i = 0; i < site.getDeclaredTarget().getNumberOfParameters(); i++) { summary.addStatement( insts.PutInstruction(index++, v, i+1, lambda.getField(Atom.findOrCreateUnicodeAtom("c" + i)).getReference()));