blob: 90fd3ee63e8aefe7e78dc2badb53e624a3bbadab [file] [log] [blame]
Andreas Gampe1a5c4062015-01-15 12:10:47 -08001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "asm_support_mips64.S"
18
19 .set noreorder
20 .balign 16
21
22 /*
23 * Jni dlsym lookup stub.
24 */
25 .extern artFindNativeMethod
26ENTRY art_jni_dlsym_lookup_stub
27 daddiu $sp, $sp, -80 # save a0-a7 and $ra
28 .cfi_adjust_cfa_offset 80
29 sd $ra, 64($sp)
30 .cfi_rel_offset 31, 64
31 sw $a7, 56($sp)
32 .cfi_rel_offset 11, 56
33 sw $a6, 48($sp)
34 .cfi_rel_offset 10, 48
35 sw $a5, 40($sp)
36 .cfi_rel_offset 9, 40
37 sw $a4, 32($sp)
38 .cfi_rel_offset 8, 32
39 sw $a3, 24($sp)
40 .cfi_rel_offset 7, 24
41 sw $a2, 16($sp)
42 .cfi_rel_offset 6, 16
43 sw $a1, 8($sp)
44 .cfi_rel_offset 5, 8
45 sw $a0, 0($sp)
46 .cfi_rel_offset 4, 0
47 jal artFindNativeMethod # (Thread*)
48 move $a0, $s1 # pass Thread::Current()
49 ld $a0, 0($sp) # restore registers from stack
50 .cfi_restore 4
51 ld $a1, 8($sp)
52 .cfi_restore 5
53 ld $a2, 16($sp)
54 .cfi_restore 6
55 ld $a3, 24($sp)
56 .cfi_restore 7
57 ld $a4, 32($sp)
58 .cfi_restore 8
59 ld $a5, 40($sp)
60 .cfi_restore 9
61 ld $a6, 48($sp)
62 .cfi_restore 10
63 ld $a7, 56($sp)
64 .cfi_restore 11
65 ld $ra, 64($sp)
66 .cfi_restore 31
67 beq $v0, $zero, .Lno_native_code_found
68 daddiu $sp, $sp, 80 # restore the stack
69 .cfi_adjust_cfa_offset -80
70 move $t9, $v0 # put method code result in $t9
71 jalr $zero, $t9 # leaf call to method's code
72 nop
73.Lno_native_code_found:
74 jalr $zero, $ra
75 nop
76END art_jni_dlsym_lookup_stub