1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6 <title>check-cast</title>
7 <link rel=stylesheet href="opcode.css">
17 Throw if the reference in the given register cannot be cast to the indicated
18 type. The type must be a reference type (not a primitive type).
23 <table class="instruc">
26 <th>Op & Format</th>
27 <th>Mnemonic / Syntax</th>
34 <td>check-cast vAA, type@BBBB</td>
35 <td><code>A:</code> reference-bearing register (8 bits)<br/>
36 <code>B:</code> type index (16 bits)</td>
45 A must be a valid register index in the current stack frame.
48 Register vA must contain a reference value.
51 B must be a valid index into the type pool.
54 Type pool entry B must contain a valid type descriptor for a reference type.
62 An attempt is made to get a reference to the class C the name of which is
63 contained in type pool entry B.
66 If C has not been loaded and resolved before, it is being loaded and
67 resolved. All exceptions that are possible during class loading can occur at
71 The run-time type of the object reference vA is compared against C.
74 If vA is null, the instruction succeeds (without further effects).
77 If vA is assignment compatible with C according to the usual rules of
78 the Java programming language, the instruction succeeds (without further
89 ClassCastException is thrown if vA is either not null or not assignment