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

项目:cashmere    文件:MethodGen.java   
/** Tests whether an object load instruction is used for computing an array length.
 *
 * @param loadInstruction the load instruction that loads the object
 * reference onto the stack. 
 * @return true if the instruction is a load instruction of an object which
 * is used for computing an array length. 
 */
public boolean isUsedForArrayLength(InstructionHandle loadInstruction) {
    if (loadInstruction.getInstruction() instanceof ALOAD) {
        InstructionHandle next = loadInstruction.getNext();
        if (next != null && (next.getInstruction() instanceof ARRAYLENGTH)) {
            return true;
        }
    }
    return false;
}
项目:cn1    文件:JavaByteCodeOutputProcess.java   
@SuppressWarnings("unused")
// Called using reflection
private Instruction createInstructionArraylength(Element inst) {
    return new ARRAYLENGTH();
}