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

项目:Android_Code_Arbiter    文件:TaintFrameModelingVisitor.java   
@Override
public void visitANEWARRAY(ANEWARRAY obj) {
    try {
        getFrame().popValue();
        if (FindSecBugsGlobalConfig.getInstance().isDebugTaintState()) {
            pushSafeDebug("new " + obj.getLoadClassType(cpg).getClassName() + "[]");
        } else {
            pushSafe();
        }
    } catch (DataflowAnalysisException ex) {
        throw new InvalidBytecodeException("Array length not in the stack", ex);
    }
}
项目:ant-contrib    文件:InstructionVisitor.java   
public void visitANEWARRAY(ANEWARRAY n) {
    Type t = n.getType(poolGen);
    log.log("         instr(anewarray)=" + t, Project.MSG_DEBUG);
    String type = t.toString();

    design.checkClass(type);
}
项目: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 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());
    }   
}
项目:VestaClient    文件:Pass3aVerifier.java   
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
public void visitANEWARRAY(ANEWARRAY o){
    indexValid(o, o.getIndex());
    Constant c = cpg.getConstant(o.getIndex());
    if (!   (c instanceof ConstantClass)){
        constraintViolated(o, "Expecting a CONSTANT_Class operand, but found a '"+c+"'.");
    }
    Type t = o.getType(cpg);
    if (t instanceof ArrayType){
        int dimensions = ((ArrayType) t).getDimensions();
        if (dimensions >= 255){
            constraintViolated(o, "Not allowed to create an array with more than 255 dimensions.");
        }
    }
}
项目:cashmere    文件:LoadAwareBasicBlock.java   
/**
 * Checks that any store in this basic block to the specified variable is the
 * result of a new() or a null.
 * @param ih handle up to where to investigate.
 * @param localVarIndex the local variable index
 * @return true if all stores are OK or there are no stores.
 */
boolean noAliasesStoreWithIndexBefore(InstructionHandle ih, LocalVariableGen lg) {
    InstructionHandle prev = null;
    for (InstructionContext ic : instructions) {
        InstructionHandle current = ic.getInstruction();
        if (current.equals(ih)) {
            break;
        }

        if (methodGen.instructionStoresTo(current, lg.getIndex())) {
            LocalVariableGen l1 = methodGen.findLocalVar(current, lg.getIndex(), false);
            if (l1 != lg) {
                prev = current;
                continue;
            }
            if (prev != null) {
                Instruction i = prev.getInstruction();
                if (i instanceof INVOKESPECIAL) {
                    INVOKESPECIAL invoker = (INVOKESPECIAL) i;
                    if (invoker.getMethodName(methodGen.getConstantPool()).equals("<init>")
                        && isNonEscapingConstructor(invoker)) {
                        continue;
                    }
                }
                if (i instanceof CHECKCAST) {
                InstructionHandle pp = prev.getPrev();
                if (pp != null) {
                    i = pp.getInstruction();
                }
                }
                if (i instanceof NEWARRAY
                        || i instanceof ANEWARRAY || i instanceof MULTIANEWARRAY
                        || i instanceof ConstantPushInstruction || i instanceof ACONST_NULL) {
                     prev = current;
                     continue;
                }
            }
            return false;

        }
        prev = current;
    }
    return true;
}
项目:cn1    文件:ClassToXmlvmProcess.java   
private void emitANEWARRAY(Element xml_inst, ANEWARRAY inst) {
    xml_inst.setAttribute("base-type", inst.getType(cpg).toString().replace("[]", ""));
}
项目:cn1    文件:JavaByteCodeOutputProcess.java   
@SuppressWarnings("unused")
// Called using reflection
private Instruction createInstructionAnewarray(Element inst) {
    String classType = inst.getAttributeValue("elementType");
    return new ANEWARRAY(constantPoolGen.addClass(classType));
}
项目:findbugs-all-the-bugs    文件:IsNullValueFrameModelingVisitor.java   
@Override
public void visitANEWARRAY(ANEWARRAY obj) {
    modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
    produce(IsNullValue.nonNullValue());
}
项目:FindBug-for-Domino-Designer    文件:IsNullValueFrameModelingVisitor.java   
@Override
public void visitANEWARRAY(ANEWARRAY obj) {
    modelNormalInstruction(obj, getNumWordsConsumed(obj), 0);
    produce(IsNullValue.nonNullValue());
}