1    /*
2     * Unconditional branch, 16-bit offset.
3     *
4     * The branch distance is a signed code-unit offset, which we need to
5     * double to get a byte offset.
6     */
7    /* goto/16 +AAAA */
8    .extern MterpProfileBranch
9    lh      rINST, 2(rPC)               # rINST <- offset (sign-extended AAAA)
10#if MTERP_PROFILE_BRANCHES
11    EXPORT_PC
12    move    a0, rSELF
13    daddu   a1, rFP, OFF_FP_SHADOWFRAME
14    move    a2, rINST
15    jal     MterpProfileBranch          # (self, shadow_frame, offset)
16    bnezc   v0, MterpOnStackReplacement # Note: offset must be in rINST
17#endif
18    dlsa    rPC, rINST, rPC, 1          # rPC <- rPC + offset * 2
19    lw      ra, THREAD_FLAGS_OFFSET(rSELF)  # Preload flags for MterpCheckSuspendAndContinue
20    move    a0, rINST                   # a0 <- offset
21    FETCH_INST                          # load rINST
22    bltz    a0, MterpCheckSuspendAndContinue  # suspend check if backwards branch
23    GET_INST_OPCODE v0                  # extract opcode from rINST
24    GOTO_OPCODE v0                      # jump to next instruction
25