# const-class

## Purpose

Move a reference to the class specified by the given index into the specified register. In the case where the indicated type is primitive, this will store a reference to the primitive type's degenerate class.

## Details

Op & Format | Mnemonic / Syntax | Arguments
--- | --- | ---
1c 21c | const-class vAA, type@BBBB | `A:` destination register (8 bits) `B:` type index

## Constraints

- A must be a valid register index in the current stack frame.
- B must be a valid index into the type constant pool.

## Behavior

- An attempt is made to get a reference to the class C the name of which is contained in type pool entry B.
- If B refers to a primitive type, the corresponding degenerate class is used instead.
- If C has not been loaded and resolved before, it is being loaded and resolved. All exceptions that are possible during class loading can occur at this point.
- A reference to C is moved into register vA, that is, vA' = C.
- If v(A-1) is the lower half of a register pair, v(A-1)' becomes undefined.
- If v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined.

## Exceptions

- ClassNotFoundException is thrown if the class does not exist at all.
- VerifyError is thrown if the class does exist, but could not be verified.