quick_entrypoints_arm.S revision 0791adc2249366c50684935a4c42ba5e58bc3746
10f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes/* 20f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * Copyright (C) 2012 The Android Open Source Project 30f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * 40f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * Licensed under the Apache License, Version 2.0 (the "License"); 50f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * you may not use this file except in compliance with the License. 60f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * You may obtain a copy of the License at 70f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * 80f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * http://www.apache.org/licenses/LICENSE-2.0 90f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * 100f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * Unless required by applicable law or agreed to in writing, software 110f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS, 120f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * See the License for the specific language governing permissions and 140f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes * limitations under the License. 150f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes */ 160f3c55331439970e01af67f80ac117c473bc04cfElliott Hughes 179651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers#include "asm_support.h" 189651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers 19ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers /* Deliver the given exception */ 20ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .extern artDeliverExceptionFromCode 21ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers /* Deliver an exception pending on a thread */ 22ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .extern artDeliverPendingException 23ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers 2457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers /* Cache alignment for function entry */ 2557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.macro ALIGN_FUNCTION_ENTRY 2657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .balign 16 2757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.endm 2857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers 294f0d07c783afef89703dce32c94440fc8621a29bIan Rogers /* 304f0d07c783afef89703dce32c94440fc8621a29bIan Rogers * Macro that sets up the callee save frame to conform with 314f0d07c783afef89703dce32c94440fc8621a29bIan Rogers * Runtime::CreateCalleeSaveMethod(kSaveAll) 324f0d07c783afef89703dce32c94440fc8621a29bIan Rogers */ 3357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.macro SETUP_SAVE_ALL_CALLEE_SAVE_FRAME 344f0d07c783afef89703dce32c94440fc8621a29bIan Rogers push {r4-r11, lr} @ 9 words of callee saves 3515fdb8cfb5b2e3fc882113ec0648d492cebf852cIan Rogers vpush {s0-s31} 364f0d07c783afef89703dce32c94440fc8621a29bIan Rogers sub sp, #12 @ 3 words of space, bottom word will hold Method* 374f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.endm 384f0d07c783afef89703dce32c94440fc8621a29bIan Rogers 394f0d07c783afef89703dce32c94440fc8621a29bIan Rogers /* 404f0d07c783afef89703dce32c94440fc8621a29bIan Rogers * Macro that sets up the callee save frame to conform with 41dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers * Runtime::CreateCalleeSaveMethod(kRefsOnly). Restoration assumes non-moving GC. 424f0d07c783afef89703dce32c94440fc8621a29bIan Rogers */ 434f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.macro SETUP_REF_ONLY_CALLEE_SAVE_FRAME 444f0d07c783afef89703dce32c94440fc8621a29bIan Rogers push {r5-r8, r10-r11, lr} @ 7 words of callee saves 454f0d07c783afef89703dce32c94440fc8621a29bIan Rogers sub sp, #4 @ bottom word will hold Method* 464f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.endm 474f0d07c783afef89703dce32c94440fc8621a29bIan Rogers 484f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.macro RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 49dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers ldr lr, [sp, #28] @ restore lr for return 50dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers add sp, #32 @ unwind stack 514f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.endm 524f0d07c783afef89703dce32c94440fc8621a29bIan Rogers 534f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.macro RESTORE_REF_ONLY_CALLEE_SAVE_FRAME_AND_RETURN 54dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers ldr lr, [sp, #28] @ restore lr for return 55dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers add sp, #32 @ unwind stack 56dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers bx lr @ return 574f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.endm 584f0d07c783afef89703dce32c94440fc8621a29bIan Rogers 594f0d07c783afef89703dce32c94440fc8621a29bIan Rogers /* 604f0d07c783afef89703dce32c94440fc8621a29bIan Rogers * Macro that sets up the callee save frame to conform with 61dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers * Runtime::CreateCalleeSaveMethod(kRefsAndArgs). Restoration assumes non-moving GC. 624f0d07c783afef89703dce32c94440fc8621a29bIan Rogers */ 634f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.macro SETUP_REF_AND_ARGS_CALLEE_SAVE_FRAME 64dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers push {r1-r3, r5-r8, r10-r11, lr} @ 10 words of callee saves 65dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers sub sp, #8 @ 2 words of space, bottom word will hold Method* 664f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.endm 674f0d07c783afef89703dce32c94440fc8621a29bIan Rogers 684f0d07c783afef89703dce32c94440fc8621a29bIan Rogers.macro RESTORE_REF_AND_ARGS_CALLEE_SAVE_FRAME 69dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers ldr r1, [sp, #8] @ restore non-callee save r1 70dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers ldrd r2, [sp, #12] @ restore non-callee saves r2-r3 71dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers ldr lr, [sp, #44] @ restore lr 72dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers add sp, #48 @ rewind sp 7315fdb8cfb5b2e3fc882113ec0648d492cebf852cIan Rogers.endm 7415fdb8cfb5b2e3fc882113ec0648d492cebf852cIan Rogers 75ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers /* 76ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers * Macro that set calls through to artDeliverPendingExceptionFromCode, where the pending 77ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers * exception is Thread::Current()->exception_ 78ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers */ 79ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers.macro DELIVER_PENDING_EXCEPTION 8057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers SETUP_SAVE_ALL_CALLEE_SAVE_FRAME @ save callee saves for throw 81ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r0, r9 @ pass Thread::Current 82ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r1, sp @ pass SP 83ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers b artDeliverPendingExceptionFromCode @ artDeliverPendingExceptionFromCode(Thread*, SP) 84ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers.endm 85ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers 8657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.macro NO_ARG_RUNTIME_EXCEPTION c_name, cxx_name 8757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .global \c_name 8857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .extern \cxx_name 8957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 9057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers\c_name: 9157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers SETUP_SAVE_ALL_CALLEE_SAVE_FRAME // save all registers as basis for long jump context 9257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r0, r9 @ pass Thread::Current 9357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r1, sp @ pass SP 9457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers b \cxx_name @ \cxx_name(Thread*, SP) 9557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.endm 9657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers 9757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.macro ONE_ARG_RUNTIME_EXCEPTION c_name, cxx_name 9857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .global \c_name 9957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .extern \cxx_name 10057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 10157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers\c_name: 10257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers SETUP_SAVE_ALL_CALLEE_SAVE_FRAME // save all registers as basis for long jump context 10357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r1, r9 @ pass Thread::Current 10457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r2, sp @ pass SP 10557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers b \cxx_name @ \cxx_name(Thread*, SP) 10657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.endm 10757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers 10857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.macro TWO_ARG_RUNTIME_EXCEPTION c_name, cxx_name 10957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .global \c_name 11057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .extern \cxx_name 11157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 11257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers\c_name: 11357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers SETUP_SAVE_ALL_CALLEE_SAVE_FRAME // save all registers as basis for long jump context 11457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r2, r9 @ pass Thread::Current 11557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r3, sp @ pass SP 11657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers b \cxx_name @ \cxx_name(Thread*, SP) 11757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers.endm 11857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers 11944b412bb795fa6999129b2bc16f5eec1ea97e8f8buzbee /* 12057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code, saves callee saves and then calls artThrowException 12157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * that will place a mock Method* at the bottom of the stack. Arg1 holds the exception. 12244b412bb795fa6999129b2bc16f5eec1ea97e8f8buzbee */ 12357b86d47b66322693a070185fadfb43cb9c12eabIan RogersONE_ARG_RUNTIME_EXCEPTION art_deliver_exception_from_code, artDeliverExceptionFromCode 12444b412bb795fa6999129b2bc16f5eec1ea97e8f8buzbee 1256f495f2898a418f87e2a919e04fe23521bb0b9e9Brian Carlstrom /* 12657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to create and deliver a NullPointerException. 1276f495f2898a418f87e2a919e04fe23521bb0b9e9Brian Carlstrom */ 12857b86d47b66322693a070185fadfb43cb9c12eabIan RogersNO_ARG_RUNTIME_EXCEPTION art_throw_null_pointer_exception_from_code, artThrowNullPointerExceptionFromCode 1296f495f2898a418f87e2a919e04fe23521bb0b9e9Brian Carlstrom 130bdb0391258abc54bf77c676e36847d28a783bfe5Ian Rogers /* 13157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to create and deliver an ArithmeticException. 132bdb0391258abc54bf77c676e36847d28a783bfe5Ian Rogers */ 13357b86d47b66322693a070185fadfb43cb9c12eabIan RogersNO_ARG_RUNTIME_EXCEPTION art_throw_div_zero_from_code, artThrowDivZeroFromCode 1349651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers 1359651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers /* 13657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to create and deliver an ArrayIndexOutOfBoundsException. Arg1 holds 13757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * index, arg2 holds limit. 1389651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers */ 13957b86d47b66322693a070185fadfb43cb9c12eabIan RogersTWO_ARG_RUNTIME_EXCEPTION art_throw_array_bounds_from_code, artThrowArrayBoundsFromCode 1409651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers 1419651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers /* 14257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to create and deliver a StackOverflowError. 1439651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers */ 14457b86d47b66322693a070185fadfb43cb9c12eabIan RogersNO_ARG_RUNTIME_EXCEPTION art_throw_stack_overflow_from_code, artThrowStackOverflowFromCode 1459651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers 1469651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers /* 14757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to create and deliver a NoSuchMethodError. 1489651f425f7413772a7b5352da2b04eb7de7d416fIan Rogers */ 14957b86d47b66322693a070185fadfb43cb9c12eabIan RogersONE_ARG_RUNTIME_EXCEPTION art_throw_no_such_method_from_code, artThrowNoSuchMethodFromCode 15057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers 15157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers /* 15257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to create and deliver verification errors. Arg1 is kind, arg2 is ref. 15357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers */ 15457b86d47b66322693a070185fadfb43cb9c12eabIan RogersTWO_ARG_RUNTIME_EXCEPTION art_throw_verification_error_from_code, artThrowVerificationErrorFromCode 155c0c8dc8e677957d167066a2d06973126f108a6aaIan Rogers 1564a3164faefd255b1c1e911e7ad7c3d57749caaf6buzbee /* 157c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * All generated callsites for interface invokes and invocation slow paths will load arguments 158c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * as usual - except instead of loading arg0/r0 with the target Method*, arg0/r0 will contain 159c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * the method_idx. This wrapper will save arg1-arg3, load the caller's Method*, align the 160c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * stack and call the appropriate C helper. 161634eb2eb14f87753519d0ef2c5f256e55888f378Elliott Hughes * NOTE: "this" is first visible argument of the target, and so can be found in arg1/r1. 1624a3164faefd255b1c1e911e7ad7c3d57749caaf6buzbee * 163c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * The helper will attempt to locate the target and return a 64-bit result in r0/r1 consisting 164c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * of the target Method* in r0 and method->code_ in r1. 1654a3164faefd255b1c1e911e7ad7c3d57749caaf6buzbee * 166c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * If unsuccessful, the helper will return NULL/NULL. There will bea pending exception in the 167c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers * thread and we branch to another stub to deliver it. 1684a3164faefd255b1c1e911e7ad7c3d57749caaf6buzbee * 169ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers * On success this wrapper will restore arguments and *jump* to the target, leaving the lr 170ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers * pointing back to the original caller. 1714a3164faefd255b1c1e911e7ad7c3d57749caaf6buzbee */ 172c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers.macro INVOKE_TRAMPOLINE c_name, cxx_name 173c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers .global \c_name 174c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers .extern \cxx_name 17557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 176c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers\c_name: 1774f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_AND_ARGS_CALLEE_SAVE_FRAME @ save callee saves in case allocation triggers GC 178c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers ldr r2, [sp, #48] @ pass caller Method* 179c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers mov r3, r9 @ pass Thread::Current 180c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers str sp, [sp, #0] @ pass SP 181c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers bl \cxx_name @ (method_idx, this, caller, Thread*, SP) 182634eb2eb14f87753519d0ef2c5f256e55888f378Elliott Hughes mov r12, r1 @ save Method*->code_ 183a32a6fd4a781262dff4fec102da053d16b7ef6c0Ian Rogers RESTORE_REF_AND_ARGS_CALLEE_SAVE_FRAME 184c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers cmp r0, #0 @ did we find the target? 185c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers bxne r12 @ tail call to target if so 186a32a6fd4a781262dff4fec102da053d16b7ef6c0Ian Rogers DELIVER_PENDING_EXCEPTION 187c8b306f5221658c7e4b5516be8917dc8c9288e7eIan Rogers.endm 188a32a6fd4a781262dff4fec102da053d16b7ef6c0Ian Rogers 189c8b306f5221658c7e4b5516be8917dc8c9288e7eIan RogersINVOKE_TRAMPOLINE art_invoke_interface_trampoline, artInvokeInterfaceTrampoline 190c8b306f5221658c7e4b5516be8917dc8c9288e7eIan RogersINVOKE_TRAMPOLINE art_invoke_interface_trampoline_with_access_check, artInvokeInterfaceTrampolineWithAccessCheck 191a32a6fd4a781262dff4fec102da053d16b7ef6c0Ian Rogers 192c8b306f5221658c7e4b5516be8917dc8c9288e7eIan RogersINVOKE_TRAMPOLINE art_invoke_static_trampoline_with_access_check, artInvokeStaticTrampolineWithAccessCheck 193c8b306f5221658c7e4b5516be8917dc8c9288e7eIan RogersINVOKE_TRAMPOLINE art_invoke_direct_trampoline_with_access_check, artInvokeDirectTrampolineWithAccessCheck 194c8b306f5221658c7e4b5516be8917dc8c9288e7eIan RogersINVOKE_TRAMPOLINE art_invoke_super_trampoline_with_access_check, artInvokeSuperTrampolineWithAccessCheck 195c8b306f5221658c7e4b5516be8917dc8c9288e7eIan RogersINVOKE_TRAMPOLINE art_invoke_virtual_trampoline_with_access_check, artInvokeVirtualTrampolineWithAccessCheck 196ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers 19757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .global art_update_debugger 19857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .extern artUpdateDebuggerFromCode 19957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers /* 20057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * On entry, r0 and r1 must be preserved, r2 is dex PC 20157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers */ 20257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 20357b86d47b66322693a070185fadfb43cb9c12eabIan Rogersart_update_debugger: 20457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r3, r0 @ stash away r0 so that it's saved as if it were an argument 20557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers SETUP_REF_AND_ARGS_CALLEE_SAVE_FRAME 20657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r0, r2 @ arg0 is dex PC 20757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r1, rSELF @ arg1 is Thread* 20857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r2, sp @ arg2 is sp 20957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers bl artUpdateDebuggerFromCode @ artUpdateDebuggerFromCode(int32_t, Thread*, Method**) 21057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers RESTORE_REF_AND_ARGS_CALLEE_SAVE_FRAME 21157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r0, r3 @ restore original r0 21257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers bx lr 21357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers 21457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers .global art_do_long_jump 21557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers /* 21657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * On entry r0 is uint32_t* gprs_ and r1 is uint32_t* fprs_ 21757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers */ 21857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 21957b86d47b66322693a070185fadfb43cb9c12eabIan Rogersart_do_long_jump: 22057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers vldm r1, {s0-s31} @ load all fprs from argument fprs_ 22157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ldr r2, [r0, #60] @ r2 = r15 (PC from gprs_ 60=4*15) 22257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers add r0, r0, #12 @ increment r0 to skip gprs_[0..2] 12=4*3 22357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ldm r0, {r3-r14} @ load remaining gprs from argument gprs_ 22457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r0, #0 @ clear result registers r0 and r1 22557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers mov r1, #0 22657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers bx r2 @ do long jump 22757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers 22860db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers .global art_work_around_app_jni_bugs 22960db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers .extern artWorkAroundAppJniBugs 23060db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers /* 23160db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers * Entry point of native methods when JNI bug compatibility is enabled. 23260db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers */ 23357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 23460db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogersart_work_around_app_jni_bugs: 23560db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers @ save registers that may contain arguments and LR that will be crushed by a call 23660db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers push {r0-r3, lr} 23760db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers sub sp, #12 @ 3 words of space for alignment 23860db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers mov r0, r9 @ pass Thread::Current 23960db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers mov r1, sp @ pass SP 24060db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers bl artWorkAroundAppJniBugs @ (Thread*, SP) 24160db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers add sp, #12 @ rewind stack 24260db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers mov r12, r0 @ save target address 24360db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers pop {r0-r3, lr} @ restore possibly modified argument registers 24460db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers bx r12 @ tail call into JNI routine 24560db5ab3a2e480db9236325a14cb5a867881d8bbIan Rogers 246ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .global art_handle_fill_data_from_code 247ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .extern artHandleFillArrayDataFromCode 248ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers /* 249ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers * Entry from managed code that calls artHandleFillArrayDataFromCode and delivers exception on 250ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers * failure. 251ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers */ 25257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 253ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogersart_handle_fill_data_from_code: 2544f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case exception allocation triggers GC 2554f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r2, r9 @ pass Thread::Current 2564f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r3, sp @ pass SP 2574f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artHandleFillArrayDataFromCode @ (Array* array, const uint16_t* table, Thread*, SP) 2584f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 2594f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ success? 260ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 261ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 2624f0d07c783afef89703dce32c94440fc8621a29bIan Rogers 2634f0d07c783afef89703dce32c94440fc8621a29bIan Rogers .global art_lock_object_from_code 2644f0d07c783afef89703dce32c94440fc8621a29bIan Rogers .extern artLockObjectFromCode 2654f0d07c783afef89703dce32c94440fc8621a29bIan Rogers /* 26657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Entry from managed code that calls artLockObjectFromCode, may block for GC. 2674f0d07c783afef89703dce32c94440fc8621a29bIan Rogers */ 26857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 2694f0d07c783afef89703dce32c94440fc8621a29bIan Rogersart_lock_object_from_code: 2704f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case we block 2714f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r1, r9 @ pass Thread::Current 2724f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r2, sp @ pass SP 2734f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artLockObjectFromCode @ (Object* obj, Thread*, SP) 2744f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME_AND_RETURN 275ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers 276ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .global art_unlock_object_from_code 277ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .extern artUnlockObjectFromCode 278ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers /* 279ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers * Entry from managed code that calls artUnlockObjectFromCode and delivers exception on failure. 280ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers */ 28157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 282ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogersart_unlock_object_from_code: 2834f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case exception allocation triggers GC 2844f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r1, r9 @ pass Thread::Current 2854f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r2, sp @ pass SP 2864f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artUnlockObjectFromCode @ (Object* obj, Thread*, SP) 2874f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 2884f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ success? 289ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 290ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 291ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers 292ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .global art_check_cast_from_code 293ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers .extern artCheckCastFromCode 294ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers /* 295ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers * Entry from managed code that calls artCheckCastFromCode and delivers exception on failure. 296ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogers */ 29757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 298ff1ed4770bf7ff024a807b9f909b1a26abb78341Ian Rogersart_check_cast_from_code: 2994f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case exception allocation triggers GC 3004f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r2, r9 @ pass Thread::Current 3014f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r3, sp @ pass SP 3024f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artCheckCastFromCode @ (Class* a, Class* b, Thread*, SP) 3034f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 3044f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ success? 305ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 306ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 307e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogers 308e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogers .global art_can_put_array_element_from_code 309e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogers .extern artCanPutArrayElementFromCode 310e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogers /* 311e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogers * Entry from managed code that calls artCanPutArrayElementFromCode and delivers exception on 312e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogers * failure. 313e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogers */ 31457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 315e51a511ccee3f3c0120807321bcc160fcaa664beIan Rogersart_can_put_array_element_from_code: 3164f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ return if element == NULL 317ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr 3184f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case exception allocation triggers GC 3194f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r2, r9 @ pass Thread::Current 3204f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r3, sp @ pass SP 3214f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artCanPutArrayElementFromCode @ (Object* element, Class* array_class, Thread*, SP) 3224f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 3234f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ success? 324ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 325ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 326cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogers 327cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogers .global art_initialize_static_storage_from_code 3284f0d07c783afef89703dce32c94440fc8621a29bIan Rogers .extern artInitializeStaticStorageFromCode 329cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogers /* 330cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogers * Entry from managed code when uninitialized static storage, this stub will run the class 331cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogers * initializer and deliver the exception on error. On success the static storage base is 332cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogers * returned. 333cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogers */ 33457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 335cbba6ac9bf9a6c630a7aafae6d8767b5ddbb6fd5Ian Rogersart_initialize_static_storage_from_code: 3364f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 3374f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r2, r9 @ pass Thread::Current 3384f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r3, sp @ pass SP 339aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom @ artInitializeStaticStorageFromCode(uint32_t type_idx, Method* referrer, Thread*, SP) 3404f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artInitializeStaticStorageFromCode 3414f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 3424f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ success if result is non-null 343ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxne lr @ return on success 344ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 345ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers 34628ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers .global art_initialize_type_from_code 34728ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers .extern artInitializeTypeFromCode 34828ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers /* 34928ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers * Entry from managed code when dex cache misses for a type_idx 35028ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers */ 35157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 35228ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogersart_initialize_type_from_code: 35328ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 35428ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers mov r2, r9 @ pass Thread::Current 35528ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers mov r3, sp @ pass SP 35628ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers @ artInitializeTypeFromCode(uint32_t type_idx, Method* referrer, Thread*, SP) 35728ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers bl artInitializeTypeFromCode 35828ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 359b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers cmp r0, #0 @ success if result is non-null 360b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers bxne lr @ return on success 361b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers DELIVER_PENDING_EXCEPTION 362b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers 363b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers .global art_initialize_type_and_verify_access_from_code 364b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers .extern artInitializeTypeAndVerifyAccessFromCode 365b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers /* 366b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers * Entry from managed code when type_idx needs to be checked for access and dex cache may also 36757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * miss. 368b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers */ 36957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 370b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogersart_initialize_type_and_verify_access_from_code: 371b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 372b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers mov r2, r9 @ pass Thread::Current 373b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers mov r3, sp @ pass SP 374b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers @ artInitializeTypeFromCode(uint32_t type_idx, Method* referrer, Thread*, SP) 375b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers bl artInitializeTypeAndVerifyAccessFromCode 376b093c6b27f8ea9bbe2d49c03ebe345203a121199Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 37728ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers cmp r0, #0 @ success if result is non-null 37828ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers bxne lr @ return on success 37928ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers DELIVER_PENDING_EXCEPTION 38028ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers 381ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .global art_get32_static_from_code 382ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .extern artGet32StaticFromCode 383ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers /* 38457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve a static field and load a 32-bit primitive value. 385ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers */ 38657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 387ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogersart_get32_static_from_code: 388ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 3891bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r1, [sp, #32] @ pass referrer 390ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r2, r9 @ pass Thread::Current 391ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r3, sp @ pass SP 392ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers bl artGet32StaticFromCode @ (uint32_t field_idx, const Method* referrer, Thread*, SP) 393ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers ldr r12, [r9, #THREAD_EXCEPTION_OFFSET] @ load Thread::Current()->exception_ 394ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 395ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers cmp r12, #0 @ success if no exception is pending 396ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 397ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 398ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers 399ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .global art_get64_static_from_code 400ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .extern artGet64StaticFromCode 401ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers /* 40257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve a static field and load a 64-bit primitive value. 403ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers */ 40457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 405ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogersart_get64_static_from_code: 406ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 4071bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r1, [sp, #32] @ pass referrer 408ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r2, r9 @ pass Thread::Current 409ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r3, sp @ pass SP 410ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers bl artGet64StaticFromCode @ (uint32_t field_idx, const Method* referrer, Thread*, SP) 411ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers ldr r12, [r9, #THREAD_EXCEPTION_OFFSET] @ load Thread::Current()->exception_ 412ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 413ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers cmp r12, #0 @ success if no exception is pending 414ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 415ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 416ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers 417ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .global art_get_obj_static_from_code 418ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .extern artGetObjStaticFromCode 419ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers /* 42057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve a static field and load an object reference. 421ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers */ 42257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 423ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogersart_get_obj_static_from_code: 424ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 4251bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r1, [sp, #32] @ pass referrer 426ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r2, r9 @ pass Thread::Current 427ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r3, sp @ pass SP 428ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers bl artGetObjStaticFromCode @ (uint32_t field_idx, const Method* referrer, Thread*, SP) 429ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers ldr r12, [r9, #THREAD_EXCEPTION_OFFSET] @ load Thread::Current()->exception_ 430ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 431ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers cmp r12, #0 @ success if no exception is pending 432ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 433ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 434ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers 4351bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .global art_get32_instance_from_code 4361bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .extern artGet32InstanceFromCode 4371bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers /* 43857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve an instance field and load a 32-bit primitive value. 4391bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers */ 44057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 4411bddec3a6521f16df37499754000a3b1787a52e9Ian Rogersart_get32_instance_from_code: 4421bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 4431bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r2, [sp, #32] @ pass referrer 4441bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers mov r3, r9 @ pass Thread::Current 4451bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers str sp, [sp, #0] @ pass SP 4461bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artGet32InstanceFromCode @ (field_idx, Object*, referrer, Thread*, SP) 4471bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r12, [r9, #THREAD_EXCEPTION_OFFSET] @ load Thread::Current()->exception_ 4481bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 4491bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers cmp r12, #0 @ success if no exception is pending 4501bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bxeq lr @ return on success 4511bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers DELIVER_PENDING_EXCEPTION 4521bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers 4531bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .global art_get64_instance_from_code 4541bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .extern artGet64InstanceFromCode 4551bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers /* 45657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve an instance field and load a 64-bit primitive value. 4571bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers */ 45857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 4591bddec3a6521f16df37499754000a3b1787a52e9Ian Rogersart_get64_instance_from_code: 4601bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 4611bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r2, [sp, #32] @ pass referrer 4621bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers mov r3, r9 @ pass Thread::Current 4631bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers str sp, [sp, #0] @ pass SP 4641bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artGet64InstanceFromCode @ (field_idx, Object*, referrer, Thread*, SP) 4651bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r12, [r9, #THREAD_EXCEPTION_OFFSET] @ load Thread::Current()->exception_ 4661bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 4671bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers cmp r12, #0 @ success if no exception is pending 4681bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bxeq lr @ return on success 4691bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers DELIVER_PENDING_EXCEPTION 4701bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers 4711bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .global art_get_obj_instance_from_code 4721bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .extern artGetObjInstanceFromCode 4731bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers /* 47457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve an instance field and load an object reference. 4751bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers */ 47657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 4771bddec3a6521f16df37499754000a3b1787a52e9Ian Rogersart_get_obj_instance_from_code: 4781bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 4791bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r2, [sp, #32] @ pass referrer 4801bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers mov r3, r9 @ pass Thread::Current 4811bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers str sp, [sp, #0] @ pass SP 4821bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artGetObjInstanceFromCode @ (field_idx, Object*, referrer, Thread*, SP) 4831bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r12, [r9, #THREAD_EXCEPTION_OFFSET] @ load Thread::Current()->exception_ 4841bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 4851bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers cmp r12, #0 @ success if no exception is pending 4861bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bxeq lr @ return on success 4871bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers DELIVER_PENDING_EXCEPTION 4881bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers 489ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .global art_set32_static_from_code 490ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .extern artSet32StaticFromCode 491ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers /* 49257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve a static field and store a 32-bit primitive value. 493ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers */ 49457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 495ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogersart_set32_static_from_code: 496ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 4971bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r2, [sp, #32] @ pass referrer 498ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r3, r9 @ pass Thread::Current 499ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers str sp, [sp, #0] @ pass SP 5001bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artSet32StaticFromCode @ (field_idx, new_val, referrer, Thread*, SP) 501ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 502ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers cmp r0, #0 @ success if result is 0 503ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 504ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 505ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers 506ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .global art_set64_static_from_code 50719abfb4f9af450e2ce3a801c5a0c34c4193e3e57Brian Carlstrom .extern artSet64StaticFromCode 508ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers /* 50957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve a static field and store a 64-bit primitive value. 51019abfb4f9af450e2ce3a801c5a0c34c4193e3e57Brian Carlstrom * On entry r0 holds field index, r1:r2 hold new_val 511ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers */ 51257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 513ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogersart_set64_static_from_code: 514ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 51519abfb4f9af450e2ce3a801c5a0c34c4193e3e57Brian Carlstrom mov r3, r2 @ pass one half of wide argument 51619abfb4f9af450e2ce3a801c5a0c34c4193e3e57Brian Carlstrom mov r2, r1 @ pass other half of wide argument 5171bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r1, [sp, #32] @ pass referrer 518ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r12, sp @ save SP 519ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers sub sp, #8 @ grow frame for alignment with stack args 520ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers push {r9, r12} @ pass Thread::Current and SP 521ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers bl artSet64StaticFromCode @ (field_idx, referrer, new_val, Thread*, SP) 522ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers add sp, #16 @ release out args 523ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME @ TODO: we can clearly save an add here 524ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers cmp r0, #0 @ success if result is 0 525ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 526ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 527ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers 528ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .global art_set_obj_static_from_code 529ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers .extern artSetObjStaticFromCode 530ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers /* 53157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve a static field and store an object reference. 532ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers */ 53357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 534ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogersart_set_obj_static_from_code: 535ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 5361bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r2, [sp, #32] @ pass referrer 537ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers mov r3, r9 @ pass Thread::Current 538ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers str sp, [sp, #0] @ pass SP 5391bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artSetObjStaticFromCode @ (field_idx, new_val, referrer, Thread*, SP) 540ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 541ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers cmp r0, #0 @ success if result is 0 5421bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bxeq lr @ return on success 5431bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers DELIVER_PENDING_EXCEPTION 5441bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers 5451bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .global art_set32_instance_from_code 5461bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .extern artSet32InstanceFromCode 5471bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers /* 54857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve an instance field and store a 32-bit primitive value. 5491bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers */ 55057b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 5511bddec3a6521f16df37499754000a3b1787a52e9Ian Rogersart_set32_instance_from_code: 5521bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 5531bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r3, [sp, #32] @ pass referrer 5541bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers mov r12, sp @ save SP 5551bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers sub sp, #8 @ grow frame for alignment with stack args 5561bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers push {r9, r12} @ pass Thread::Current and SP 5571bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artSet32InstanceFromCode @ (field_idx, Object*, new_val, referrer, Thread*, SP) 5581bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers add sp, #16 @ release out args 5591bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME @ TODO: we can clearly save an add here 5601bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers cmp r0, #0 @ success if result is 0 5611bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bxeq lr @ return on success 5621bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers DELIVER_PENDING_EXCEPTION 5631bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers 5641bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .global art_set64_instance_from_code 5651bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .extern artSet32InstanceFromCode 5661bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers /* 56757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve an instance field and store a 64-bit primitive value. 5681bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers */ 56957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 5701bddec3a6521f16df37499754000a3b1787a52e9Ian Rogersart_set64_instance_from_code: 5711bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 5721bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers mov r12, sp @ save SP 5731bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers sub sp, #8 @ grow frame for alignment with stack args 5741bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers push {r9, r12} @ pass Thread::Current and SP 5751bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artSet64InstanceFromCode @ (field_idx, Object*, new_val, Thread*, SP) 5761bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers add sp, #16 @ release out args 5771bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME @ TODO: we can clearly save an add here 5781bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers cmp r0, #0 @ success if result is 0 5791bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bxeq lr @ return on success 5801bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers DELIVER_PENDING_EXCEPTION 5811bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers 5821bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .global art_set_obj_instance_from_code 5831bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers .extern artSetObjInstanceFromCode 5841bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers /* 58557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to resolve an instance field and store an object reference. 5861bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers */ 58757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 5881bddec3a6521f16df37499754000a3b1787a52e9Ian Rogersart_set_obj_instance_from_code: 5891bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 5901bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers ldr r3, [sp, #32] @ pass referrer 5911bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers mov r12, sp @ save SP 5921bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers sub sp, #8 @ grow frame for alignment with stack args 5931bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers push {r9, r12} @ pass Thread::Current and SP 5941bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers bl artSetObjInstanceFromCode @ (field_idx, Object*, new_val, referrer, Thread*, SP) 5951bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers add sp, #16 @ release out args 5961bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME @ TODO: we can clearly save an add here 5971bddec3a6521f16df37499754000a3b1787a52e9Ian Rogers cmp r0, #0 @ success if result is 0 598ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxeq lr @ return on success 599ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 6004a3164faefd255b1c1e911e7ad7c3d57749caaf6buzbee 601aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom .global art_resolve_string_from_code 602aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom .extern artResolveStringFromCode 603aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom /* 604caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers * Entry from managed code to resolve a string, this stub will allocate a String and deliver an 605caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers * exception on error. On success the String is returned. R0 holds the referring method, 606caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers * R1 holds the string index. The fast path check for hit in strings cache has already been 607caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers * performed. 608aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom */ 60957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 6106f495f2898a418f87e2a919e04fe23521bb0b9e9Brian Carlstromart_resolve_string_from_code: 611caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 612caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers mov r2, r9 @ pass Thread::Current 613caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers mov r3, sp @ pass SP 614caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers @ artResolveStringFromCode(Method* referrer, uint32_t string_idx, Thread*, SP) 615aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom bl artResolveStringFromCode 616aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 617caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers cmp r0, #0 @ success if result is non-null 618caab8c4ef372db5c119bfac1911fa27b174a935cIan Rogers bxne lr @ return on success 619aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom DELIVER_PENDING_EXCEPTION 620aded5f7ab991f3c1132851599d3bc60ff6707eedBrian Carlstrom 62121d9e8323124a832a21679ca83808bc9c68ed365Ian Rogers .global art_alloc_object_from_code 62221d9e8323124a832a21679ca83808bc9c68ed365Ian Rogers .extern artAllocObjectFromCode 62321d9e8323124a832a21679ca83808bc9c68ed365Ian Rogers /* 62421d9e8323124a832a21679ca83808bc9c68ed365Ian Rogers * Called by managed code to allocate an object 62521d9e8323124a832a21679ca83808bc9c68ed365Ian Rogers */ 62657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 62721d9e8323124a832a21679ca83808bc9c68ed365Ian Rogersart_alloc_object_from_code: 6284f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 6294f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r2, r9 @ pass Thread::Current 6304f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r3, sp @ pass SP 6314f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artAllocObjectFromCode @ (uint32_t type_idx, Method* method, Thread*, SP) 6324f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 6334f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ success if result is non-null 634ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxne lr @ return on success 635ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 63621d9e8323124a832a21679ca83808bc9c68ed365Ian Rogers 63728ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers .global art_alloc_object_from_code_with_access_check 63828ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers .extern artAllocObjectFromCodeWithAccessCheck 639cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee /* 64028ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers * Called by managed code to allocate an object when the caller doesn't know whether it has 64157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * access to the created type. 642cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee */ 64357b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 64428ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogersart_alloc_object_from_code_with_access_check: 645cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 646cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee mov r2, r9 @ pass Thread::Current 647cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee mov r3, sp @ pass SP 64828ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5dIan Rogers bl artAllocObjectFromCodeWithAccessCheck @ (uint32_t type_idx, Method* method, Thread*, SP) 649cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 650cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee cmp r0, #0 @ success if result is non-null 651cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee bxne lr @ return on success 652cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee DELIVER_PENDING_EXCEPTION 653cc4540ece917ef4b5c81ee684e3294e47e49ff5bbuzbee 654b408de744566a5c5a80be1ba7f5c88407e816945Elliott Hughes .global art_alloc_array_from_code 655b408de744566a5c5a80be1ba7f5c88407e816945Elliott Hughes .extern artAllocArrayFromCode 656b886da8e3c26443ab4d2aa63268bd673c354c3d2Ian Rogers /* 65757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to allocate an array. 658b886da8e3c26443ab4d2aa63268bd673c354c3d2Ian Rogers */ 65957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 660b408de744566a5c5a80be1ba7f5c88407e816945Elliott Hughesart_alloc_array_from_code: 6614f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 6624f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r3, r9 @ pass Thread::Current 6634f0d07c783afef89703dce32c94440fc8621a29bIan Rogers str sp, [sp, #0] @ pass SP 6644f0d07c783afef89703dce32c94440fc8621a29bIan Rogers @ artAllocArrayFromCode(uint32_t type_idx, Method* method, int32_t component_count, Thread*, SP) 6654f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artAllocArrayFromCode 6664f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 6674f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ success if result is non-null 668ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxne lr @ return on success 669ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 670b886da8e3c26443ab4d2aa63268bd673c354c3d2Ian Rogers 6710eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers .global art_alloc_array_from_code_with_access_check 6720eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers .extern artAllocArrayFromCodeWithAccessCheck 6730eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers /* 6740eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers * Called by managed code to allocate an array when the caller doesn't know whether it has 67557b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * access to the created type. 6760eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers */ 67757b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 6780eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogersart_alloc_array_from_code_with_access_check: 6790eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 6800eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers mov r3, r9 @ pass Thread::Current 6810eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers str sp, [sp, #0] @ pass SP 6820eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers @ artAllocArrayFromCodeWithAccessCheck(type_idx, method, component_count, Thread*, SP) 6830eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers bl artAllocArrayFromCodeWithAccessCheck 6840eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 6850eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers cmp r0, #0 @ success if result is non-null 6860eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers bxne lr @ return on success 6870eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers DELIVER_PENDING_EXCEPTION 6880eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers 689b408de744566a5c5a80be1ba7f5c88407e816945Elliott Hughes .global art_check_and_alloc_array_from_code 690b408de744566a5c5a80be1ba7f5c88407e816945Elliott Hughes .extern artCheckAndAllocArrayFromCode 691b886da8e3c26443ab4d2aa63268bd673c354c3d2Ian Rogers /* 69257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to allocate an array in a special case for FILLED_NEW_ARRAY. 693b886da8e3c26443ab4d2aa63268bd673c354c3d2Ian Rogers */ 69457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 695b408de744566a5c5a80be1ba7f5c88407e816945Elliott Hughesart_check_and_alloc_array_from_code: 6964f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 6974f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r3, r9 @ pass Thread::Current 6984f0d07c783afef89703dce32c94440fc8621a29bIan Rogers str sp, [sp, #0] @ pass SP 6994f0d07c783afef89703dce32c94440fc8621a29bIan Rogers @ artCheckAndAllocArrayFromCode(uint32_t type_idx, Method* method, int32_t count, Thread* , SP) 7004f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bl artCheckAndAllocArrayFromCode 7014f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 702ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers cmp r0, #0 @ success if result is non-null 703ae67599981e17cdfd51418c35e56e2a7c5ef4c72Ian Rogers bxne lr @ return on success 704ce9eca6de042f26e9eebc41c9bee8b4d14f753aaIan Rogers DELIVER_PENDING_EXCEPTION 705b886da8e3c26443ab4d2aa63268bd673c354c3d2Ian Rogers 7060eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers .global art_check_and_alloc_array_from_code_with_access_check 7070eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers .extern artCheckAndAllocArrayFromCodeWithAccessCheck 7080eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers /* 70957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code to allocate an array in a special case for FILLED_NEW_ARRAY. 7100eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers */ 71157b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 7120eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogersart_check_and_alloc_array_from_code_with_access_check: 7130eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves in case of GC 7140eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers mov r3, r9 @ pass Thread::Current 7150eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers str sp, [sp, #0] @ pass SP 7160eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers @ artCheckAndAllocArrayFromCodeWithAccessCheck(type_idx, method, count, Thread* , SP) 7170eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers bl artCheckAndAllocArrayFromCodeWithAccessCheck 7180eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME 7190eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers cmp r0, #0 @ success if result is non-null 7200eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers bxne lr @ return on success 7210eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers DELIVER_PENDING_EXCEPTION 7220eb7d7e2a0c2767b5fd86bd52436c618fd4c3120Ian Rogers 7234f0d07c783afef89703dce32c94440fc8621a29bIan Rogers .global art_test_suspend 7244a510d8750d50b77353d0a5a891d1b9b3a48ecd5Ian Rogers .extern artTestSuspendFromCode 725dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers /* 72657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * Called by managed code when the value in rSUSPEND has been decremented to 0. 727dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers */ 72857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 7294f0d07c783afef89703dce32c94440fc8621a29bIan Rogersart_test_suspend: 7304f0d07c783afef89703dce32c94440fc8621a29bIan Rogers ldr r0, [rSELF, #THREAD_SUSPEND_COUNT_OFFSET] 7314f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov rSUSPEND, #SUSPEND_CHECK_INTERVAL @ reset rSUSPEND to SUSPEND_CHECK_INTERVAL 7324f0d07c783afef89703dce32c94440fc8621a29bIan Rogers cmp r0, #0 @ check Thread::Current()->suspend_count_ == 0 7334f0d07c783afef89703dce32c94440fc8621a29bIan Rogers bxeq rLR @ return if suspend_count_ == 0 7344f0d07c783afef89703dce32c94440fc8621a29bIan Rogers mov r0, rSELF 7354f0d07c783afef89703dce32c94440fc8621a29bIan Rogers SETUP_REF_ONLY_CALLEE_SAVE_FRAME @ save callee saves for stack crawl 736c10717a0b86d5719556ac3286fcb47aa2f2416fcbuzbee mov r1, sp 7374a510d8750d50b77353d0a5a891d1b9b3a48ecd5Ian Rogers bl artTestSuspendFromCode @ (Thread*, SP) 7384f0d07c783afef89703dce32c94440fc8621a29bIan Rogers RESTORE_REF_ONLY_CALLEE_SAVE_FRAME_AND_RETURN 7394f0d07c783afef89703dce32c94440fc8621a29bIan Rogers 740dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers .global art_proxy_invoke_handler 741dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers .extern artProxyInvokeHandler 742dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers /* 743dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers * Called by managed code that is attempting to call a method on a proxy class. On entry 74457b86d47b66322693a070185fadfb43cb9c12eabIan Rogers * r0 holds the proxy method; r1, r2 and r3 may contain arguments. 745dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers */ 74657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 747dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogersart_proxy_invoke_handler: 748dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers SETUP_REF_AND_ARGS_CALLEE_SAVE_FRAME 749dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers str r0, [sp, #0] @ place proxy method at bottom of frame 750dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers mov r2, r9 @ pass Thread::Current 751dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers add r3, sp, #12 @ pointer to r2/r3/LR/caller's Method**/out-args as second arg 752dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers blx artProxyInvokeHandler @ (Method* proxy method, receiver, Thread*, args...) 753dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers ldr r12, [r9, #THREAD_EXCEPTION_OFFSET] @ load Thread::Current()->exception_ 754466bb25416b88fabd5d4387b7c7e5cc1ece78b8cIan Rogers ldr lr, [sp, #44] @ restore lr 755466bb25416b88fabd5d4387b7c7e5cc1ece78b8cIan Rogers ldrd r0, [sp, #12] @ load r0/r1 from r2/r3 that were overwritten with the out args 756466bb25416b88fabd5d4387b7c7e5cc1ece78b8cIan Rogers add sp, #48 @ pop frame 757dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers cmp r12, #0 @ success if no exception is pending 758dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers bxeq lr @ return on success 759dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers DELIVER_PENDING_EXCEPTION 760dfcdf1a0d2d8d75b4c701317e4a092498a8d1e9eIan Rogers 761e343b76af81a005ef64f5e75a555389fd9147dabjeffhao .global art_trace_entry_from_code 7620791adc2249366c50684935a4c42ba5e58bc3746jeffhao .global art_trace_exit_from_code 763e343b76af81a005ef64f5e75a555389fd9147dabjeffhao .extern artTraceMethodEntryFromCode 7640791adc2249366c50684935a4c42ba5e58bc3746jeffhao .extern artTraceMethodExitFromCode 765e343b76af81a005ef64f5e75a555389fd9147dabjeffhao /* 7660791adc2249366c50684935a4c42ba5e58bc3746jeffhao * Routine that intercepts method calls and returns. 767e343b76af81a005ef64f5e75a555389fd9147dabjeffhao */ 76857b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 769e343b76af81a005ef64f5e75a555389fd9147dabjeffhaoart_trace_entry_from_code: 770e343b76af81a005ef64f5e75a555389fd9147dabjeffhao push {r0-r3} @ save arguments (4 words) 771e343b76af81a005ef64f5e75a555389fd9147dabjeffhao mov r1, r9 @ pass Thread::Current 772e343b76af81a005ef64f5e75a555389fd9147dabjeffhao mov r2, lr @ pass LR 773e343b76af81a005ef64f5e75a555389fd9147dabjeffhao blx artTraceMethodEntryFromCode @ (Method*, Thread*, LR) 774e343b76af81a005ef64f5e75a555389fd9147dabjeffhao mov r12, r0 @ r12 holds reference to code 775e343b76af81a005ef64f5e75a555389fd9147dabjeffhao pop {r0-r3} @ restore arguments 776e343b76af81a005ef64f5e75a555389fd9147dabjeffhao blx r12 @ call method 777e343b76af81a005ef64f5e75a555389fd9147dabjeffhaoart_trace_exit_from_code: 778e343b76af81a005ef64f5e75a555389fd9147dabjeffhao push {r0-r1} @ save return value 779e343b76af81a005ef64f5e75a555389fd9147dabjeffhao blx artTraceMethodExitFromCode @ () 780e343b76af81a005ef64f5e75a555389fd9147dabjeffhao mov lr, r0 @ restore link register 781e343b76af81a005ef64f5e75a555389fd9147dabjeffhao pop {r0, r1} @ restore return value 782e343b76af81a005ef64f5e75a555389fd9147dabjeffhao bx lr @ return 783e343b76af81a005ef64f5e75a555389fd9147dabjeffhao 7845433072f589b61413e042eddf76e8190a048f71dbuzbee .global art_shl_long 7855433072f589b61413e042eddf76e8190a048f71dbuzbee /* 7865433072f589b61413e042eddf76e8190a048f71dbuzbee * Long integer shift. This is different from the generic 32/64-bit 7875433072f589b61413e042eddf76e8190a048f71dbuzbee * binary operations because vAA/vBB are 64-bit but vCC (the shift 7885433072f589b61413e042eddf76e8190a048f71dbuzbee * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low 7895433072f589b61413e042eddf76e8190a048f71dbuzbee * 6 bits. 7905433072f589b61413e042eddf76e8190a048f71dbuzbee * On entry: 7915433072f589b61413e042eddf76e8190a048f71dbuzbee * r0: low word 7925433072f589b61413e042eddf76e8190a048f71dbuzbee * r1: high word 7935433072f589b61413e042eddf76e8190a048f71dbuzbee * r2: shift count 7945433072f589b61413e042eddf76e8190a048f71dbuzbee */ 7955433072f589b61413e042eddf76e8190a048f71dbuzbee /* shl-long vAA, vBB, vCC */ 79657b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 79757b86d47b66322693a070185fadfb43cb9c12eabIan Rogersart_shl_long: 7985433072f589b61413e042eddf76e8190a048f71dbuzbee and r2, r2, #63 @ r2<- r2 & 0x3f 7995433072f589b61413e042eddf76e8190a048f71dbuzbee mov r1, r1, asl r2 @ r1<- r1 << r2 8005433072f589b61413e042eddf76e8190a048f71dbuzbee rsb r3, r2, #32 @ r3<- 32 - r2 8015433072f589b61413e042eddf76e8190a048f71dbuzbee orr r1, r1, r0, lsr r3 @ r1<- r1 | (r0 << (32-r2)) 8025433072f589b61413e042eddf76e8190a048f71dbuzbee subs ip, r2, #32 @ ip<- r2 - 32 8035433072f589b61413e042eddf76e8190a048f71dbuzbee movpl r1, r0, asl ip @ if r2 >= 32, r1<- r0 << (r2-32) 8045433072f589b61413e042eddf76e8190a048f71dbuzbee mov r0, r0, asl r2 @ r0<- r0 << r2 8055433072f589b61413e042eddf76e8190a048f71dbuzbee bx lr 8065433072f589b61413e042eddf76e8190a048f71dbuzbee 8075433072f589b61413e042eddf76e8190a048f71dbuzbee .global art_shr_long 8085433072f589b61413e042eddf76e8190a048f71dbuzbee /* 8095433072f589b61413e042eddf76e8190a048f71dbuzbee * Long integer shift. This is different from the generic 32/64-bit 8105433072f589b61413e042eddf76e8190a048f71dbuzbee * binary operations because vAA/vBB are 64-bit but vCC (the shift 8115433072f589b61413e042eddf76e8190a048f71dbuzbee * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low 8125433072f589b61413e042eddf76e8190a048f71dbuzbee * 6 bits. 8135433072f589b61413e042eddf76e8190a048f71dbuzbee * On entry: 8145433072f589b61413e042eddf76e8190a048f71dbuzbee * r0: low word 8155433072f589b61413e042eddf76e8190a048f71dbuzbee * r1: high word 8165433072f589b61413e042eddf76e8190a048f71dbuzbee * r2: shift count 8175433072f589b61413e042eddf76e8190a048f71dbuzbee */ 8185433072f589b61413e042eddf76e8190a048f71dbuzbee /* shr-long vAA, vBB, vCC */ 81957b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 82057b86d47b66322693a070185fadfb43cb9c12eabIan Rogersart_shr_long: 8215433072f589b61413e042eddf76e8190a048f71dbuzbee and r2, r2, #63 @ r0<- r0 & 0x3f 8225433072f589b61413e042eddf76e8190a048f71dbuzbee mov r0, r0, lsr r2 @ r0<- r2 >> r2 8235433072f589b61413e042eddf76e8190a048f71dbuzbee rsb r3, r2, #32 @ r3<- 32 - r2 8245433072f589b61413e042eddf76e8190a048f71dbuzbee orr r0, r0, r1, asl r3 @ r0<- r0 | (r1 << (32-r2)) 8255433072f589b61413e042eddf76e8190a048f71dbuzbee subs ip, r2, #32 @ ip<- r2 - 32 8265433072f589b61413e042eddf76e8190a048f71dbuzbee movpl r0, r1, asr ip @ if r2 >= 32, r0<-r1 >> (r2-32) 8275433072f589b61413e042eddf76e8190a048f71dbuzbee mov r1, r1, asr r2 @ r1<- r1 >> r2 8285433072f589b61413e042eddf76e8190a048f71dbuzbee bx lr 8295433072f589b61413e042eddf76e8190a048f71dbuzbee 8305433072f589b61413e042eddf76e8190a048f71dbuzbee .global art_ushr_long 8315433072f589b61413e042eddf76e8190a048f71dbuzbee /* 8325433072f589b61413e042eddf76e8190a048f71dbuzbee * Long integer shift. This is different from the generic 32/64-bit 8335433072f589b61413e042eddf76e8190a048f71dbuzbee * binary operations because vAA/vBB are 64-bit but vCC (the shift 8345433072f589b61413e042eddf76e8190a048f71dbuzbee * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low 8355433072f589b61413e042eddf76e8190a048f71dbuzbee * 6 bits. 8365433072f589b61413e042eddf76e8190a048f71dbuzbee * On entry: 8375433072f589b61413e042eddf76e8190a048f71dbuzbee * r0: low word 8385433072f589b61413e042eddf76e8190a048f71dbuzbee * r1: high word 8395433072f589b61413e042eddf76e8190a048f71dbuzbee * r2: shift count 8405433072f589b61413e042eddf76e8190a048f71dbuzbee */ 8415433072f589b61413e042eddf76e8190a048f71dbuzbee /* ushr-long vAA, vBB, vCC */ 84257b86d47b66322693a070185fadfb43cb9c12eabIan Rogers ALIGN_FUNCTION_ENTRY 84357b86d47b66322693a070185fadfb43cb9c12eabIan Rogersart_ushr_long: 8445433072f589b61413e042eddf76e8190a048f71dbuzbee and r2, r2, #63 @ r0<- r0 & 0x3f 8455433072f589b61413e042eddf76e8190a048f71dbuzbee mov r0, r0, lsr r2 @ r0<- r2 >> r2 8465433072f589b61413e042eddf76e8190a048f71dbuzbee rsb r3, r2, #32 @ r3<- 32 - r2 8475433072f589b61413e042eddf76e8190a048f71dbuzbee orr r0, r0, r1, asl r3 @ r0<- r0 | (r1 << (32-r2)) 8485433072f589b61413e042eddf76e8190a048f71dbuzbee subs ip, r2, #32 @ ip<- r2 - 32 8495433072f589b61413e042eddf76e8190a048f71dbuzbee movpl r0, r1, lsr ip @ if r2 >= 32, r0<-r1 >>> (r2-32) 8505433072f589b61413e042eddf76e8190a048f71dbuzbee mov r1, r1, lsr r2 @ r1<- r1 >>> r2 8515433072f589b61413e042eddf76e8190a048f71dbuzbee bx lr 852fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 853fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee .balign 4 854fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee .global art_indexof 855fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeart_indexof: 856fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* 857fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * String's indexOf. 858fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * 859fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * On entry: 860fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r0: string object (known non-null) 861fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r1: char to match 862fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r2: Starting offset in string data 863fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee */ 864fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 865fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee push {r4, r10-r11, lr} @ 4 words of callee saves 866fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r3, [r0, #STRING_COUNT_OFFSET] 867fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r12, [r0, #STRING_OFFSET_OFFSET] 868fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r0, [r0, #STRING_VALUE_OFFSET] 869fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 870fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* Clamp start to [0..count] */ 871fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r2, #0 872fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee movlt r2, #0 873fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r2, r3 874fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee movgt r2, r3 875fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 876fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* Build a pointer to the start of string data */ 877fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r0, #STRING_DATA_OFFSET 878fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r0, r0, r12, lsl #1 879fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 880fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* Save a copy in r12 to later compute result */ 881fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee mov r12, r0 882fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 883fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* Build pointer to start of data to compare and pre-bias */ 884fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r0, r0, r2, lsl #1 885fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, #2 886fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 887fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* Compute iteration count */ 888fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r2, r3, r2 889fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 890fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* 891fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * At this point we have: 892fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r0: start of data to test 893fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r1: char to compare 894fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r2: iteration count 895fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r12: original start of string data 896fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r3, r4, r10, r11 available for loading string data 897fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee */ 898fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 899fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r2, #4 900fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee blt indexof_remainder 901fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 902fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeindexof_loop4: 903fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r3, [r0, #2]! 904fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r4, [r0, #2]! 905fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r10, [r0, #2]! 906fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r11, [r0, #2]! 907fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r3, r1 908fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee beq match_0 909fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r4, r1 910fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee beq match_1 911fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r10, r1 912fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee beq match_2 913fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r11, r1 914fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee beq match_3 915fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r2, #4 916fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bge indexof_loop4 917fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 918fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeindexof_remainder: 919fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee adds r2, #4 920fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee beq indexof_nomatch 921fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 922fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeindexof_loop1: 923fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r3, [r0, #2]! 924fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r3, r1 925fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee beq match_3 926fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r2, #1 927fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bne indexof_loop1 928fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 929fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeindexof_nomatch: 930fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee mov r0, #-1 931fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r10-r11, pc} 932fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 933fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeematch_0: 934fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, #6 935fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, r12 936fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee asr r0, r0, #1 937fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r10-r11, pc} 938fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeematch_1: 939fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, #4 940fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, r12 941fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee asr r0, r0, #1 942fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r10-r11, pc} 943fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeematch_2: 944fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, #2 945fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, r12 946fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee asr r0, r0, #1 947fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r10-r11, pc} 948fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeematch_3: 949fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee sub r0, r12 950fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee asr r0, r0, #1 951fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r10-r11, pc} 952fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 953fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 954fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* 955fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * String's compareTo. 956fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * 957fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * Requires rARG0/rARG1 to have been previously checked for null. Will 958fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * return negative if this's string is < comp, 0 if they are the 959fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * same and positive if >. 960fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * 961fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * On entry: 962fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r0: this object pointer 963fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r1: comp object pointer 964fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * 965fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee */ 966fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 967fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee .balign 4 968fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee .global art_string_compareto 969fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee .extern __memcmp16 970fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeart_string_compareto: 971fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee mov r2, r0 @ this to r2, opening up r0 for return value 972fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r0, r2, r1 @ Same? 973fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bxeq lr 974fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 975fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee push {r4, r7-r12, lr} @ 8 words - keep alignment 976fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 977fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r4, [r2, #STRING_OFFSET_OFFSET] 978fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r9, [r1, #STRING_OFFSET_OFFSET] 979fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r7, [r2, #STRING_COUNT_OFFSET] 980fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r10, [r1, #STRING_COUNT_OFFSET] 981fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r2, [r2, #STRING_VALUE_OFFSET] 982fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldr r1, [r1, #STRING_VALUE_OFFSET] 983fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 984fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* 985fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * At this point, we have: 986fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * value: r2/r1 987fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * offset: r4/r9 988fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * count: r7/r10 989fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * We're going to compute 990fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r11 <- countDiff 991fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r10 <- minCount 992fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee */ 993fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r11, r7, r10 994fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee movls r10, r7 995fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 996fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* Now, build pointers to the string data */ 997fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r2, r2, r4, lsl #1 998fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r1, r1, r9, lsl #1 999fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* 1000fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * Note: data pointers point to previous element so we can use pre-index 1001fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * mode with base writeback. 1002fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee */ 1003fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r2, #STRING_DATA_OFFSET-2 @ offset to contents[-1] 1004fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r1, #STRING_DATA_OFFSET-2 @ offset to contents[-1] 1005fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1006fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* 1007fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * At this point we have: 1008fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r2: *this string data 1009fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r1: *comp string data 1010fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r10: iteration count for comparison 1011fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r11: value to return if the first part of the string is equal 1012fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r0: reserved for result 1013fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * r3, r4, r7, r8, r9, r12 available for loading string data 1014fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee */ 1015fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1016fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r10, #2 1017fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee blt do_remainder2 1018fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1019fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* 1020fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * Unroll the first two checks so we can quickly catch early mismatch 1021fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee * on long strings (but preserve incoming alignment) 1022fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee */ 1023fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1024fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r3, [r2, #2]! 1025fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r4, [r1, #2]! 1026fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r7, [r2, #2]! 1027fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r8, [r1, #2]! 1028fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r0, r3, r4 1029fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subeqs r0, r7, r8 1030fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bne done 1031fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r10, #28 1032fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bgt do_memcmp16 1033fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r10, #3 1034fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee blt do_remainder 1035fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1036fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeloopback_triple: 1037fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r3, [r2, #2]! 1038fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r4, [r1, #2]! 1039fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r7, [r2, #2]! 1040fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r8, [r1, #2]! 1041fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r9, [r2, #2]! 1042fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r12,[r1, #2]! 1043fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r0, r3, r4 1044fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subeqs r0, r7, r8 1045fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subeqs r0, r9, r12 1046fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bne done 1047fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r10, #3 1048fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bge loopback_triple 1049fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1050fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeedo_remainder: 1051fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee adds r10, #3 1052fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee beq returnDiff 1053fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1054fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeeloopback_single: 1055fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r3, [r2, #2]! 1056fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee ldrh r4, [r1, #2]! 1057fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r0, r3, r4 1058fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bne done 1059fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee subs r10, #1 1060fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bne loopback_single 1061fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1062fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeereturnDiff: 1063fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee mov r0, r11 1064fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r7-r12, pc} 1065fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1066fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeedo_remainder2: 1067fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee adds r10, #2 1068fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bne loopback_single 1069fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee mov r0, r11 1070fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r7-r12, pc} 1071fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee 1072fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee /* Long string case */ 1073fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeedo_memcmp16: 1074fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee mov r7, r11 1075fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r0, r2, #2 1076fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee add r1, r1, #2 1077fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee mov r2, r10 1078fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee bl __memcmp16 1079fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee cmp r0, #0 1080fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee moveq r0, r7 1081fc9e6fabed89d948fa8c0e9d673e430076712c60buzbeedone: 1082fc9e6fabed89d948fa8c0e9d673e430076712c60buzbee pop {r4, r7-r12, pc} 1083