Java 类org.apache.bcel.generic.LoadInstruction 实例源码

项目:cashmere    文件:EarliestLoad.java   
private InstructionHandle getLoadInstruction(InstructionList il, 
    SpawnableCall spawnableCall) throws SyncInsertionProposalFailure {

InstructionHandle ih = spawnableCall.getInvokeInstruction();
while ((ih = ih.getNext()) != null) {
    try {
    LoadInstruction loadInstruction = 
        (LoadInstruction) (ih.getInstruction());
    if (spawnableCall.storesIn(loadInstruction.getIndex(), ih)) {
        return ih;
        }
    }
    catch (ClassCastException e) {
    }
}
throw new SyncInsertionProposalFailure();
   }
项目:Android_Code_Arbiter    文件:TaintFrameModelingVisitor.java   
@Override
public void handleLoadInstruction(LoadInstruction obj) {
    int numProduced = obj.produceStack(cpg);
    if (numProduced == Constants.UNPREDICTABLE) {
        throw new InvalidBytecodeException("Unpredictable stack production");
    }
    int index = obj.getIndex() + numProduced;
    while (numProduced-- > 0) {
        Taint value = getFrame().getValue(--index);
        assert value.hasValidVariableIndex() : "index not set in " + methodDescriptor;
        assert index == value.getVariableIndex() : "bad index in " + methodDescriptor;
        getFrame().pushValue(new Taint(value));
    }
}
项目:ant-contrib    文件:InstructionVisitor.java   
public void visitLoadInstruction(LoadInstruction l) {
    // log.log(" visit load", Project.MSG_DEBUG);
    Type t = l.getType(poolGen);
    log.log("         instr(loadinstr)=" + t, Project.MSG_DEBUG);
    String type = t.toString();

    design.checkClass(type);
}
项目:parabuild-ci    文件:FindDeadLocalStores.java   
private boolean isLoad(Location location) {
    Instruction ins = location.getHandle().getInstruction();
    return (ins instanceof LoadInstruction) || (ins instanceof IINC);
}
项目:parabuild-ci    文件:UnreadVariableCheck.java   
public void visitLoadInstruction(LoadInstruction aInstruction)
{
    mLocalVariableBitSet.set(aInstruction.getIndex());
}
项目:cacheonix-core    文件:UnreadVariableCheck.java   
public void visitLoadInstruction(LoadInstruction aInstruction)
{
    mLocalVariableBitSet.set(aInstruction.getIndex());
}
项目:cashmere    文件:Cashmerec.java   
static boolean isLocalLoad(Instruction ins) {
    return (ins instanceof LoadInstruction);
}
项目:contribution    文件:UnreadVariableCheck.java   
public void visitLoadInstruction(LoadInstruction aInstruction)
{
    mLocalVariableBitSet.set(aInstruction.getIndex());
}
项目:cashmere    文件:MethodGen.java   
/** Tests whether an instruction loads to a local variable with a certain
    * index.
    *
    * When the load is used for an array store or a putfield, the result will
    * be false. It
    * uses {@link #isUsedForArrayStore(InstructionHandle)} and {@link
    * #isUsedForPutField(InstructionHandle)}.
    *
    * @param ih The instruction that is tested to load to a local variable
    * index.
    * @param localVarIndex The local variable index to which the instruction
    * may load
    *
    * @return true if the instruction loads to the local variable index, false
    * otherwise. 
    *
    * @see #isUsedForArrayStore(InstructionHandle)
    * @see #isUsedForPutField(InstructionHandle)
    */
   public boolean instructionLoadsTo(InstructionHandle ih, int localVarIndex) {
try {
    LoadInstruction loadInstruction = (LoadInstruction) (ih.getInstruction());
    return loadInstruction.getIndex() == localVarIndex && 
        !isUsedForArrayLength(ih) &&
    !isUsedForArrayStore(ih) && !isUsedForPutField(ih);
}
catch(ClassCastException e) {
    return false;
}
   }
项目:findbugs-all-the-bugs    文件:FindDeadLocalStores.java   
/**
 * Is instruction at given location a load?
 * 
 * @param location
 *            the location
 * @return true if instruction at given location is a load, false if not
 */
private boolean isLoad(Location location) {
    Instruction ins = location.getHandle().getInstruction();
    return (ins instanceof LoadInstruction) || (ins instanceof IINC);
}
项目:FindBug-for-Domino-Designer    文件:FindDeadLocalStores.java   
/**
 * Is instruction at given location a load?
 *
 * @param location
 *            the location
 * @return true if instruction at given location is a load, false if not
 */
private boolean isLoad(Location location) {
    Instruction ins = location.getHandle().getInstruction();
    return (ins instanceof LoadInstruction) || (ins instanceof IINC);
}