Home | History | Annotate | Download | only in mips
      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_mips.S"
     18 
     19     .set noreorder
     20     .balign 4
     21 
     22     /*
     23      * Jni dlsym lookup stub.
     24      */
     25     .extern artFindNativeMethod
     26 ENTRY art_jni_dlsym_lookup_stub
     27     addiu $sp, $sp, -48         # leave room for $f12, $f13, $f14, $f15, $a0, $a1, $a2, $a3, and $ra
     28     .cfi_adjust_cfa_offset 48
     29     sw    $ra, 32($sp)
     30     .cfi_rel_offset 31, 32
     31     SDu   $f14, $f15, 24, $sp, $t0
     32     SDu   $f12, $f13, 16, $sp, $t0
     33     sw    $a3, 12($sp)
     34     .cfi_rel_offset 7, 12
     35     sw    $a2, 8($sp)
     36     .cfi_rel_offset 6, 8
     37     sw    $a1, 4($sp)
     38     .cfi_rel_offset 5, 4
     39     sw    $a0, 0($sp)
     40     .cfi_rel_offset 4, 0
     41     la    $t9, artFindNativeMethod
     42     jalr  $t9                   # (Thread*)
     43     move  $a0, $s1              # pass Thread::Current()
     44     lw    $a0, 0($sp)           # restore registers from stack
     45     lw    $a1, 4($sp)
     46     lw    $a2, 8($sp)
     47     lw    $a3, 12($sp)
     48     LDu   $f12, $f13, 16, $sp, $t0
     49     LDu   $f14, $f15, 24, $sp, $t0
     50     lw    $ra, 32($sp)
     51     beq   $v0, $zero, .Lno_native_code_found
     52     addiu $sp, $sp, 48          # restore the stack
     53     .cfi_adjust_cfa_offset -48
     54     move  $t9, $v0              # put method code result in $t9
     55     jalr  $zero, $t9            # leaf call to method's code
     56     nop
     57 .Lno_native_code_found:
     58     jalr  $zero, $ra
     59     nop
     60 END art_jni_dlsym_lookup_stub
     61