/** 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; }
@SuppressWarnings("unused") // Called using reflection private Instruction createInstructionArraylength(Element inst) { return new ARRAYLENGTH(); }