blob: 706dcf37a1e85d778a6bbd8071bbae5409fd780c [file] [log] [blame]
Douglas Leung200f0402016-02-25 20:05:47 -08001 /*
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 */
Alexey Frunze84603bf2016-10-21 19:54:43 -07007 /* instance-of vA, vB, class@CCCC */
Douglas Leung200f0402016-02-25 20:05:47 -08008 EXPORT_PC()
9 FETCH(a0, 1) # a0 <- CCCC
10 GET_OPB(a1) # a1 <- B
11 EAS2(a1, rFP, a1) # a1 <- &object
12 lw a2, OFF_FP_METHOD(rFP) # a2 <- method
13 move a3, rSELF # a3 <- self
14 GET_OPA4(rOBJ) # rOBJ <- A+
15 JAL(MterpInstanceOf) # v0 <- Mterp(index, &obj, method, self)
16 lw a1, THREAD_EXCEPTION_OFFSET(rSELF)
17 PREFETCH_INST(2) # load rINST
18 bnez a1, MterpException
19 ADVANCE(2) # advance rPC
20 GET_INST_OPCODE(t0) # extract opcode from rINST
21 SET_VREG_GOTO(v0, rOBJ, t0) # vA <- v0