public int length ( ) { Opcode opcode = getOpcode ( ) ; if ( opcode == null ) return 1 ; switch ( opcode ) { case TABLESWITCH : { int pad = align ( pc + 1 ) - pc ; int low = getInt ( pad + 4 ) ; int high = getInt ( pad + 8 ) ; return pad + 12 + 4 * ( high - low + 1 ) ; } case LOOKUPSWITCH : { int pad = align ( pc + 1 ) - pc ; int npairs = getInt ( pad + 4 ) ; return pad + 8 + 8 * npairs ; } default : return opcode . kind . length ; } }
Get the length in bytes of this instruction including the opcode and all its operands .