blob: 1be34ba80ed2ca9c7d4cef05ec131ad58402331d [file] [log] [blame]
Ian Rogers7655f292013-07-29 11:07:13 -07001/*
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
23ENTRY art_jni_dlsym_lookup_stub
24 push {r0, r1, r2, r3, lr} @ spill regs
25 .save {r0, r1, r2, r3, lr}
26 .pad #20
27 .cfi_adjust_cfa_offset 20
28 sub sp, #12 @ pad stack pointer to align frame
29 .pad #12
30 .cfi_adjust_cfa_offset 12
Ian Rogers468532e2013-08-05 10:56:33 -070031 blx artFindNativeMethod
Ian Rogers7655f292013-07-29 11:07:13 -070032 mov r12, r0 @ save result in r12
33 add sp, #12 @ restore stack pointer
34 .cfi_adjust_cfa_offset -12
Ian Rogers637859c2013-08-27 14:35:54 -070035 cbz r0, 1f @ is method code null?
Ian Rogers7655f292013-07-29 11:07:13 -070036 pop {r0, r1, r2, r3, lr} @ restore regs
37 .cfi_adjust_cfa_offset -20
Ian Rogers637859c2013-08-27 14:35:54 -070038 bx r12 @ if non-null, tail call to method's code
391:
40 .cfi_adjust_cfa_offset 20
41 pop {r0, r1, r2, r3, pc} @ restore regs and return to caller to handle exception
42 .cfi_adjust_cfa_offset -20
Ian Rogers7655f292013-07-29 11:07:13 -070043END art_jni_dlsym_lookup_stub