From the point of view of a piece of code written in the Java
      programming language or targeted in the same way to .class
      files, the Dalvik VM aims to behave in a way
      that is fully consistent with the language's definition.
      That is, the code running in Dalvik will behave the same as it
      would have running in any other virtual machine. This includes
      verification failures.
      The Dx/Dalvik system will check roughly the same
      constraints that any other VM would, except as noted in the file
      verifier.html. The following table briefly
      lists all Dx/Dalvik verification constraints together their analogs
      from the book The Java
Static constraints are constraints on individual elements of the bytecode. They usually can be checked without employing control or data-flow analysis techniques.
| Identifier | Description | Spec equivalent | Failure mode | 
|---|---|---|---|
| A1 | The codearray must not be empty. | 4.8.1.1 | DX | 
| A2 | The codearray must not be larger than 65535 bytes. | 4.8.1.2 | DX | 
| A3 | The first opcode in codearray must have index0. | 4.8.1.3 | DX | 
| A4 | The codearray must only contain valid opcodes. | 4.8.1.4 | DX | 
| A5 | The index of instruction n+1must equal the index of
          instructionnplus the length of instructionn, taking into account a possiblewideinstruction. Opcodes modified by awideinstruction must
          not be directly reachable. | 4.8.1.5 | DX | 
| A6 | The last instruction in codearray must end at indexcode_length-1. | 4.8.1.6 | DX | 
| A7 | All jump and branch targets must be opcodes within the same method.
          Opcodes modified by a wideinstruction must not be
          directly reachable via a jump or branch instruction. | 4.8.1.7 | DX | 
| A8 | All targets of a tableswitchinstruction must be opcodes
          within the same method. Upper and lower bounds must be consistent.
          Opcodes modified by awideinstruction must not be
          directly reachable via atableswitchinstruction. | 4.8.1.8 | DX | 
| A9 | All targets of a lookupswitchinstruction must be opcodes
          within the same method. Its table must be consistent and sorted
          low-to-high. Opcodes modified by awideinstruction must
          not be directly reachable via alookupswitchinstruction. | 4.8.1.9 | DX | 
| A10 | The operands of ldcandldc_winstructions
          must be valid indices into the constant pool. The respective entries
          must be of typeCONSTANT_Integer,CONSTANT_Float, orCONSTANT_String. | 4.8.1.10 | DX | 
| A11 | The operands of ldc2_winstructions must be valid indices
          into the constant pool. The respective entries must be of typeCONSTANT_LongorCONSTANT_Double. The
          subsequent constant pool entry must be valid and remain unused. | 4.8.1.11 | DX | 
| A12 | The Operands of get<kind>andput<kind>instructions must be valid indices into
          constant pool. The respective entries must be of typeCONSTANT_Fieldref. | 4.8.1.12 | DX | 
| A13 | The first two operands of invokevirtual,invokespecial, andinvokestaticmust form a
          valid 16-bit index into the constant pool. The respective entries must
          be of typeCONSTANT_Methodref. | 4.8.1.13 | DX | 
| A14 | Methods whose names start with '<' must only be invoked implicitly by
          the VM, not by class file code. The only exception is the instance
          initializer, which may be invoked by invokespecial. | 4.8.1.14 | DX | 
| A15 | The first two operands of invokeinterfacemust form a
          valid 16-bit index into the constant pool. The entry must be of typeCONSTANT_Interface_Methodref. The third operand must
          specify number of local variables and the fourth operand must always
          be zero. | 4.8.1.15 | DX | 
| A16 | The operands of instanceof,checkcast,new, andanewarrayinstructions must
          be a valid index into the constant pool. The first two operands ofmultianewarrayinstruction must form a valid 16-bit index
          into the constant pool. All respective entries must be of typeCONSTANT_Class. | 4.8.1.16 | DX | 
| A17 | The dimensions of an array created by anewarrayinstructions must be less than256. | 4.8.1.17 | DX | 
| A18 | The newinstruction must not reference array classes,
          interfaces, or abstract classes. | 4.8.1.18 | DX | 
| A19 | The type referenced by a multinewarrayinstruction must
          have at least as many dimensions as specified in the instruction. The
          dimensions operand must not be0 | 4.8.1.19 | DX | 
| A20 | The type referenced by a newarrayinstruction must be a
          valid, non-reference type. | 4.8.1.20 | DX | 
| A21 | The index operand of instructions explicitly referencing single-width
          local variables must be non-negative and smaller than max_locals. | 4.8.1.21 | DX | 
| A22 | The index operand of instructions implicitly referencing single-width
          local variables must be non-negative and smaller than max_locals. | 4.8.1.22 | DX | 
| A23 | The index operand of instructions explicitly referencing double-width
          local variables must be non-negative and smaller than max_locals-1. | 4.8.1.23 | DX | 
| A24 | The index operand of instructions implicitly referencing double-width
          local variables must be non-negative and smaller than max_locals-1. | 4.8.1.24 | DX | 
| A25 | The index operand of wideinstructions explicitly
          referencing single-width local variables must be non-negative and
          smaller thanmax_locals. | 4.8.1.25 | DX | 
| A26 | The index operand of wideinstructions explicitly
          referencing double-width local variables must be non-negative and
          smaller thanmax_locals-1. | 4.8.1.25 | DX | 
Structural constraints are constraints on relationships between several elements of the bytecode. They usually can't be checked without employing control or data-flow analysis techniques.
| Identifier | Description | Spec equivalent | Failure mode | 
|---|---|---|---|
| B1 | The number and types of arguments (operands and local variables) must always match the instruction. | 4.8.2.1 | DX | 
| B2 | The operand stack must have the same depth for all executions paths leading to an instruction. | 4.8.2.2 | DX | 
| B3 | Local variable pairs must never be broken up. | 4.8.2.3 | DX | 
| B4 | A local variable (or pair) has to be assigned first before it can be read. | 4.8.2.4 | DX | 
| B5 | The operand stack must never grow beyond max_stack. | 4.8.2.5 | DX | 
| B6 | The operand stack must never underflow. | 4.8.2.6 | DX | 
| B7 | An invokespecialinstruction must only invoke an instance
          initializer or a method in the current class or one of its
          superclasses. | 4.8.2.7 | VM | 
| B8 | An instance initializer must only be invoked on an uninitialized instance residing on the operand stack. | 4.8.2.8 | VM | 
| B9 | Instance methods may only be invoked on and instance fields may only be accessed on already initialized instances. | 4.8.2.9 | VM | 
| B10 | The must be no backwards branches with uninitialized instances on the operand stack or in local variables. There must be no code protected by an exception handler that contains local variables with uninitialized instances. | 4.8.2.10 | DX | 
| B11 | An instance initializer must call another instance initializer (same
           class or superclass) before any instance members can be accessed.
           Exceptions are non-inherited instance fields, which can be assigned
           before calling another initializer, and the Objectclass
           in general. | 4.8.2.11 | VM | 
| B12 | All actual method arguments must be assignment-compatible with formal arguments. | 4.8.2.12 | VM | 
| B13 | For each instance method invocation, the actual instance must be assignment-compatible with the class or interface specified in the instruction. | 4.8.2.13 | VM | 
| B14 | A returns instruction must match its method's return type. | 4.8.2.14 | VM | 
| B15 | When accessing protected members of a superclass, the actual type of the instance being accessed must be either the current class or one of its subclasses. | 4.8.2.15 | VM | 
| B16 | The type of a value stored into a static field must be assignment-compatible with or convertible to the field's type. | 4.8.2.16 | VM | 
| B17 | The type of a value stored into a field must be assignment-compatible with or convertible to the field's type. | 4.8.2.17 | VM | 
| B18 | The type of every value stored into an array must be assignment-compatible with the array's component type. | 4.8.2.18 | VM | 
| B19 | The operand of an athrowinstruction must be
           assignment-compatible withjava.lang.Throwable. | 4.8.2.19 | VM | 
| B20 | The last reachable instruction of a method must either be a backwards
           jump or branch, a return, or an athrowinstruction. It
           must not be possible to leave thecodearray at the
           bottom. | 4.8.2.20 | VM | 
| B21 | Local variable values must not be used as return addresses. | 4.8.2.21 | VM | 
| B22 | There must be a single, uniquely determined return instruction per subroutine call. | 4.8.2.22 | VM | 
| B23 | Subroutine calls must not be directly or indirectly self-recursive. | 4.8.2.23 | DX | 
| B24 | ReturnAddressinstances must not be reused. If a
           subroutine returns to aReturnAddressfurther up the
           stack than where its original call instruction is located, then allReturnAddressinstances further down the stack must
           never be used. | 4.8.2.24 | DX |