/** * Look up the field referenced by given FieldInstruction, returning it as * an {@link XField XField} object. * * @param fins * the FieldInstruction * @param cpg * the ConstantPoolGen used by the class containing the * instruction * @return an XField object representing the field, or null if no such field * could be found */ public static @CheckForNull XField findXField(FieldInstruction fins, @Nonnull ConstantPoolGen cpg) { String className = fins.getClassName(cpg); String fieldName = fins.getFieldName(cpg); String fieldSig = fins.getSignature(cpg); boolean isStatic = (fins.getOpcode() == Const.GETSTATIC || fins.getOpcode() == Const.PUTSTATIC); XField xfield = findXField(className, fieldName, fieldSig, isStatic); short opcode = fins.getOpcode(); if (xfield != null && xfield.isResolved() && xfield.isStatic() == (opcode == Const.GETSTATIC || opcode == Const.PUTSTATIC)) { return xfield; } else { return null; } }
@Override public MatchResult match(InstructionHandle handle, ConstantPoolGen cpg, ValueNumberFrame before, ValueNumberFrame after, BindingSet bindingSet) throws DataflowAnalysisException { Variable field; Instruction ins = handle.getInstruction(); FieldInstruction fieldIns; // The instruction must be GETFIELD or GETSTATIC if (ins instanceof GETFIELD) { fieldIns = (GETFIELD) ins; ValueNumber ref = before.getTopValue(); field = new FieldVariable(ref, fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else if (ins instanceof GETSTATIC) { fieldIns = (GETSTATIC) ins; field = new FieldVariable(fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else { return null; } Variable result = snarfFieldValue(fieldIns, cpg, after); return checkConsistent(field, result, bindingSet); } }
} else if (ins instanceof FieldInstruction) { FieldInstruction i = (FieldInstruction) ins; System.out.println(formatName(ins) +" "+i.getFieldName(cpg) + ""); } else if (ins instanceof IfInstruction) { IfInstruction i = (IfInstruction) ins;
@Override public MatchResult match(InstructionHandle handle, ConstantPoolGen cpg, ValueNumberFrame before, ValueNumberFrame after, BindingSet bindingSet) throws DataflowAnalysisException { Instruction ins = handle.getInstruction(); FieldInstruction fieldIns; Variable field; // The instruction must be PUTFIELD or PUTSTATIC if (ins instanceof PUTFIELD) { fieldIns = (PUTFIELD) ins; int numSlots = before.getNumSlots(); ValueNumber ref = before.getValue(isLongOrDouble(fieldIns, cpg) ? numSlots - 3 : numSlots - 2); field = new FieldVariable(ref, fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else if (ins instanceof PUTSTATIC) { fieldIns = (PUTSTATIC) ins; field = new FieldVariable(fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else { return null; } Variable value = snarfFieldValue(fieldIns, cpg, before); return checkConsistent(field, value, bindingSet); } }
public void visitFieldInstruction(FieldInstruction i) { short opcode = i.getOpcode(); String class_name = i.getClassName(_cp); String field_name = i.getFieldName(_cp); Type type = i.getFieldType(_cp); _out.println("il.append(_factory.createFieldAccess(\"" + class_name + "\", \"" + field_name + "\", " + BCELifier.printType(type) + ", " + "Constants." + Constants.OPCODE_NAMES[opcode].toUpperCase() + "));"); }
@Override public void visitFieldInstruction( final FieldInstruction i ) { final short opcode = i.getOpcode(); final String class_name = i.getClassName(_cp); final String field_name = i.getFieldName(_cp); final Type type = i.getFieldType(_cp); _out.println("il.append(_factory.createFieldAccess(\"" + class_name + "\", \"" + field_name + "\", " + BCELifier.printType(type) + ", " + CONSTANT_PREFIX + Const.getOpcodeName(opcode).toUpperCase(Locale.ENGLISH) + "));"); }
public boolean checkCode(InstructionHandle[] code) { FieldInstruction ctrlFieldInstr = null; if (code[0].getInstruction() instanceof GETSTATIC) { ctrlFieldInstr = (FieldInstruction) code[0].getInstruction(); } else { ctrlFieldInstr = (FieldInstruction) code[code.length - 2].getInstruction(); } String className = ctrlFieldInstr.getName(cpg); String fieldName = ctrlFieldInstr.getFieldName(cpg); return className.equals(controlClass) && fieldName.equals(controlField.getName()); } });
/** * Look up the field referenced by given FieldInstruction, returning it as * an {@link XField XField} object. * * @param fins * the FieldInstruction * @param cpg * the ConstantPoolGen used by the class containing the * instruction * @return an XField object representing the field, or null if no such field * could be found */ public static @CheckForNull XField findXField(FieldInstruction fins, @Nonnull ConstantPoolGen cpg) { String className = fins.getClassName(cpg); String fieldName = fins.getFieldName(cpg); String fieldSig = fins.getSignature(cpg); boolean isStatic = (fins.getOpcode() == Constants.GETSTATIC || fins.getOpcode() == Constants.PUTSTATIC); XField xfield = findXField(className, fieldName, fieldSig, isStatic); short opcode = fins.getOpcode(); if (xfield != null && xfield.isResolved() && xfield.isStatic() == (opcode == Constants.GETSTATIC || opcode == Constants.PUTSTATIC)) { return xfield; } else { return null; } }
FieldInstruction fi = (FieldInstruction) ins; if (fi.getReferenceType(cpg).getSignature().equals(clsSig)) { String fieldName = fi.getFieldName(cpg); FieldInfo finfo = localizableFields.get(fieldName);
@Override public MatchResult match(InstructionHandle handle, ConstantPoolGen cpg, ValueNumberFrame before, ValueNumberFrame after, BindingSet bindingSet) throws DataflowAnalysisException { Variable field; Instruction ins = handle.getInstruction(); FieldInstruction fieldIns; // The instruction must be GETFIELD or GETSTATIC if (ins instanceof GETFIELD) { fieldIns = (GETFIELD) ins; ValueNumber ref = before.getTopValue(); field = new FieldVariable(ref, fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else if (ins instanceof GETSTATIC) { fieldIns = (GETSTATIC) ins; field = new FieldVariable(fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else { return null; } Variable result = snarfFieldValue(fieldIns, cpg, after); return checkConsistent(field, result, bindingSet); } }
FieldInstruction fi = (FieldInstruction) ins; if (fi.getReferenceType(cpg).getSignature().equals(clsSig)) { String fieldName = fi.getFieldName(cpg); FieldInfo finfo = localizableFields.get(fieldName);
} else if (ins instanceof FieldInstruction) { FieldInstruction i = (FieldInstruction) ins; System.out.println(formatName(ins) +" "+i.getFieldName(cpg) + ""); } else if (ins instanceof IfInstruction) { IfInstruction i = (IfInstruction) ins;
@Override public MatchResult match(InstructionHandle handle, ConstantPoolGen cpg, ValueNumberFrame before, ValueNumberFrame after, BindingSet bindingSet) throws DataflowAnalysisException { Instruction ins = handle.getInstruction(); FieldInstruction fieldIns; Variable field; // The instruction must be PUTFIELD or PUTSTATIC if (ins instanceof PUTFIELD) { fieldIns = (PUTFIELD) ins; int numSlots = before.getNumSlots(); ValueNumber ref = before.getValue(isLongOrDouble(fieldIns, cpg) ? numSlots - 3 : numSlots - 2); field = new FieldVariable(ref, fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else if (ins instanceof PUTSTATIC) { fieldIns = (PUTSTATIC) ins; field = new FieldVariable(fieldIns.getClassName(cpg), fieldIns.getFieldName(cpg), fieldIns.getSignature(cpg)); } else { return null; } Variable value = snarfFieldValue(fieldIns, cpg, before); return checkConsistent(field, value, bindingSet); } }
String childFName = ((FieldInstruction) childin).getFieldName(childPoolGen); String parentFName = ((FieldInstruction) parentin).getFieldName(parentPoolGen); if (!childFName.equals(parentFName)) { return false;
String childFName = ((FieldInstruction) childin).getFieldName(childPoolGen); String parentFName = ((FieldInstruction) parentin).getFieldName(parentPoolGen); if (!childFName.equals(parentFName)) { return false;
String field_name = o.getFieldName(cpg);
final String field_name = o.getFieldName(cpg);