Home | History | Annotate | Download | only in mips
      1 %default {"volatile":"0"}
      2 %verify "executed"
      3 %verify "field already resolved"
      4 %verify "field not yet resolved"
      5 %verify "field cannot be resolved"
      6     /*
      7      * Jumbo 64-bit SPUT handler.
      8      */
      9     /* sput-wide/jumbo vBBBB, field@AAAAAAAA */
     10     LOAD_rSELF_methodClassDex(a2)          #  a2 <- DvmDex
     11     FETCH(a1, 1)                           # a1<- aaaa (lo)
     12     FETCH(a2, 2)                           # a2<- AAAA (hi)
     13     LOAD_base_offDvmDex_pResFields(rBIX, a2) #  rBIX <- dvmDex->pResFields
     14     sll     a2,a2,16
     15     or      a1, a1, a2                    # a1<- AAAAaaaa
     16     FETCH(rOBJ, 3)                        # rOBJ<- BBBB    solved StaticField ptr
     17     EAS2(rOBJ, rFP, t0)                    #  rOBJ<- &fp[BBBB]
     18     # is resolved entry null?
     19     beqz      a2, .L${opcode}_resolve      #  yes, do resolve
     20 .L${opcode}_finish:                        #  field ptr in a2, BBBB in rOBJ
     21     FETCH_ADVANCE_INST(4)                  #  advance rPC, load rINST
     22     LOAD64(a0, a1, rOBJ)                   #  a0/a1 <- vBBBB/vBBBB+1
     23     GET_INST_OPCODE(rBIX)                  #  extract opcode from rINST
     24     .if $volatile
     25     addu    a2, offStaticField_value       #  a2<- pointer to data
     26     JAL(dvmQuasiAtomicSwap64Sync)          #  stores a0/a1 into addr a2
     27     .else
     28     STORE64_off(a0, a1, a2, offStaticField_value) #  field <- vBBBB/vBBBB+1
     29     .endif
     30     GOTO_OPCODE(rBIX)                      #  jump to next instruction
     31 %break
     32 
     33     /*
     34      * Continuation if the field has not yet been resolved.
     35      *  a1:  AAAAAAAA field ref
     36      *  rOBJ:  &fp[BBBB]
     37      *  rBIX: dvmDex->pResFields
     38      *
     39      * Returns StaticField pointer in a2.
     40      */
     41 .L${opcode}_resolve:
     42     LOAD_rSELF_method(a2)                  #  a2 <- current method
     43 #if defined(WITH_JIT)
     44     EAS2(rBIX, rBIX, a1)                   #  rBIX<- &dvmDex->pResFields[field]
     45 #endif
     46     EXPORT_PC()                            #  resolve() could throw, so export now
     47     LOAD_base_offMethod_clazz(a0, a2)      #  a0 <- method->clazz
     48     JAL(dvmResolveStaticField)             #  v0 <- resolved StaticField ptr
     49     # success ?
     50     move      a0, v0
     51     beqz      v0, common_exceptionThrown   #  no, handle exception
     52 #if defined(WITH_JIT)
     53     /*
     54      * If the JIT is actively building a trace we need to make sure
     55      * that the field is fully resolved before including this instruction.
     56      */
     57     JAL(common_verifyField)
     58 #endif
     59     move      a2, v0
     60     b         .L${opcode}_finish           # resume
     61