Douglas Leung | 200f040 | 2016-02-25 20:05:47 -0800 | [diff] [blame] | 1 | %default { "is_object":"0", "helper":"artGet32StaticFromCode" } |
| 2 | /* |
| 3 | * General SGET handler. |
| 4 | * |
| 5 | * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short |
| 6 | */ |
| 7 | # op vAA, field /* BBBB */ |
| 8 | .extern $helper |
| 9 | EXPORT_PC() |
| 10 | FETCH(a0, 1) # a0 <- field ref BBBB |
| 11 | lw a1, OFF_FP_METHOD(rFP) # a1 <- method |
| 12 | move a2, rSELF # a2 <- self |
| 13 | JAL($helper) |
| 14 | lw a3, THREAD_EXCEPTION_OFFSET(rSELF) |
| 15 | GET_OPA(a2) # a2 <- AA |
| 16 | PREFETCH_INST(2) |
| 17 | bnez a3, MterpException # bail out |
| 18 | .if $is_object |
| 19 | SET_VREG_OBJECT(v0, a2) # fp[AA] <- v0 |
| 20 | .else |
| 21 | SET_VREG(v0, a2) # fp[AA] <- v0 |
| 22 | .endif |
| 23 | ADVANCE(2) |
| 24 | GET_INST_OPCODE(t0) # extract opcode from rINST |
| 25 | GOTO_OPCODE(t0) # jump to next instruction |