Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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_arm.S" |
| 18 | |
| 19 | /* |
| 20 | * Jni dlsym lookup stub. |
| 21 | */ |
| 22 | .extern artFindNativeMethod |
| 23 | ENTRY art_jni_dlsym_lookup_stub |
| 24 | push {r0, r1, r2, r3, lr} @ spill regs |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 25 | .cfi_adjust_cfa_offset 20 |
Christopher Ferris | 7fae7c4 | 2014-09-09 13:55:13 -0700 | [diff] [blame^] | 26 | .cfi_rel_offset r0, 0 |
| 27 | .cfi_rel_offset r1, 4 |
| 28 | .cfi_rel_offset r2, 8 |
| 29 | .cfi_rel_offset r3, 12 |
| 30 | .cfi_rel_offset lr, 16 |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 31 | sub sp, #12 @ pad stack pointer to align frame |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 32 | .cfi_adjust_cfa_offset 12 |
Ian Rogers | 468532e | 2013-08-05 10:56:33 -0700 | [diff] [blame] | 33 | blx artFindNativeMethod |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 34 | mov r12, r0 @ save result in r12 |
| 35 | add sp, #12 @ restore stack pointer |
| 36 | .cfi_adjust_cfa_offset -12 |
Ian Rogers | 637859c | 2013-08-27 14:35:54 -0700 | [diff] [blame] | 37 | cbz r0, 1f @ is method code null? |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 38 | pop {r0, r1, r2, r3, lr} @ restore regs |
| 39 | .cfi_adjust_cfa_offset -20 |
Christopher Ferris | 7fae7c4 | 2014-09-09 13:55:13 -0700 | [diff] [blame^] | 40 | .cfi_restore r0 |
| 41 | .cfi_restore r1 |
| 42 | .cfi_restore r2 |
| 43 | .cfi_restore r3 |
| 44 | .cfi_restore lr |
Ian Rogers | 637859c | 2013-08-27 14:35:54 -0700 | [diff] [blame] | 45 | bx r12 @ if non-null, tail call to method's code |
| 46 | 1: |
Ian Rogers | 637859c | 2013-08-27 14:35:54 -0700 | [diff] [blame] | 47 | pop {r0, r1, r2, r3, pc} @ restore regs and return to caller to handle exception |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 48 | END art_jni_dlsym_lookup_stub |