11a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe/*
21a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * Copyright (C) 2014 The Android Open Source Project
31a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe *
41a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * Licensed under the Apache License, Version 2.0 (the "License");
51a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * you may not use this file except in compliance with the License.
61a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * You may obtain a copy of the License at
71a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe *
81a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe *      http://www.apache.org/licenses/LICENSE-2.0
91a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe *
101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * Unless required by applicable law or agreed to in writing, software
111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * distributed under the License is distributed on an "AS IS" BASIS,
121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * See the License for the specific language governing permissions and
141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe * limitations under the License.
151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe */
161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#include "asm_support_mips64.S"
181a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
191a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#include "arch/quick_alloc_entrypoints.S"
201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .set noreorder
221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .balign 16
231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
241a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /* Deliver the given exception */
251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .extern artDeliverExceptionFromCode
261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /* Deliver an exception pending on a thread */
271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .extern artDeliverPendingExceptionFromCode
281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /*
3004568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic     * Macro that sets up $gp and stores the previous $gp value to $t8.
3104568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic     * This macro modifies v1 and t8.
3204568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic     */
3304568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic.macro SETUP_GP
3404568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    move $v1, $ra
3504568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    bal 1f
3604568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    nop
3704568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic1:
3804568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpsetup $ra, $t8, 1b
3904568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    move $ra, $v1
4004568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic.endm
4104568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic
4204568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    /*
431a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Macro that sets up the callee save frame to conform with
441a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Runtime::CreateCalleeSaveMethod(kSaveAll)
451a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * callee-save: padding + $f24-$f31 + $s0-$s7 + $gp + $ra + $s8 = 19 total + 1x8 bytes padding
461a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     */
471a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
481a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, -160
491a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset 160
501a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
511a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     // Ugly compile-time check, but we only have the preprocessor.
521a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#if (FRAME_SIZE_SAVE_ALL_CALLEE_SAVE != 160)
531a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#error "SAVE_ALL_CALLEE_SAVE_FRAME(MIPS64) size not as expected."
541a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#endif
551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
561a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $ra, 152($sp)
571a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 31, 152
581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s8, 144($sp)
591a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 30, 144
6004568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    sd     $t8, 136($sp)           # t8 holds caller's gp, now save it to the stack.
6104568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cfi_rel_offset 28, 136        # Value from gp is pushed, so set the cfi offset accordingly.
621a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s7, 128($sp)
631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 23, 128
641a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s6, 120($sp)
651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 22, 120
661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s5, 112($sp)
671a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 21, 112
681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s4, 104($sp)
691a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 20, 104
701a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s3,  96($sp)
711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 19, 96
721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s2,  88($sp)
731a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 18, 88
741a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s1,  80($sp)
751a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 17, 80
761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s0,  72($sp)
771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 16, 72
781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    // FP callee-saves
801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f31, 64($sp)
811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f30, 56($sp)
821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f29, 48($sp)
831a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f28, 40($sp)
841a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f27, 32($sp)
851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f26, 24($sp)
861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f25, 16($sp)
871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f24,  8($sp)
881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # load appropriate callee-save-method
90618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, %got(_ZN3art7Runtime9instance_E)($gp)
91618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, 0($t1)
921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    THIS_LOAD_REQUIRES_READ_BARRIER
93618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, RUNTIME_SAVE_ALL_CALLEE_SAVE_FRAME_OFFSET($t1)
94618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    sd      $t1, 0($sp)                                # Place ArtMethod* at bottom of stack.
951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd      $sp, THREAD_TOP_QUICK_FRAME_OFFSET(rSELF)  # Place sp in Thread::Current()->top_quick_frame.
961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /*
991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Macro that sets up the callee save frame to conform with
1001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Runtime::CreateCalleeSaveMethod(kRefsOnly). Restoration assumes
1011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * non-moving GC.
1021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Does not include rSUSPEND or rSELF
1031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * callee-save: padding + $s2-$s7 + $gp + $ra + $s8 = 9 total + 1x8 bytes padding
1041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     */
1051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro SETUP_REFS_ONLY_CALLEE_SAVE_FRAME
1061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, -80
1071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset 80
1081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    // Ugly compile-time check, but we only have the preprocessor.
1101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#if (FRAME_SIZE_REFS_ONLY_CALLEE_SAVE != 80)
1111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#error "REFS_ONLY_CALLEE_SAVE_FRAME(MIPS64) size not as expected."
1121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#endif
1131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $ra, 72($sp)
1151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 31, 72
1161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s8, 64($sp)
1171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 30, 64
11804568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    sd     $t8, 56($sp)            # t8 holds caller's gp, now save it to the stack.
11904568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cfi_rel_offset 28, 56         # Value from gp is pushed, so set the cfi offset accordingly.
1201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s7, 48($sp)
1211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 23, 48
1221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s6, 40($sp)
1231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 22, 40
1241a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s5, 32($sp)
1251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 21, 32
1261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s4, 24($sp)
1271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 20, 24
1281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s3, 16($sp)
1291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 19, 16
1301a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s2, 8($sp)
1311a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 18, 8
1321a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # load appropriate callee-save-method
133618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, %got(_ZN3art7Runtime9instance_E)($gp)
134618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, 0($t1)
1351a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    THIS_LOAD_REQUIRES_READ_BARRIER
136618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, RUNTIME_REFS_ONLY_CALLEE_SAVE_FRAME_OFFSET($t1)
137618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    sd      $t1, 0($sp)                                # Place Method* at bottom of stack.
1381a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd      $sp, THREAD_TOP_QUICK_FRAME_OFFSET(rSELF)  # Place sp in Thread::Current()->top_quick_frame.
1391a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
1401a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1411a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME
1421a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $ra, 72($sp)
1431a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 31
1441a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s8, 64($sp)
1451a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 30
14604568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    ld     $t8, 56($sp)            # Restore gp back to it's temp storage.
1471a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 28
1481a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s7, 48($sp)
1491a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 23
1501a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s6, 40($sp)
1511a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 22
1521a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s5, 32($sp)
1531a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 21
1541a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s4, 24($sp)
1551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 20
1561a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s3, 16($sp)
1571a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 19
1581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s2, 8($sp)
1591a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 18
1601a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, 80
1611a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset -80
16204568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn
1631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
1641a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME_AND_RETURN
1661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $ra, 72($sp)
1671a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 31
1681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s8, 64($sp)
1691a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 30
17004568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    ld     $t8, 56($sp)            # Restore gp back to it's temp storage.
1711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 28
1721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s7, 48($sp)
1731a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 23
1741a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s6, 40($sp)
1751a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 22
1761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s5, 32($sp)
1771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 21
1781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s4, 24($sp)
1791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 20
1801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s3, 16($sp)
1811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 19
1821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s2, 8($sp)
1831a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 18
18404568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn
1851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr   $zero, $ra
1861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, 80
1871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset -80
1881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
1891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1901a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe// This assumes the top part of these stack frame types are identical.
1911a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#define REFS_AND_ARGS_MINUS_REFS_SIZE (FRAME_SIZE_REFS_AND_ARGS_CALLEE_SAVE - FRAME_SIZE_REFS_ONLY_CALLEE_SAVE)
1921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1931a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_INTERNAL
1941a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu  $sp, $sp, -208
1951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset 208
1961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    // Ugly compile-time check, but we only have the preprocessor.
1981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#if (FRAME_SIZE_REFS_AND_ARGS_CALLEE_SAVE != 208)
1991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#error "REFS_AND_ARGS_CALLEE_SAVE_FRAME(MIPS64) size not as expected."
2001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe#endif
2011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
2021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $ra, 200($sp)           # = kQuickCalleeSaveFrame_RefAndArgs_LrOffset
2031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 31, 200
2041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s8, 192($sp)
2051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 30, 192
20604568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    sd     $t8, 184($sp)           # t8 holds caller's gp, now save it to the stack.
20704568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cfi_rel_offset 28, 184        # Value from gp is pushed, so set the cfi offset accordingly.
2081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s7, 176($sp)
2091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 23, 176
2101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s6, 168($sp)
2111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 22, 168
2121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s5, 160($sp)
2131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 21, 160
2141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s4, 152($sp)
2151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 20, 152
2161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s3, 144($sp)
2171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 19, 144
2181a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s2, 136($sp)
2191a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 18, 136
2201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
2211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a7, 128($sp)
2221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 11, 128
2231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a6, 120($sp)
2241a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 10, 120
2251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a5, 112($sp)
2261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 9, 112
2271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a4, 104($sp)
2281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 8, 104
2291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a3,  96($sp)
2301a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 7, 96
2311a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a2,  88($sp)
2321a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 6, 88
2331a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a1,  80($sp)           # = kQuickCalleeSaveFrame_RefAndArgs_Gpr1Offset
2341a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 5, 80
2351a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
2361a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f19, 72($sp)
2371a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f18, 64($sp)
2381a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f17, 56($sp)
2391a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f16, 48($sp)
2401a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f15, 40($sp)
2411a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f14, 32($sp)
2421a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f13, 24($sp)           # = kQuickCalleeSaveFrame_RefAndArgs_Fpr1Offset
2431a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d    $f12, 16($sp)           # This isn't necessary to store.
2448223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung    # 1x8 bytes padding + Method*
2451a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
2461a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
2478223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung    /*
2488223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung     * Macro that sets up the callee save frame to conform with
2498223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung     * Runtime::CreateCalleeSaveMethod(kRefsAndArgs). Restoration assumes
2508223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung     * non-moving GC.
2518223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung     * callee-save: padding + $f12-$f19 + $a1-$a7 + $s2-$s7 + $gp + $ra + $s8 = 24 total + 1 words padding + Method*
2528223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung     */
2531a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME
2541a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_INTERNAL
2551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # load appropriate callee-save-method
256618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, %got(_ZN3art7Runtime9instance_E)($gp)
257618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, 0($t1)
2581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    THIS_LOAD_REQUIRES_READ_BARRIER
259618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    ld      $t1, RUNTIME_REFS_AND_ARGS_CALLEE_SAVE_FRAME_OFFSET($t1)
260618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic    sd      $t1, 0($sp)                                # Place Method* at bottom of stack.
2611a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd      $sp, THREAD_TOP_QUICK_FRAME_OFFSET(rSELF)  # Place sp in Thread::Current()->top_quick_frame.
2621a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
2631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
2648223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung.macro SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_WITH_METHOD_IN_A0
2658223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_INTERNAL
2663d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    sd      $a0, 0($sp)                                # Place Method* at bottom of stack.
2678223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung    sd      $sp, THREAD_TOP_QUICK_FRAME_OFFSET(rSELF)  # Place sp in Thread::Current()->top_quick_frame.
2688223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung.endm
2698223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung
2701a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME
2711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $ra, 200($sp)
2721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 31
2731a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s8, 192($sp)
2741a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 30
27504568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    ld     $t8, 184($sp)           # Restore gp back to it's temp storage.
2761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 28
2771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s7, 176($sp)
2781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 23
2791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s6, 168($sp)
2801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 22
2811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s5, 160($sp)
2821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 21
2831a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s4, 152($sp)
2841a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 20
2851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s3, 144($sp)
2861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 19
2871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s2, 136($sp)
2881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 18
2891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
2901a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a7, 128($sp)
2911a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 11
2921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a6, 120($sp)
2931a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 10
2941a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a5, 112($sp)
2951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 9
2961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a4, 104($sp)
2971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 8
2981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a3,  96($sp)
2991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 7
3001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a2,  88($sp)
3011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 6
3021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a1,  80($sp)
3031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 5
3041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
3051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f19, 72($sp)
3061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f18, 64($sp)
3071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f17, 56($sp)
3081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f16, 48($sp)
3091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f15, 40($sp)
3101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f14, 32($sp)
3111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f13, 24($sp)
3121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d    $f12, 16($sp)
3131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
31404568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn
3151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, 208
3161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset -208
3171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
3181a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
3191a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /*
3201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Macro that set calls through to artDeliverPendingExceptionFromCode,
3211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * where the pending
3221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * exception is Thread::Current()->exception_
3231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     */
3241a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro DELIVER_PENDING_EXCEPTION
32504568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    SETUP_GP
3261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME     # save callee saves for throw
3271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dla     $t9, artDeliverPendingExceptionFromCode
3281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr    $zero, $t9                   # artDeliverPendingExceptionFromCode(Thread*)
3291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $a0, rSELF                   # pass Thread::Current
3301a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
3311a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
3321a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro RETURN_IF_NO_EXCEPTION
3331a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $t0, THREAD_EXCEPTION_OFFSET(rSELF) # load Thread::Current()->exception_
3341a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME
3351a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    bne    $t0, $zero, 1f                      # success if no exception is pending
3361a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
3371a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr   $zero, $ra
3381a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
3391a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
3401a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    DELIVER_PENDING_EXCEPTION
3411a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
3421a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
3431a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro RETURN_IF_ZERO
3441a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME
3451a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    bne    $v0, $zero, 1f                # success?
3461a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
3471a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr   $zero, $ra                    # return on success
3481a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
3491a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
3501a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    DELIVER_PENDING_EXCEPTION
3511a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
3521a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
3531a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER
3541a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME
3551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq    $v0, $zero, 1f                # success?
3561a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
3571a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr   $zero, $ra                    # return on success
3581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
3591a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
3601a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    DELIVER_PENDING_EXCEPTION
3611a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
3621a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
3631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /*
3641a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * On entry $a0 is uint32_t* gprs_ and $a1 is uint32_t* fprs_
3651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * FIXME: just guessing about the shape of the jmpbuf.  Where will pc be?
3661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     */
36704568815cbfa18f0fa8b8d751fb83a1089909660Goran JakovljevicENTRY_NO_GP art_quick_do_long_jump
3681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f0, 0($a1)
3691a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f1, 8($a1)
3701a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f2, 16($a1)
3711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f3, 24($a1)
3721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f4, 32($a1)
3731a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f5, 40($a1)
3741a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f6, 48($a1)
3751a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f7, 56($a1)
3761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f8, 64($a1)
3771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f9, 72($a1)
3781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f10, 80($a1)
3791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f11, 88($a1)
3801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f12, 96($a1)
3811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f13, 104($a1)
3821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f14, 112($a1)
3831a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f15, 120($a1)
3841a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f16, 128($a1)
3851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f17, 136($a1)
3861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f18, 144($a1)
3871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f19, 152($a1)
3881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f20, 160($a1)
3891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f21, 168($a1)
3901a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f22, 176($a1)
3911a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f23, 184($a1)
3921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f24, 192($a1)
3931a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f25, 200($a1)
3941a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f26, 208($a1)
3951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f27, 216($a1)
3961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f28, 224($a1)
3971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f29, 232($a1)
3981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f30, 240($a1)
3991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f31, 248($a1)
4001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .set push
4011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .set nomacro
4021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .set noat
4031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe# no need to load zero
4041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $at, 8($a0)
4051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .set pop
4061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $v0, 16($a0)
4071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $v1, 24($a0)
4081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe# a0 has to be loaded last
4091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a1, 40($a0)
4101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a2, 48($a0)
4111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a3, 56($a0)
4121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a4, 64($a0)
4131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a5, 72($a0)
4141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a6, 80($a0)
4151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a7, 88($a0)
4161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t0, 96($a0)
4171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t1, 104($a0)
4181a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t2, 112($a0)
4191a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t3, 120($a0)
4201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s0, 128($a0)
4211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s1, 136($a0)
4221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s2, 144($a0)
4231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s3, 152($a0)
4241a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s4, 160($a0)
4251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s5, 168($a0)
4261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s6, 176($a0)
4271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s7, 184($a0)
4281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t8, 192($a0)
4291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t9, 200($a0)
4301a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe# no need to load k0, k1
4311a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $gp, 224($a0)
4321a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $sp, 232($a0)
4331a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $s8, 240($a0)
4341a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $ra, 248($a0)
4351a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a0, 32($a0)
4361a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $v0, $zero          # clear result registers v0 and v1
4371a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr    $zero, $ra          # do long jump
4381a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $v1, $zero
4391a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND art_quick_do_long_jump
4401a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
4416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
4426ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code, saves most registers (forms basis of long jump
4436ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * context) and passes the bottom of the stack.
4446ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * artDeliverExceptionFromCode will place the callee save Method* at
445618fdff93cec53c0ed234898f2d42f38a25e3b66Lazar Trsic     * the bottom of the thread. On entry a0 holds Throwable*
4466ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
4476ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_deliver_exception
4486ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
4496ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artDeliverExceptionFromCode
4506ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artDeliverExceptionFromCode(Throwable*, Thread*)
4516ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a1, rSELF                 # pass Thread::Current
4526ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_deliver_exception
4536ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
4546ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
4556ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to create and deliver a NullPointerException
4566ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
4576ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artThrowNullPointerExceptionFromCode
4586ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_throw_null_pointer_exception
4596ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.Lart_quick_throw_null_pointer_exception_gp_set:
4606ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
4616ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artThrowNullPointerExceptionFromCode
4626ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artThrowNullPointerExceptionFromCode(Thread*)
4636ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a0, rSELF                 # pass Thread::Current
4646ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_throw_null_pointer_exception
4651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
4666ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
4676ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to create and deliver an ArithmeticException
4686ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
4696ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artThrowDivZeroFromCode
4706ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_throw_div_zero
4716ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
4726ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artThrowDivZeroFromCode
4736ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artThrowDivZeroFromCode(Thread*)
4746ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a0, rSELF                 # pass Thread::Current
4756ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_throw_div_zero
4761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
4776ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
4786ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to create and deliver an
4796ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * ArrayIndexOutOfBoundsException
4806ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
4816ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artThrowArrayBoundsFromCode
4826ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_throw_array_bounds
4836ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.Lart_quick_throw_array_bounds_gp_set:
4846ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
4856ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artThrowArrayBoundsFromCode
4866ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artThrowArrayBoundsFromCode(index, limit, Thread*)
4876ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a2, rSELF                 # pass Thread::Current
4886ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_throw_array_bounds
4896ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
4906ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
4916ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to create and deliver a StackOverflowError.
4926ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
4936ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artThrowStackOverflowFromCode
4946ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_throw_stack_overflow
4956ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
4966ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artThrowStackOverflowFromCode
4976ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artThrowStackOverflowFromCode(Thread*)
4986ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a0, rSELF                 # pass Thread::Current
4996ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_throw_stack_overflow
5006ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
5016ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
5026ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to create and deliver a NoSuchMethodError.
5036ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
5046ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artThrowNoSuchMethodFromCode
5056ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_throw_no_such_method
5066ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
5076ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artThrowNoSuchMethodFromCode
5086ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artThrowNoSuchMethodFromCode(method_idx, Thread*)
5096ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a1, rSELF                 # pass Thread::Current
5106ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_throw_no_such_method
5116ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
5126ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
5136ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * All generated callsites for interface invokes and invocation slow paths will load arguments
5146ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * as usual - except instead of loading arg0/$a0 with the target Method*, arg0/$a0 will contain
5156ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * the method_idx.  This wrapper will save arg1-arg3, load the caller's Method*, align the
5166ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * stack and call the appropriate C helper.
5176ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * NOTE: "this" is first visable argument of the target, and so can be found in arg1/$a1.
5186ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     *
5196ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * The helper will attempt to locate the target and return a 128-bit result in $v0/$v1 consisting
5206ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * of the target Method* in $v0 and method->code_ in $v1.
5216ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     *
5222cebb24bfc3247d3e9be138a3350106737455918Mathieu Chartier     * If unsuccessful, the helper will return null/null. There will be a pending exception in the
5236ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * thread and we branch to another stub to deliver it.
5246ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     *
5256ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * On success this wrapper will restore arguments and *jump* to the target, leaving the ra
5266ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * pointing back to the original caller.
5276ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
5286ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.macro INVOKE_TRAMPOLINE c_name, cxx_name
5296ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern \cxx_name
5306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY \c_name
5316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME  # save callee saves in case allocation triggers GC
5329ad40fda952e854c4b571df36e46c834e209cd4cMathieu Chartier    ld    $a2, FRAME_SIZE_REFS_AND_ARGS_CALLEE_SAVE($sp)  # pass caller Method*
5336ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move  $a3, rSELF                       # pass Thread::Current
5346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal   \cxx_name                        # (method_idx, this, caller, Thread*, $sp)
5356ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move  $a4, $sp                         # pass $sp
5366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move  $a0, $v0                         # save target Method*
5376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move  $t9, $v1                         # save $v0->code_
5386ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME
5396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    beq   $v0, $zero, 1f
5406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
5416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr  $zero, $t9
5426ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
5436ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic1:
5446ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    DELIVER_PENDING_EXCEPTION
5456ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND \c_name
5466ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.endm
5476ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
5486ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicINVOKE_TRAMPOLINE art_quick_invoke_interface_trampoline, artInvokeInterfaceTrampoline
5496ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicINVOKE_TRAMPOLINE art_quick_invoke_interface_trampoline_with_access_check, artInvokeInterfaceTrampolineWithAccessCheck
5506ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
5516ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicINVOKE_TRAMPOLINE art_quick_invoke_static_trampoline_with_access_check, artInvokeStaticTrampolineWithAccessCheck
5526ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicINVOKE_TRAMPOLINE art_quick_invoke_direct_trampoline_with_access_check, artInvokeDirectTrampolineWithAccessCheck
5536ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicINVOKE_TRAMPOLINE art_quick_invoke_super_trampoline_with_access_check, artInvokeSuperTrampolineWithAccessCheck
5546ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicINVOKE_TRAMPOLINE art_quick_invoke_virtual_trampoline_with_access_check, artInvokeVirtualTrampolineWithAccessCheck
5551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
5561a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # On entry:
5571a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    #   t0 = shorty
5581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    #   t1 = ptr to arg_array
5591a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    #   t2 = number of argument bytes remain
5601a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    #   v0 = ptr to stack frame where to copy arg_array
5611a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # This macro modifies t3, t9 and v0
5621a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro LOOP_OVER_SHORTY_LOADING_REG gpu, fpu, label
5631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lbu    $t3, 0($t0)           # get argument type from shorty
5641a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beqz   $t3, \label
5651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t0, 1
5661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    li     $t9, 68               # put char 'D' into t9
5671a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq    $t9, $t3, 1f          # branch if result type char == 'D'
5681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    li     $t9, 70               # put char 'F' into t9
5691a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq    $t9, $t3, 2f          # branch if result type char == 'F'
5701a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    li     $t9, 74               # put char 'J' into t9
5711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq    $t9, $t3, 3f          # branch if result type char == 'J'
5721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
5736ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    lw     $\gpu, 0($t1)
5741a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $\gpu, 0($v0)
5751a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $v0, 4
5761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t1, 4
5771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    b      4f
5781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t2, -4               # delay slot
5791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
5801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:  # found double
5811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lwu    $t3, 0($t1)
5821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mtc1   $t3, $\fpu
5831a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $t3, 0($v0)
5841a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lwu    $t3, 4($t1)
5851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mthc1  $t3, $\fpu
5861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $t3, 4($v0)
5871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $v0, 8
5881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t1, 8
5891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    b      4f
5901a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t2, -8               # delay slot
5911a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
5921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe2:  # found float
5931a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lwu    $t3, 0($t1)
5941a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mtc1   $t3, $\fpu
5951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $t3, 0($v0)
5961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $v0, 4
5971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t1, 4
5981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    b      4f
5991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t2, -4               # delay slot
6001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe3:  # found long (8 bytes)
6021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lwu    $t3, 0($t1)
6031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $t3, 0($v0)
6041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lwu    $t9, 4($t1)
6051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $t9, 4($v0)
6061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsll   $t9, $t9, 32
6071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    or     $\gpu, $t9, $t3
6081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $v0, 8
6091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t1, 8
6101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t2, -8
6111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe4:
6121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
6131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /*
6151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Invocation stub for quick code.
6161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * On entry:
6171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a0 = method pointer
6181a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a1 = argument array that must at least contain the this ptr.
6191a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a2 = size of argument array in bytes
6201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a3 = (managed) thread pointer
6211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a4 = JValue* result
6221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a5 = shorty
6231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     */
62404568815cbfa18f0fa8b8d751fb83a1089909660Goran JakovljevicENTRY_NO_GP art_quick_invoke_stub
6251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # push a4, a5, s0(rSUSPEND), s1(rSELF), s8, ra onto the stack
6261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, -48
6271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset 48
6281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $ra, 40($sp)
6291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 31, 40
6301a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s8, 32($sp)
6311a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 30, 32
6321a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s1, 24($sp)
6331a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 17, 24
6341a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s0, 16($sp)
6351a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 16, 16
6361a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a5, 8($sp)
6371a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 9, 8
6381a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a4, 0($sp)
6391a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 8, 0
6401a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6411a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $s0, $zero, SUSPEND_CHECK_INTERVAL   # reset rSUSPEND to SUSPEND_CHECK_INTERVAL
6421a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $s1, $a3              # move managed thread pointer into s1 (rSELF)
6431a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $s8, $sp              # save sp in s8 (fp)
6441a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6453d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    daddiu $t3, $a2, 24          # add 8 for ArtMethod* and 16 for stack alignment
6461a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsrl   $t3, $t3, 4           # shift the frame size right 4
6471a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsll   $t3, $t3, 4           # shift the frame size left 4 to align to 16 bytes
6481a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsubu  $sp, $sp, $t3         # reserve stack space for argument array
6491a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6501a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t0, $a5, 1           # t0 = shorty[1] (skip 1 for return type)
6511a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t1, $a1, 4           # t1 = ptr to arg_array[4] (skip this ptr)
6521a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t2, $a2, -4          # t2 = number of argument bytes remain (skip this ptr)
6533d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    daddiu $v0, $sp, 12          # v0 points to where to copy arg_array
6541a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a2, f14, call_fn
6551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a3, f15, call_fn
6561a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a4, f16, call_fn
6571a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a5, f17, call_fn
6581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a6, f18, call_fn
6591a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a7, f19, call_fn
6601a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6611a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # copy arguments onto stack (t2 should be multiples of 4)
6621a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ble    $t2, $zero, call_fn   # t2 = number of argument bytes remain
6631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
6641a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lw     $t3, 0($t1)           # load from argument array
6651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t1, $t1, 4
6661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $t3, 0($v0)           # save to stack
6671a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t2, -4
6681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    bgt    $t2, $zero, 1b        # t2 = number of argument bytes remain
6691a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $v0, $v0, 4
6701a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampecall_fn:
6721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # call method (a0 and a1 have been untouched)
6731a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lwu    $a1, 0($a1)           # make a1 = this ptr
6743d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    sw     $a1, 8($sp)           # copy this ptr (skip 8 bytes for ArtMethod*)
6753d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    sd     $zero, 0($sp)         # store null for ArtMethod* at bottom of frame
6763d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $t9, ART_METHOD_QUICK_CODE_OFFSET_64($a0)  # get pointer to the code
6771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr   $t9                   # call the method
6781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
6791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $sp, $s8              # restore sp
6801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # pop a4, a5, s1(rSELF), s8, ra off of the stack
6821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a4, 0($sp)
6831a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 8
6841a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a5, 8($sp)
6851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 9
6861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s0, 16($sp)
6871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 16
6881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s1, 24($sp)
6891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 17
6901a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s8, 32($sp)
6911a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 30
6921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $ra, 40($sp)
6931a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 31
6941a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, 48
6951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset -48
6961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
6971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # a4 = JValue* result
6981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # a5 = shorty string
6991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lbu   $t1, 0($a5)           # get result type from shorty
7001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    li    $t2, 68               # put char 'D' into t2
7011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq   $t1, $t2, 1f          # branch if result type char == 'D'
7021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    li    $t3, 70               # put char 'F' into t3
7031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq   $t1, $t3, 1f          # branch if result type char == 'F'
7041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v0, 0($a4)           # store the result
7051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsrl  $v1, $v0, 32
7061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr  $zero, $ra
7071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v1, 4($a4)           # store the other half of the result
7081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
7091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mfc1  $v0, $f0
7101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mfhc1 $v1, $f0
7111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v0, 0($a4)           # store the result
7121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr  $zero, $ra
7131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v1, 4($a4)           # store the other half of the result
7141a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND art_quick_invoke_stub
7151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /*
7171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Invocation static stub for quick code.
7181a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * On entry:
7191a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a0 = method pointer
7201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a1 = argument array that must at least contain the this ptr.
7211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a2 = size of argument array in bytes
7221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a3 = (managed) thread pointer
7231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a4 = JValue* result
7241a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     *   a5 = shorty
7251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     */
72604568815cbfa18f0fa8b8d751fb83a1089909660Goran JakovljevicENTRY_NO_GP art_quick_invoke_static_stub
7271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # push a4, a5, s0(rSUSPEND), s1(rSELF), s8, ra, onto the stack
7291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, -48
7301a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset 48
7311a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $ra, 40($sp)
7321a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 31, 40
7331a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s8, 32($sp)
7341a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 30, 32
7351a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s1, 24($sp)
7361a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 17, 24
7371a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $s0, 16($sp)
7381a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 16, 16
7391a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a5, 8($sp)
7401a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 9, 8
7411a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd     $a4, 0($sp)
7421a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 8, 0
7431a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7441a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $s0, $zero, SUSPEND_CHECK_INTERVAL   # reset rSUSPEND to SUSPEND_CHECK_INTERVAL
7451a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $s1, $a3              # move managed thread pointer into s1 (rSELF)
7461a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $s8, $sp              # save sp in s8 (fp)
7471a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7483d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    daddiu $t3, $a2, 24          # add 8 for ArtMethod* and 16 for stack alignment
7491a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsrl   $t3, $t3, 4           # shift the frame size right 4
7501a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsll   $t3, $t3, 4           # shift the frame size left 4 to align to 16 bytes
7511a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsubu  $sp, $sp, $t3         # reserve stack space for argument array
7521a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7531a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t0, $a5, 1           # t0 = shorty[1] (skip 1 for return type)
7541a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $t1, $a1              # t1 = arg_array
7551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $t2, $a2              # t2 = number of argument bytes remain
7563d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    daddiu $v0, $sp, 8           # v0 points to where to copy arg_array
7571a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a1, f13, call_sfn
7581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a2, f14, call_sfn
7591a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a3, f15, call_sfn
7601a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a4, f16, call_sfn
7611a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a5, f17, call_sfn
7621a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a6, f18, call_sfn
7631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    LOOP_OVER_SHORTY_LOADING_REG a7, f19, call_sfn
7641a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # copy arguments onto stack (t2 should be multiples of 4)
7661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ble    $t2, $zero, call_sfn  # t2 = number of argument bytes remain
7671a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
7681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lw     $t3, 0($t1)           # load from argument array
7691a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t1, $t1, 4
7701a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw     $t3, 0($v0)           # save to stack
7711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $t2, -4
7721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    bgt    $t2, $zero, 1b        # t2 = number of argument bytes remain
7731a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $v0, $v0, 4
7741a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7751a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampecall_sfn:
7761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # call method (a0 has been untouched)
7773d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    sd     $zero, 0($sp)         # store null for ArtMethod* at bottom of frame
7783d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $t9, ART_METHOD_QUICK_CODE_OFFSET_64($a0)  # get pointer to the code
7791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr   $t9                   # call the method
7801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
7811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move   $sp, $s8              # restore sp
7821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7831a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # pop a4, a5, s0(rSUSPEND), s1(rSELF), s8, ra off of the stack
7841a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a4, 0($sp)
7851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 8
7861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $a5, 8($sp)
7871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 9
7881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s0, 16($sp)
7891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 16
7901a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s1, 24($sp)
7911a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 17
7921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $s8, 32($sp)
7931a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 30
7941a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld     $ra, 40($sp)
7951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_restore 31
7961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu $sp, $sp, 48
7971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset -48
7981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
7991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # a4 = JValue* result
8001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # a5 = shorty string
8011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    lbu   $t1, 0($a5)           # get result type from shorty
8021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    li    $t2, 68               # put char 'D' into t2
8031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq   $t1, $t2, 1f          # branch if result type char == 'D'
8041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    li    $t3, 70               # put char 'F' into t3
8051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq   $t1, $t3, 1f          # branch if result type char == 'F'
8061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v0, 0($a4)           # store the result
8071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dsrl  $v1, $v0, 32
8081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr  $zero, $ra
8091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v1, 4($a4)           # store the other half of the result
8101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
8111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mfc1  $v0, $f0
8121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mfhc1 $v1, $f0
8131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v0, 0($a4)           # store the result
8141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr  $zero, $ra
8151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sw    $v1, 4($a4)           # store the other half of the result
8161a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND art_quick_invoke_static_stub
8171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
8186ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
8196ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Entry from managed code that calls artHandleFillArrayDataFromCode and
8206ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * delivers exception on failure.
8216ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
8226ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artHandleFillArrayDataFromCode
8236ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_handle_fill_data
8246ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME  # save callee saves in case exception allocation triggers GC
8253d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld      $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
8266ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal     artHandleFillArrayDataFromCode              # (payload offset, Array*, method, Thread*)
8276ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move    $a3, rSELF                                  # pass Thread::Current
8286ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
8296ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_handle_fill_data
8306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
8316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
8326ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Entry from managed code that calls artLockObjectFromCode, may block for GC.
8336ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
8346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artLockObjectFromCode
8356ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_lock_object
8366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    beq     $a0, $zero, .Lart_quick_throw_null_pointer_exception_gp_set
8376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
8386ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME     # save callee saves in case we block
8396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal     artLockObjectFromCode         # (Object* obj, Thread*)
8406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move    $a1, rSELF                    # pass Thread::Current
8416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
8426ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_lock_object
8436ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
8446ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
8456ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Entry from managed code that calls artUnlockObjectFromCode and delivers exception on failure.
8466ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
8476ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artUnlockObjectFromCode
8486ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_unlock_object
8496ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    beq     $a0, $zero, .Lart_quick_throw_null_pointer_exception_gp_set
8506ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
8516ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME  # save callee saves in case exception allocation triggers GC
8526ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal     artUnlockObjectFromCode    # (Object* obj, Thread*)
8536ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move    $a1, rSELF                 # pass Thread::Current
8546ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
8556ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_unlock_object
8566ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
8576ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
8586ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Entry from managed code that calls artCheckCastFromCode and delivers exception on failure.
8596ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
8606ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artThrowClassCastException
8616ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_check_cast
8626ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddiu $sp, $sp, -32
8636ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .cfi_adjust_cfa_offset 32
8646ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $ra, 24($sp)
8656ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .cfi_rel_offset 31, 24
8666ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $t9, 16($sp)
8676ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $a1, 8($sp)
8686ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $a0, 0($sp)
8696ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artIsAssignableFromCode
87004568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn                       # Restore gp from t8 in branch delay slot.
87104568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic                                    # t8 may be clobbered in artIsAssignableFromCode.
8726ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    beq    $v0, $zero, .Lthrow_class_cast_exception
8736ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $ra, 24($sp)
8746ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr   $zero, $ra
8756ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddiu $sp, $sp, 32
8766ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .cfi_adjust_cfa_offset -32
8776ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.Lthrow_class_cast_exception:
8786ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $t9, 16($sp)
8796ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $a1, 8($sp)
8806ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $a0, 0($sp)
8816ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddiu $sp, $sp, 32
8826ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .cfi_adjust_cfa_offset -32
88304568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    SETUP_GP
8846ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
8856ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artThrowClassCastException
8866ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artThrowClassCastException (Class*, Class*, Thread*)
8876ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a2, rSELF                 # pass Thread::Current
8886ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_check_cast
8896ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
8906ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
8916ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Entry from managed code for array put operations of objects where the value being stored
8926ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * needs to be checked for compatibility.
8936ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * a0 = array, a1 = index, a2 = value
8946ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
8956ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_aput_obj_with_null_and_bound_check
8966ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    bne    $a0, $zero, .Lart_quick_aput_obj_with_bound_check_gp_set
8976ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
8986ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    b .Lart_quick_throw_null_pointer_exception_gp_set
8996ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
9006ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_aput_obj_with_null_and_bound_check
9011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
9026ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_aput_obj_with_bound_check
9036ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    lwu  $t0, MIRROR_ARRAY_LENGTH_OFFSET($a0)
9046ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sltu $t1, $a1, $t0
9056ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    bne  $t1, $zero, .Lart_quick_aput_obj_gp_set
9066ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
9076ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a0, $a1
9086ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    b .Lart_quick_throw_array_bounds_gp_set
9096ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move $a1, $t0
9106ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_aput_obj_with_bound_check
9111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
9126ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_aput_obj
9136ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    beq  $a2, $zero, .Ldo_aput_null
9146ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
9156ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    lwu $t0, MIRROR_OBJECT_CLASS_OFFSET($a0)
9166ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    lwu $t1, MIRROR_OBJECT_CLASS_OFFSET($a2)
9176ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    lwu $t0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET($t0)
9186ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    bne $t1, $t0, .Lcheck_assignability  # value's type == array's component type - trivial assignability
9196ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
9206ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.Ldo_aput:
9216ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dsll  $a1, $a1, 2
9226ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddu $t0, $a0, $a1
9236ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sw   $a2, MIRROR_OBJECT_ARRAY_DATA_OFFSET($t0)
9246ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld   $t0, THREAD_CARD_TABLE_OFFSET(rSELF)
9256ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dsrl  $t1, $a0, 7
9266ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddu $t1, $t1, $t0
9276ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sb   $t0, ($t1)
9286ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $ra
92904568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn                       # Restore gp from t8 in branch delay slot.
9306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.Ldo_aput_null:
9316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dsll  $a1, $a1, 2
9326ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddu $t0, $a0, $a1
9336ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sw   $a2, MIRROR_OBJECT_ARRAY_DATA_OFFSET($t0)
9346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $ra
93504568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn                       # Restore gp from t8 in branch delay slot.
9366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic.Lcheck_assignability:
9376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddiu $sp, $sp, -64
9386ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .cfi_adjust_cfa_offset 64
9396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $ra, 56($sp)
9406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .cfi_rel_offset 31, 56
9416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $t9, 24($sp)
9426ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $a2, 16($sp)
9436ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $a1, 8($sp)
9446ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    sd     $a0, 0($sp)
9456ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a1, $t1
9466ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a0, $t0
9476ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artIsAssignableFromCode  # (Class*, Class*)
94804568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn                       # Restore gp from t8 in branch delay slot.
94904568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic                                    # t8 may be clobbered in artIsAssignableFromCode.
9506ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $ra, 56($sp)
9516ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $t9, 24($sp)
9526ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $a2, 16($sp)
9536ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $a1, 8($sp)
9546ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    ld     $a0, 0($sp)
9556ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddiu $sp, $sp, 64
9566ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .cfi_adjust_cfa_offset -64
95704568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    SETUP_GP
9586ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    bne    $v0, $zero, .Ldo_aput
9596ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    nop
9606ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
9616ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a1, $a2
9626ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla  $t9, artThrowArrayStoreException
9636ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr $zero, $t9                 # artThrowArrayStoreException(Class*, Class*, Thread*)
9646ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF               # pass Thread::Current
9656ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_aput_obj
9666ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
9676ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
9686ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and load a boolean primitive value.
9696ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
9706ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetBooleanStaticFromCode
9716ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_boolean_static
9726ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
9733d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
9746ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetBooleanStaticFromCode   # (uint32_t field_idx, const Method* referrer, Thread*)
9756ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF                    # pass Thread::Current
9766ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
9776ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_boolean_static
9786ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
9796ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
9806ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and load a byte primitive value.
9816ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
9826ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetByteStaticFromCode
9836ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_byte_static
9846ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
9853d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
9866ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetByteStaticFromCode      # (uint32_t field_idx, const Method* referrer, Thread*)
9876ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF                    # pass Thread::Current
9886ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
9896ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_byte_static
9906ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
9916ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
9926ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and load a char primitive value.
9936ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
9946ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetCharStaticFromCode
9956ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_char_static
9966ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
9973d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
9986ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetCharStaticFromCode      # (uint32_t field_idx, const Method* referrer, Thread*)
9996ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF                    # pass Thread::Current
10006ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10016ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_char_static
10026ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10036ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10046ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and load a short primitive value.
10056ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10066ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetShortStaticFromCode
10076ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_short_static
10086ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10093d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10106ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetShortStaticFromCode     # (uint32_t field_idx, const Method* referrer, Thread*)
10116ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF                    # pass Thread::Current
10126ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10136ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_short_static
10146ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10156ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10166ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and load a 32-bit primitive value.
10176ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10186ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGet32StaticFromCode
10196ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get32_static
10206ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10213d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10226ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGet32StaticFromCode        # (uint32_t field_idx, const Method* referrer, Thread*)
10236ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF                    # pass Thread::Current
10246ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10256ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get32_static
10266ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10276ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10286ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and load a 64-bit primitive value.
10296ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGet64StaticFromCode
10316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get64_static
10326ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10333d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGet64StaticFromCode        # (uint32_t field_idx, const Method* referrer, Thread*)
10356ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF                    # pass Thread::Current
10366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get64_static
10386ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and load an object reference.
10416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10426ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetObjStaticFromCode
10436ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_obj_static
10446ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10453d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10466ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetObjStaticFromCode       # (uint32_t field_idx, const Method* referrer, Thread*)
10476ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, rSELF                    # pass Thread::Current
10486ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10496ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_obj_static
10506ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10516ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10526ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and load a boolean primitive value.
10536ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10546ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetBooleanInstanceFromCode
10556ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_boolean_instance
10566ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10573d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10586ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetBooleanInstanceFromCode # (field_idx, Object*, referrer, Thread*)
10596ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
10606ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10616ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_boolean_instance
10626ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10636ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10646ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and load a byte primitive value.
10656ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10666ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetByteInstanceFromCode
10676ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_byte_instance
10686ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10693d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10706ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetByteInstanceFromCode    # (field_idx, Object*, referrer, Thread*)
10716ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
10726ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10736ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_byte_instance
10746ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10756ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10766ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and load a char primitive value.
10776ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10786ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetCharInstanceFromCode
10796ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_char_instance
10806ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10813d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10826ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetCharInstanceFromCode    # (field_idx, Object*, referrer, Thread*)
10836ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
10846ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10856ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_char_instance
10866ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10876ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
10886ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and load a short primitive value.
10896ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
10906ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetShortInstanceFromCode
10916ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_short_instance
10926ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
10933d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
10946ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetShortInstanceFromCode   # (field_idx, Object*, referrer, Thread*)
10956ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
10966ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
10976ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_short_instance
10986ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
10996ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11006ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and load a 32-bit primitive value.
11016ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11026ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGet32InstanceFromCode
11036ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get32_instance
11046ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11053d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11066ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGet32InstanceFromCode      # (field_idx, Object*, referrer, Thread*)
11076ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11086ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
11096ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get32_instance
11106ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11116ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11126ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and load a 64-bit primitive value.
11136ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11146ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGet64InstanceFromCode
11156ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get64_instance
11166ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11173d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11186ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGet64InstanceFromCode      # (field_idx, Object*, referrer, Thread*)
11196ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11206ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
11216ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get64_instance
11226ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11236ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11246ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and load an object reference.
11256ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11266ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artGetObjInstanceFromCode
11276ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_get_obj_instance
11286ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11293d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artGetObjInstanceFromCode     # (field_idx, Object*, referrer, Thread*)
11316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11326ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_NO_EXCEPTION
11336ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_get_obj_instance
11346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11356ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and store a 8-bit primitive value.
11376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11386ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet8StaticFromCode
11396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set8_static
11406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11413d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11426ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet8StaticFromCode         # (field_idx, new_val, referrer, Thread*)
11436ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11446ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
11456ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set8_static
11466ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11476ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11486ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and store a 16-bit primitive value.
11496ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11506ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet16StaticFromCode
11516ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set16_static
11526ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11533d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11546ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet16StaticFromCode        # (field_idx, new_val, referrer, Thread*)
11556ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11566ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
11576ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set16_static
11586ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11596ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11606ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and store a 32-bit primitive value.
11616ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11626ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet32StaticFromCode
11636ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set32_static
11646ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11653d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11666ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet32StaticFromCode        # (field_idx, new_val, referrer, Thread*)
11676ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11686ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
11696ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set32_static
11706ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11716ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11726ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and store a 64-bit primitive value.
11736ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11746ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet64StaticFromCode
11756ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set64_static
11766ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11776ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a2, $a1                      # pass new_val
11783d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a1, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11796ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet64StaticFromCode        # (field_idx, referrer, new_val, Thread*)
11806ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11816ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
11826ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set64_static
11836ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11846ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11856ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve a static field and store an object reference.
11866ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11876ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSetObjStaticFromCode
11886ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set_obj_static
11896ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
11903d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a2, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
11916ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSetObjStaticFromCode       # (field_idx, new_val, referrer, Thread*)
11926ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a3, rSELF                    # pass Thread::Current
11936ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
11946ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set_obj_static
11956ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
11966ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
11976ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and store a 8-bit primitive value.
11986ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
11996ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet8InstanceFromCode
12006ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set8_instance
12016ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
12023d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a3, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
12036ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet8InstanceFromCode       # (field_idx, Object*, new_val, referrer, Thread*)
12046ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a4, rSELF                    # pass Thread::Current
12056ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
12066ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set8_instance
12076ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
12086ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
12096ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and store a 16-bit primitive value.
12106ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
12116ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet16InstanceFromCode
12126ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set16_instance
12136ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
12143d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a3, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
12156ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet16InstanceFromCode      # (field_idx, Object*, new_val, referrer, Thread*)
12166ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a4, rSELF                    # pass Thread::Current
12176ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
12186ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set16_instance
12196ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
12206ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
12216ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and store a 32-bit primitive value.
12226ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
12236ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet32InstanceFromCode
12246ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set32_instance
12256ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
12263d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a3, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
12276ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet32InstanceFromCode      # (field_idx, Object*, new_val, referrer, Thread*)
12286ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a4, rSELF                    # pass Thread::Current
12296ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
12306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set32_instance
12316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
12326ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
12336ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and store a 64-bit primitive value.
12346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
12356ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSet64InstanceFromCode
12366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set64_instance
12376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
12383d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a3, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
12396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSet64InstanceFromCode      # (field_idx, Object*, new_val, referrer, Thread*)
12406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a4, rSELF                    # pass Thread::Current
12416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
12426ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set64_instance
12436ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
12446ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
12456ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code to resolve an instance field and store an object reference.
12466ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
12476ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artSetObjInstanceFromCode
12486ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_set_obj_instance
12496ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME    # save callee saves in case of GC
12503d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld     $a3, FRAME_SIZE_REFS_ONLY_CALLEE_SAVE($sp)  # pass referrer's Method*
12516ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artSetObjInstanceFromCode     # (field_idx, Object*, new_val, referrer, Thread*)
12526ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a4, rSELF                    # pass Thread::Current
12536ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RETURN_IF_ZERO
12546ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_set_obj_instance
12556ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
12565ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko// Macro to facilitate adding new allocation entrypoints.
12575ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko.macro ONE_ARG_DOWNCALL name, entrypoint, return
12585ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    .extern \entrypoint
12595ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir MarkoENTRY \name
12606ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME  # save callee saves in case of GC
12615ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    jal     \entrypoint
12625ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    move    $a1, rSELF                 # pass Thread::Current
12635ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    \return
12645ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir MarkoEND \name
12655ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko.endm
12661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
12671a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe// Macro to facilitate adding new allocation entrypoints.
12681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro TWO_ARG_DOWNCALL name, entrypoint, return
12696ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern \entrypoint
12701a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeENTRY \name
12716ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME  # save callee saves in case of GC
12726ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal     \entrypoint
12736ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move    $a2, rSELF                 # pass Thread::Current
12746ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    \return
12751a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND \name
12761a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
12771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
12781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.macro THREE_ARG_DOWNCALL name, entrypoint, return
12796ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern \entrypoint
12801a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeENTRY \name
12816ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME  # save callee saves in case of GC
12826ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal     \entrypoint
12836ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move    $a3, rSELF                 # pass Thread::Current
12846ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    \return
12851a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND \name
12861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe.endm
12871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
1288e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko.macro FOUR_ARG_DOWNCALL name, entrypoint, return
1289e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko    .extern \entrypoint
1290e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir MarkoENTRY \name
1291e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME  # save callee saves in case of GC
1292e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko    jal     \entrypoint
1293e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko    move    $a4, rSELF                 # pass Thread::Current
1294e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko    \return
1295e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir MarkoEND \name
1296e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko.endm
1297e85e123a2dff7d4b20266183a0583f9364a8b824Vladimir Marko
12981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe// Generate the allocation entrypoints for each allocator.
12991a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeGENERATE_ALL_ALLOC_ENTRYPOINTS
13001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
13016ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
13025ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * Entry from managed code to resolve a string, this stub will allocate a String and deliver an
13035ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * exception on error. On success the String is returned. A0 holds the string index. The fast
13045ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * path check for hit in strings cache has already been performed.
13055ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     */
13065ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir MarkoONE_ARG_DOWNCALL art_quick_resolve_string, artResolveStringFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER
13075ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko
13085ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    /*
13095ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * Entry from managed code when uninitialized static storage, this stub will run the class
13105ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * initializer and deliver the exception on error. On success the static storage base is
13115ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * returned.
13125ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     */
13135ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir MarkoONE_ARG_DOWNCALL art_quick_initialize_static_storage, artInitializeStaticStorageFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER
13145ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko
13155ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    /*
13165ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * Entry from managed code when dex cache misses for a type_idx.
13175ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     */
13185ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir MarkoONE_ARG_DOWNCALL art_quick_initialize_type, artInitializeTypeFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER
13195ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko
13205ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    /*
13215ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * Entry from managed code when type_idx needs to be checked for access and dex cache may also
13225ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     * miss.
13235ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko     */
13245ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir MarkoONE_ARG_DOWNCALL art_quick_initialize_type_and_verify_access, artInitializeTypeAndVerifyAccessFromCode, RETURN_IF_RESULT_IS_NON_ZERO_OR_DELIVER
13255ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko
13265ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92Vladimir Marko    /*
13276ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called by managed code when the value in rSUSPEND has been decremented to 0.
13286ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
13296ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artTestSuspendFromCode
13306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_test_suspend
13316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    lh     $a0, THREAD_FLAGS_OFFSET(rSELF)
13326ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    bne    $a0, $zero, 1f
13336ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddiu rSUSPEND, $zero, SUSPEND_CHECK_INTERVAL   # reset rSUSPEND to SUSPEND_CHECK_INTERVAL
13346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr   $zero, $ra
133504568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn                                 # Restore gp from t8 in branch delay slot.
13366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic1:
13376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME         # save callee saves for stack crawl
13386ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal    artTestSuspendFromCode             # (Thread*)
13396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move   $a0, rSELF
13406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME_AND_RETURN
13416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_test_suspend
13426461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung
13436461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    /*
13446461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung     * Called by managed code that is attempting to call a method on a proxy class. On entry
13456461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung     * r0 holds the proxy method; r1, r2 and r3 may contain arguments.
13466461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung     */
13476461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    .extern artQuickProxyInvokeHandler
13486461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas LeungENTRY art_quick_proxy_invoke_handler
13498223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_WITH_METHOD_IN_A0
13506461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    move    $a2, rSELF             # pass Thread::Current
13516461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    jal     artQuickProxyInvokeHandler  # (Method* proxy method, receiver, Thread*, SP)
13526461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    move    $a3, $sp               # pass $sp
13536461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    ld      $t0, THREAD_EXCEPTION_OFFSET(rSELF) # load Thread::Current()->exception_
13546461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    daddiu  $sp, $sp, REFS_AND_ARGS_MINUS_REFS_SIZE  # skip a0-a7 and f12-f19
13556461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME
13566461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    bne     $t0, $zero, 1f
13576461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    dmtc1   $v0, $f0               # place return value to FP return value
13586461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    jalr    $zero, $ra
13596461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    dmtc1   $v1, $f1               # place return value to FP return value
13606461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung1:
13616461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung    DELIVER_PENDING_EXCEPTION
13626461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas LeungEND art_quick_proxy_invoke_handler
13636461d19fe1132ec25b92d008c1a7b57f5ecc134bDouglas Leung
13646ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
13656ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Called to resolve an imt conflict. t0 is a hidden argument that holds the target method's
13666ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * dex method index.
13676ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
13686ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_imt_conflict_trampoline
13693d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld      $a0, 0($sp)            # load caller Method*
13703d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    lwu     $a0, ART_METHOD_DEX_CACHE_METHODS_OFFSET($a0)  # load dex_cache_resolved_methods
13713d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    dsll    $t0, 3                 # convert target method offset to bytes
13726ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    daddu   $a0, $t0               # get address of target method
13736ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    dla     $t9, art_quick_invoke_interface_trampoline
137404568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn
13756ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jalr    $zero, $t9
13760b95bf17e077b9d6c52514fec5ed122017111edbMathieu Chartier    ld      $a0, MIRROR_LONG_ARRAY_DATA_OFFSET($a0)  # load the target method
13776ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_imt_conflict_trampoline
1378cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe
1379cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    .extern artQuickResolutionTrampoline
1380cc7c39d747f5802282adcc51ffe44405f116f84bAndreas GampeENTRY art_quick_resolution_trampoline
1381cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME
1382cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    move    $a2, rSELF             # pass Thread::Current
1383cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    jal     artQuickResolutionTrampoline  # (Method* called, receiver, Thread*, SP)
1384cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    move    $a3, $sp               # pass $sp
1385cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    beq     $v0, $zero, 1f
13863d21bdf8894e780d349c481e5c9e29fe1556051cMathieu Chartier    ld      $a0, 0($sp)            # load resolved method in $a0
1387cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe                                   # artQuickResolutionTrampoline puts resolved method in *SP
1388cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME
1389cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    move    $t9, $v0               # code pointer must be in $t9 to generate the global pointer
1390cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    jalr    $zero, $t9             # tail call to method
1391cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    nop
1392cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe1:
1393cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME
1394cc7c39d747f5802282adcc51ffe44405f116f84bAndreas Gampe    DELIVER_PENDING_EXCEPTION
1395cc7c39d747f5802282adcc51ffe44405f116f84bAndreas GampeEND art_quick_resolution_trampoline
13961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
13971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .extern artQuickGenericJniTrampoline
13981a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .extern artQuickGenericJniEndTrampoline
13991a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeENTRY art_quick_generic_jni_trampoline
14008223b809a527c15b68f7c5c462d4c55c1335c7a7Douglas Leung    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_WITH_METHOD_IN_A0
14011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $s8, $sp               # save $sp
14021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14031a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # prepare for call to artQuickGenericJniTrampoline(Thread*, SP)
14041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $a0, rSELF             # pass Thread::Current
14051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $a1, $sp               # pass $sp
14061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jal     artQuickGenericJniTrampoline   # (Thread*, SP)
14071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu  $sp, $sp, -5120        # reserve space on the stack
14081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # The C call will have registered the complete save-frame on success.
14101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # The result of the call is:
14111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # v0: ptr to native code, 0 on error.
14121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # v1: ptr to the bottom of the used area of the alloca, can restore stack till here.
14131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    beq     $v0, $zero, 1f         # check entry error
14141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $t9, $v0               # save the code ptr
14151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $sp, $v1               # release part of the alloca
14161a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14171a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # Load parameters from stack into registers
14181a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a0,   0($sp)
14191a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a1,   8($sp)
14201a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a2,  16($sp)
14211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a3,  24($sp)
14221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a4,  32($sp)
14231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a5,  40($sp)
14241a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a6,  48($sp)
14251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $a7,  56($sp)
14261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # Load FPRs the same as GPRs. Look at BuildNativeCallFrameStateMachine.
14271a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f12,  0($sp)
14281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f13,  8($sp)
14291a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f14, 16($sp)
14301a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f15, 24($sp)
14311a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f16, 32($sp)
14321a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f17, 40($sp)
14331a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f18, 48($sp)
14341a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d     $f19, 56($sp)
14351a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr    $t9                    # native call
14361a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu  $sp, $sp, 64
14371a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14381a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # result sign extension is handled in C code
14391a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # prepare for call to artQuickGenericJniEndTrampoline(Thread*, result, result_f)
14401a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $a0, rSELF             # pass Thread::Current
14411a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $a1, $v0
14421a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jal     artQuickGenericJniEndTrampoline
14431a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dmfc1   $a2, $f0
14441a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14451a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t0, THREAD_EXCEPTION_OFFSET(rSELF) # load Thread::Current()->exception_
1446126d65952a03b3e44d5021208673c01920a982a4Nicolas Geoffray    bne     $t0, $zero, 1f         # check for pending exceptions
14471a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $sp, $s8               # tear down the alloca
14481a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14491a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    # tear dpown the callee-save frame
14501a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME
14511a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14521a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr    $zero, $ra
14531a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dmtc1   $v0, $f0               # place return value to FP return value
14541a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14551a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
1456126d65952a03b3e44d5021208673c01920a982a4Nicolas Geoffray    ld      $sp, THREAD_TOP_QUICK_FRAME_OFFSET(rSELF)
1457126d65952a03b3e44d5021208673c01920a982a4Nicolas Geoffray    # This will create a new save-all frame, required by the runtime.
14581a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    DELIVER_PENDING_EXCEPTION
14591a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND art_quick_generic_jni_trampoline
14601a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14611a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .extern artQuickToInterpreterBridge
14621a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeENTRY art_quick_to_interpreter_bridge
14631a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME
14641a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $a1, rSELF             # pass Thread::Current
14651a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jal     artQuickToInterpreterBridge    # (Method* method, Thread*, SP)
14661a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move    $a2, $sp               # pass $sp
14671a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld      $t0, THREAD_EXCEPTION_OFFSET(rSELF) # load Thread::Current()->exception_
14681a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu  $sp, $sp, REFS_AND_ARGS_MINUS_REFS_SIZE  # skip a0-a7 and f12-f19
14691a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME
14701a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    bne     $t0, $zero, 1f
14711a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dmtc1   $v0, $f0               # place return value to FP return value
14721a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr    $zero, $ra
14731a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    dmtc1   $v1, $f1               # place return value to FP return value
14741a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe1:
14751a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    DELIVER_PENDING_EXCEPTION
14761a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND art_quick_to_interpreter_bridge
14771a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
14781a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /*
14791a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     * Routine that intercepts method calls and returns.
14801a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe     */
14811a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .extern artInstrumentationMethodEntryFromCode
14821a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .extern artInstrumentationMethodExitFromCode
14831a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeENTRY art_quick_instrumentation_entry
14841a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME
14851a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu   $sp, $sp, -16     # space for saving arg0
14861a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset 16
14871a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd       $a0, 0($sp)       # save arg0
14881a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $a3, $ra          # pass $ra
14891a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jal      artInstrumentationMethodEntryFromCode  # (Method*, Object*, Thread*, RA)
14901a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $a2, rSELF        # pass Thread::Current
14911a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $t9, $v0          # $t9 holds reference to code
14921a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld       $a0, 0($sp)       # restore arg0
14931a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu   $sp, $sp, 16      # remove args
14941a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset -16
14951a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME
14961a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    jalr     $t9               # call method
14971a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    nop
14981a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND art_quick_instrumentation_entry
14991a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    /* intentional fallthrough */
15001a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .global art_quick_instrumentation_exit
15011a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampeart_quick_instrumentation_exit:
15021a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_startproc
150304568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    SETUP_GP
15041a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $ra, $zero        # link register is to here, so clobber with 0 for later checks
15051a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    SETUP_REFS_ONLY_CALLEE_SAVE_FRAME
15061a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $t0, $sp          # remember bottom of caller's frame
15071a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu   $sp, $sp, -16     # save return values and set up args
15081a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset 16
15091a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    sd       $v0, 0($sp)
15101a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_rel_offset 2, 0
15111a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    s.d      $f0, 8($sp)
15121a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    mov.d    $f15, $f0         # pass fpr result
15131a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $a2, $v0          # pass gpr result
15141a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $a1, $t0          # pass $sp
15151a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $a0, rSELF        # pass Thread::Current
151604568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    jal      artInstrumentationMethodExitFromCode  # (Thread*, SP, gpr_res, fpr_res)
151704568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic    .cpreturn                  # Restore gp from t8 in branch delay slot. gp is not used anymore,
151804568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic                               # and t8 may be clobbered in artInstrumentationMethodExitFromCode.
151904568815cbfa18f0fa8b8d751fb83a1089909660Goran Jakovljevic
1520f96e8bdf47cfcbecd8ad8ebceb765e5a257ca143Douglas Leung    move     $t9, $v0          # set aside returned link register
15211a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    move     $ra, $v1          # set link register for deoptimization
15221a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    ld       $v0, 0($sp)       # restore return values
15231a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    l.d      $f0, 8($sp)
1524f96e8bdf47cfcbecd8ad8ebceb765e5a257ca143Douglas Leung    jalr     $zero, $t9        # return
15251a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    daddiu   $sp, $sp, 16+FRAME_SIZE_REFS_ONLY_CALLEE_SAVE  # 16 bytes of saved values + ref_only callee save frame
15261a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe    .cfi_adjust_cfa_offset -(16+FRAME_SIZE_REFS_ONLY_CALLEE_SAVE)
15271a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeEND art_quick_instrumentation_exit
15281a5c40672783fac98aca5a04ac798a0a0014de65Andreas Gampe
15296ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    /*
15306ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * Instrumentation has requested that we deoptimize into the interpreter. The deoptimization
15316ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     * will long jump to the upcall with a special exception of -1.
15326ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic     */
15336ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artDeoptimize
15346ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    .extern artEnterInterpreterFromDeoptimize
15356ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicENTRY art_quick_deoptimize
15366ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    SETUP_SAVE_ALL_CALLEE_SAVE_FRAME
15376ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    jal      artDeoptimize     # artDeoptimize(Thread*, SP)
15386ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic                               # Returns caller method's frame size.
15396ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic    move     $a0, rSELF        # pass Thread::current
15406ea651f0f4c7de4580beb2e887d86802c1ae0738Maja GagicEND art_quick_deoptimize
15416ea651f0f4c7de4580beb2e887d86802c1ae0738Maja Gagic
15421a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeUNIMPLEMENTED art_quick_indexof
15431a5c40672783fac98aca5a04ac798a0a0014de65Andreas GampeUNIMPLEMENTED art_quick_string_compareto
1544