OSDN Git Service

Dalvik fast interpreter support and JIT implementation
[android-x86/dalvik.git] / vm / mterp / mips / OP_SGET.S
1 %default { "barrier":"                  #  no-op " }
2 %verify "executed"
3 %verify "field already resolved"
4 %verify "field not yet resolved"
5 %verify "field cannot be resolved"
6     /*
7      * General 32-bit SGET handler.
8      *
9      * for: sget, sget-object, sget-boolean, sget-byte, sget-char, sget-short
10      */
11     # op vAA, field                        /* BBBB */
12     LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
13     FETCH(a1, 1)                           #  a1 <- field ref BBBB
14     LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
15     LOAD_eas2(a0, rBIX, a1)                #  a0 <- resolved StaticField ptr
16     # is resolved entry !null?
17     bnez      a0, .L${opcode}_finish
18
19     /*
20      * Continuation if the field has not yet been resolved.
21      *  a1:  BBBB field ref
22      *  rBIX: dvmDex->pResFields
23      */
24     LOAD_rSELF_method(a2)                  #  a2 <- current method
25 #if defined(WITH_JIT)
26     EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
27 #endif
28     EXPORT_PC()                            #  resolve() could throw, so export now
29     LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
30     JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
31     move      a0, v0
32     # success?
33     beqz      v0, common_exceptionThrown   #  no, handle exception
34 #if defined(WITH_JIT)
35     /*
36      * If the JIT is actively building a trace we need to make sure
37      * that the field is fully resolved before including this instruction.
38      */
39     JAL(common_verifyField)
40 #endif
41     b        .L${opcode}_finish            # resume
42 %break
43
44 .L${opcode}_finish:
45     LOAD_base_offStaticField_value(a1, a0) #  a1 <- field value
46     $barrier                               #  acquiring load
47     GET_OPA(a2)                            #  a2 <- AA
48     FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
49     GET_INST_OPCODE(t0)                    #  extract opcode from rINST
50     SET_VREG_GOTO(a1, a2, t0)              #  fp[AA] <- a1