• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1    /*
2     * Check to see if an object reference is an instance of a class.
3     *
4     * Most common situation is a non-null object, being compared against
5     * an already-resolved class.
6     */
7    /* instance-of vA, vB, class//CCCC */
8    EXPORT_PC
9    FETCH     w0, 1                     // w0<- CCCC
10    lsr       w1, wINST, #12            // w1<- B
11    VREG_INDEX_TO_ADDR x1, w1           // w1<- &object
12    ldr       x2, [xFP, #OFF_FP_METHOD] // w2<- method
13    mov       x3, xSELF                 // w3<- self
14    bl        MterpInstanceOf           // (index, &obj, method, self)
15    ldr       x1, [xSELF, #THREAD_EXCEPTION_OFFSET]
16    ubfx      w2, wINST, #8, #4         // w2<- A
17    PREFETCH_INST 2
18    cbnz      x1, MterpException
19    ADVANCE 2                           // advance rPC
20    SET_VREG w0, w2                     // vA<- w0
21    GET_INST_OPCODE ip                  // extract opcode from rINST
22    GOTO_OPCODE ip                      // jump to next instruction
23