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

项目:Android_Code_Arbiter    文件:TaintFrameModelingVisitor.java   
@Override
public void visitAASTORE(AASTORE obj) {
    try {
        Taint valueTaint = getFrame().popValue();
        getFrame().popValue(); // array index
        Taint arrayTaint = getFrame().popValue();
        Taint merge = Taint.merge(valueTaint, arrayTaint);
        setLocalVariableTaint(merge, arrayTaint);
        Taint stackTop = null;
        if (getFrame().getStackDepth() > 0) {
            stackTop = getFrame().getTopValue();
        }
        // varargs use duplicated values
        if (stackTop == arrayTaint) {
            getFrame().popValue();
            getFrame().pushValue(new Taint(merge));
        }
    } catch (DataflowAnalysisException ex) {
        throw new InvalidBytecodeException("Not enough values on the stack", ex);
    }
}
项目:luaj_xowa    文件:JavaBuilder.java   
public void storeLocal(int pc, int slot) {
    boolean isupval = pi.isUpvalueAssign(pc, slot);
    int index = findSlotIndex( slot, isupval );
    if (isupval) {
        boolean isupcreate = pi.isUpvalueCreate(pc, slot);
        if ( isupcreate ) {
            append(factory.createInvoke(classname, "newupe", TYPE_LOCALUPVALUE, ARG_TYPES_NONE, Constants.INVOKESTATIC));
            append(InstructionConstants.DUP);
            append(new ASTORE(index));
        } else {
            append(new ALOAD(index));
        }
        append(InstructionConstants.SWAP);
        append(new PUSH(cp, 0));
        append(InstructionConstants.SWAP);
        append(InstructionConstants.AASTORE);
    } else {
        append(new ASTORE(index));
    }
}
项目:luaj_xowa    文件:JavaBuilder.java   
public void storeLocal(int pc, int slot) {
    boolean isupval = pi.isUpvalueAssign(pc, slot);
    int index = findSlotIndex( slot, isupval );
    if (isupval) {
        boolean isupcreate = pi.isUpvalueCreate(pc, slot);
        if ( isupcreate ) {
            append(factory.createInvoke(classname, "newupe", TYPE_LOCALUPVALUE, ARG_TYPES_NONE, Constants.INVOKESTATIC));
            append(InstructionConstants.DUP);
            append(new ASTORE(index));
        } else {
            append(new ALOAD(index));
        }
        append(InstructionConstants.SWAP);
        append(new PUSH(cp, 0));
        append(InstructionConstants.SWAP);
        append(InstructionConstants.AASTORE);
    } else {
        append(new ASTORE(index));
    }
}
项目:luaj_xowa    文件:JavaBuilder.java   
public void storeUpvalue(int pc, int upindex, int slot) {
    boolean isrw = pi.isReadWriteUpvalue( pi.upvals[upindex] ); 
    append(InstructionConstants.THIS);
    if ( isrw ) {
        append(factory.createFieldAccess(classname, upvalueName(upindex), TYPE_LOCALUPVALUE, Constants.GETFIELD));
        append(new PUSH(cp,0));
        loadLocal(pc, slot);
        append(InstructionConstants.AASTORE);
    } else {
        loadLocal(pc, slot);
        append(factory.createFieldAccess(classname, upvalueName(upindex), TYPE_LUAVALUE, Constants.PUTFIELD));
    }
}
项目:luaj_xowa    文件:JavaBuilder.java   
public void loadArrayArgs(int pc, int firstslot, int nargs) {
    append(new PUSH(cp, nargs));
    append(new ANEWARRAY(cp.addClass(STR_LUAVALUE)));
    for ( int i=0; i<nargs; i++ ) {
        append(InstructionConstants.DUP);
        append(new PUSH(cp, i));
        loadLocal(pc, firstslot++);
        append(new AASTORE());
    }   
}
项目:luaj_xowa    文件:JavaBuilder.java   
public void storeUpvalue(int pc, int upindex, int slot) {
    boolean isrw = pi.isReadWriteUpvalue( pi.upvals[upindex] ); 
    append(InstructionConstants.THIS);
    if ( isrw ) {
        append(factory.createFieldAccess(classname, upvalueName(upindex), TYPE_LOCALUPVALUE, Constants.GETFIELD));
        append(new PUSH(cp,0));
        loadLocal(pc, slot);
        append(InstructionConstants.AASTORE);
    } else {
        loadLocal(pc, slot);
        append(factory.createFieldAccess(classname, upvalueName(upindex), TYPE_LUAVALUE, Constants.PUTFIELD));
    }
}
项目:luaj_xowa    文件:JavaBuilder.java   
public void loadArrayArgs(int pc, int firstslot, int nargs) {
    append(new PUSH(cp, nargs));
    append(new ANEWARRAY(cp.addClass(STR_LUAVALUE)));
    for ( int i=0; i<nargs; i++ ) {
        append(InstructionConstants.DUP);
        append(new PUSH(cp, i));
        loadLocal(pc, firstslot++);
        append(new AASTORE());
    }   
}
项目:cashmere    文件:MethodGen.java   
public boolean isArrayStore(Instruction instruction) {
return instruction instanceof AASTORE || instruction instanceof BASTORE || 
    instruction instanceof CASTORE || instruction instanceof DASTORE ||
    instruction instanceof FASTORE || instruction instanceof IASTORE ||
    instruction instanceof LASTORE || instruction instanceof SASTORE;
   }
项目:cn1    文件:JavaByteCodeOutputProcess.java   
@SuppressWarnings("unused")
// Called using reflection
private Instruction createInstructionAastore(Element inst) {
    return new AASTORE();
}
项目:findbugs-all-the-bugs    文件:ResourceValueFrameModelingVisitor.java   
@Override
public void visitAASTORE(AASTORE arr) {
    handleArrayStore(arr);
}
项目:FindBug-for-Domino-Designer    文件:ResourceValueFrameModelingVisitor.java   
@Override
public void visitAASTORE(AASTORE arr) {
    handleArrayStore(arr);
}