• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%verify "executed"
2%verify "field already resolved"
3%verify "field not yet resolved"
4%verify "field cannot be resolved"
5    /*
6     * SPUT object handler.
7     */
8    /* op vAA, field@BBBB */
9    GET_GLUE(%ecx)
10    movzwl    2(rPC),%eax                        # eax<- field ref BBBB
11    movl      offGlue_methodClassDex(%ecx),%ecx  # ecx<- DvmDex
12    movl      offDvmDex_pResFields(%ecx),%ecx    # ecx<- dvmDex->pResFields
13    movl      (%ecx,%eax,4),%eax                 # eax<- resolved StaticField
14    testl     %eax,%eax                          # resolved entry null?
15    je        .L${opcode}_resolve                # if not, make it so
16.L${opcode}_finish:     # field ptr in eax
17    movzbl    rINST_HI,%ecx                      # ecx<- AA
18    GET_VREG(%ecx,%ecx)
19    jmp       .L${opcode}_continue
20%break
21
22
23.L${opcode}_continue:
24    movl      %ecx,offStaticField_value(%eax)    # do the store
25    testl     %ecx,%ecx                          # stored null object ptr?
26    FETCH_INST_WORD(2)
27    je        1f                                 # skip card mark if null
28    GET_GLUE(%ecx)
29    movl      offField_clazz(%eax),%eax          # eax<- field->clazz
30    movl      offGlue_cardTable(%ecx),%ecx       # get card table base
31    shrl      $$GC_CARD_SHIFT,%eax               # head to card number
32    movb      %cl,(%ecx,%eax)                    # mark card
331:
34    ADVANCE_PC(2)
35    GOTO_NEXT
36
37.L${opcode}_resolve:
38    GET_GLUE(%ecx)
39    movzwl   2(rPC),%eax                        # eax<- field ref BBBB
40    movl     offGlue_method(%ecx),%ecx          # ecx<- current method
41    EXPORT_PC()                                 # could throw, need to export
42    movl     offMethod_clazz(%ecx),%ecx         # ecx<- method->clazz
43    SPILL(rPC)
44    movl     %eax,OUT_ARG1(%esp)
45    movl     %ecx,OUT_ARG0(%esp)
46    call     dvmResolveStaticField              # eax<- resolved StaticField ptr
47    UNSPILL(rPC)
48    testl    %eax,%eax
49    jne      .L${opcode}_finish                 # success, continue
50    jmp      common_exceptionThrown             # no, handle exception
51