Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "asm_support_arm64.S" |
| 18 | |
| 19 | #include "arch/quick_alloc_entrypoints.S" |
| 20 | |
| 21 | |
| 22 | /* |
| 23 | * Macro that sets up the callee save frame to conform with |
| 24 | * Runtime::CreateCalleeSaveMethod(kSaveAll) |
| 25 | */ |
| 26 | .macro SETUP_SAVE_ALL_CALLEE_SAVE_FRAME |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 27 | adrp xIP0, :got:_ZN3art7Runtime9instance_E |
| 28 | ldr xIP0, [xIP0, #:got_lo12:_ZN3art7Runtime9instance_E] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 29 | |
| 30 | // Our registers aren't intermixed - just spill in order. |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 31 | ldr xIP0, [xIP0] // xIP0 = & (art::Runtime * art::Runtime.instance_) . |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 32 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 33 | // xIP0 = (ArtMethod*) Runtime.instance_.callee_save_methods[kRefAndArgs] . |
Hiroshi Yamauchi | ab08811 | 2014-07-14 13:00:14 -0700 | [diff] [blame] | 34 | THIS_LOAD_REQUIRES_READ_BARRIER |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 35 | ldr xIP0, [xIP0, RUNTIME_SAVE_ALL_CALLEE_SAVE_FRAME_OFFSET ] |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 36 | |
| 37 | sub sp, sp, #176 |
| 38 | .cfi_adjust_cfa_offset 176 |
| 39 | |
| 40 | // Ugly compile-time check, but we only have the preprocessor. |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 41 | #if (FRAME_SIZE_SAVE_ALL_CALLEE_SAVE != 176) |
| 42 | #error "SAVE_ALL_CALLEE_SAVE_FRAME(ARM64) size not as expected." |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 43 | #endif |
| 44 | |
| 45 | // FP callee-saves |
| 46 | stp d8, d9, [sp, #8] |
| 47 | stp d10, d11, [sp, #24] |
| 48 | stp d12, d13, [sp, #40] |
| 49 | stp d14, d15, [sp, #56] |
| 50 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 51 | // Reserved registers |
| 52 | stp xSELF, xSUSPEND, [sp, #72] |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 53 | .cfi_rel_offset x18, 72 |
| 54 | .cfi_rel_offset x19, 80 |
| 55 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 56 | // callee-saves |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 57 | stp x20, x21, [sp, #88] |
| 58 | .cfi_rel_offset x20, 88 |
| 59 | .cfi_rel_offset x21, 96 |
| 60 | |
| 61 | stp x22, x23, [sp, #104] |
| 62 | .cfi_rel_offset x22, 104 |
| 63 | .cfi_rel_offset x23, 112 |
| 64 | |
| 65 | stp x24, x25, [sp, #120] |
| 66 | .cfi_rel_offset x24, 120 |
| 67 | .cfi_rel_offset x25, 128 |
| 68 | |
| 69 | stp x26, x27, [sp, #136] |
| 70 | .cfi_rel_offset x26, 136 |
| 71 | .cfi_rel_offset x27, 144 |
| 72 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 73 | stp x28, x29, [sp, #152] |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 74 | .cfi_rel_offset x28, 152 |
| 75 | .cfi_rel_offset x29, 160 |
| 76 | |
| 77 | str xLR, [sp, #168] |
| 78 | .cfi_rel_offset x30, 168 |
| 79 | |
| 80 | // Loads appropriate callee-save-method |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 81 | str xIP0, [sp] // Store ArtMethod* Runtime::callee_save_methods_[kRefsAndArgs] |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 82 | // Place sp in Thread::Current()->top_quick_frame. |
| 83 | mov xIP0, sp |
| 84 | str xIP0, [xSELF, # THREAD_TOP_QUICK_FRAME_OFFSET] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 85 | .endm |
| 86 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 87 | /* |
| 88 | * Macro that sets up the callee save frame to conform with |
| 89 | * Runtime::CreateCalleeSaveMethod(kRefsOnly). |
| 90 | */ |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 91 | .macro SETUP_REFS_ONLY_CALLEE_SAVE_FRAME |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 92 | adrp xIP0, :got:_ZN3art7Runtime9instance_E |
| 93 | ldr xIP0, [xIP0, #:got_lo12:_ZN3art7Runtime9instance_E] |
| 94 | |
| 95 | // Our registers aren't intermixed - just spill in order. |
| 96 | ldr xIP0, [xIP0] // xIP0 = & (art::Runtime * art::Runtime.instance_) . |
| 97 | |
| 98 | // xIP0 = (ArtMethod*) Runtime.instance_.callee_save_methods[kRefAndArgs] . |
| 99 | THIS_LOAD_REQUIRES_READ_BARRIER |
| 100 | ldr xIP0, [xIP0, RUNTIME_REFS_ONLY_CALLEE_SAVE_FRAME_OFFSET ] |
| 101 | |
| 102 | sub sp, sp, #96 |
| 103 | .cfi_adjust_cfa_offset 96 |
| 104 | |
| 105 | // Ugly compile-time check, but we only have the preprocessor. |
| 106 | #if (FRAME_SIZE_REFS_ONLY_CALLEE_SAVE != 96) |
| 107 | #error "REFS_ONLY_CALLEE_SAVE_FRAME(ARM64) size not as expected." |
| 108 | #endif |
| 109 | |
| 110 | // Callee-saves |
| 111 | stp x20, x21, [sp, #8] |
| 112 | .cfi_rel_offset x20, 8 |
| 113 | .cfi_rel_offset x21, 16 |
| 114 | |
| 115 | stp x22, x23, [sp, #24] |
| 116 | .cfi_rel_offset x22, 24 |
| 117 | .cfi_rel_offset x23, 32 |
| 118 | |
| 119 | stp x24, x25, [sp, #40] |
| 120 | .cfi_rel_offset x24, 40 |
| 121 | .cfi_rel_offset x25, 48 |
| 122 | |
| 123 | stp x26, x27, [sp, #56] |
| 124 | .cfi_rel_offset x26, 56 |
| 125 | .cfi_rel_offset x27, 64 |
| 126 | |
| 127 | stp x28, x29, [sp, #72] |
| 128 | .cfi_rel_offset x28, 72 |
| 129 | .cfi_rel_offset x29, 80 |
| 130 | |
| 131 | // LR |
| 132 | str xLR, [sp, #88] |
| 133 | .cfi_rel_offset x30, 88 |
| 134 | |
| 135 | // Save xSELF to xETR. |
| 136 | mov xETR, xSELF |
| 137 | |
| 138 | // Loads appropriate callee-save-method |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 139 | str xIP0, [sp] // Store ArtMethod* Runtime::callee_save_methods_[kRefsOnly] |
| 140 | // Place sp in Thread::Current()->top_quick_frame. |
| 141 | mov xIP0, sp |
| 142 | str xIP0, [xSELF, # THREAD_TOP_QUICK_FRAME_OFFSET] |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 143 | .endm |
| 144 | |
| 145 | // TODO: Probably no need to restore registers preserved by aapcs64. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 146 | .macro RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 147 | // Restore xSELF. |
| 148 | mov xSELF, xETR |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 149 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 150 | // Callee-saves |
| 151 | ldp x20, x21, [sp, #8] |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 152 | .cfi_restore x20 |
| 153 | .cfi_restore x21 |
| 154 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 155 | ldp x22, x23, [sp, #24] |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 156 | .cfi_restore x22 |
| 157 | .cfi_restore x23 |
| 158 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 159 | ldp x24, x25, [sp, #40] |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 160 | .cfi_restore x24 |
| 161 | .cfi_restore x25 |
| 162 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 163 | ldp x26, x27, [sp, #56] |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 164 | .cfi_restore x26 |
| 165 | .cfi_restore x27 |
| 166 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 167 | ldp x28, x29, [sp, #72] |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 168 | .cfi_restore x28 |
| 169 | .cfi_restore x29 |
| 170 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 171 | // LR |
| 172 | ldr xLR, [sp, #88] |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 173 | .cfi_restore x30 |
| 174 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 175 | add sp, sp, #96 |
| 176 | .cfi_adjust_cfa_offset -96 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 177 | .endm |
| 178 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 179 | .macro POP_REFS_ONLY_CALLEE_SAVE_FRAME |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 180 | // Restore xSELF as it might be scratched. |
| 181 | mov xSELF, xETR |
| 182 | // ETR |
| 183 | ldr xETR, [sp, #16] |
| 184 | .cfi_restore x21 |
| 185 | |
| 186 | add sp, sp, #96 |
| 187 | .cfi_adjust_cfa_offset -96 |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 188 | .endm |
| 189 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 190 | .macro RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME_AND_RETURN |
| 191 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 192 | ret |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 193 | .endm |
| 194 | |
| 195 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 196 | .macro SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_INTERNAL |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 197 | sub sp, sp, #224 |
| 198 | .cfi_adjust_cfa_offset 224 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 199 | |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 200 | // Ugly compile-time check, but we only have the preprocessor. |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 201 | #if (FRAME_SIZE_REFS_AND_ARGS_CALLEE_SAVE != 224) |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 202 | #error "REFS_AND_ARGS_CALLEE_SAVE_FRAME(ARM64) size not as expected." |
| 203 | #endif |
| 204 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 205 | // FP args |
| 206 | stp d0, d1, [sp, #16] |
| 207 | stp d2, d3, [sp, #32] |
| 208 | stp d4, d5, [sp, #48] |
| 209 | stp d6, d7, [sp, #64] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 210 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 211 | // args and x20(callee-save) |
| 212 | stp x1, x2, [sp, #80] |
| 213 | .cfi_rel_offset x1, 80 |
| 214 | .cfi_rel_offset x2, 88 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 215 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 216 | stp x3, x4, [sp, #96] |
| 217 | .cfi_rel_offset x3, 96 |
| 218 | .cfi_rel_offset x4, 104 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 219 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 220 | stp x5, x6, [sp, #112] |
| 221 | .cfi_rel_offset x5, 112 |
| 222 | .cfi_rel_offset x6, 120 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 223 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 224 | stp x7, x20, [sp, #128] |
| 225 | .cfi_rel_offset x7, 128 |
| 226 | .cfi_rel_offset x20, 136 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 227 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 228 | // Callee-saves. |
| 229 | stp x21, x22, [sp, #144] |
| 230 | .cfi_rel_offset x21, 144 |
| 231 | .cfi_rel_offset x22, 152 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 232 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 233 | stp x23, x24, [sp, #160] |
| 234 | .cfi_rel_offset x23, 160 |
| 235 | .cfi_rel_offset x24, 168 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 236 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 237 | stp x25, x26, [sp, #176] |
| 238 | .cfi_rel_offset x25, 176 |
| 239 | .cfi_rel_offset x26, 184 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 240 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 241 | stp x27, x28, [sp, #192] |
| 242 | .cfi_rel_offset x27, 192 |
| 243 | .cfi_rel_offset x28, 200 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 244 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 245 | // x29(callee-save) and LR |
| 246 | stp x29, xLR, [sp, #208] |
| 247 | .cfi_rel_offset x29, 208 |
| 248 | .cfi_rel_offset x30, 216 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 249 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 250 | // Save xSELF to xETR. |
| 251 | mov xETR, xSELF |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 252 | .endm |
| 253 | |
| 254 | /* |
| 255 | * Macro that sets up the callee save frame to conform with |
| 256 | * Runtime::CreateCalleeSaveMethod(kRefsAndArgs). |
| 257 | * |
| 258 | * TODO This is probably too conservative - saving FP & LR. |
| 259 | */ |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 260 | .macro SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 261 | adrp xIP0, :got:_ZN3art7Runtime9instance_E |
| 262 | ldr xIP0, [xIP0, #:got_lo12:_ZN3art7Runtime9instance_E] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 263 | |
| 264 | // Our registers aren't intermixed - just spill in order. |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 265 | ldr xIP0, [xIP0] // xIP0 = & (art::Runtime * art::Runtime.instance_) . |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 266 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 267 | // xIP0 = (ArtMethod*) Runtime.instance_.callee_save_methods[kRefAndArgs] . |
Hiroshi Yamauchi | ab08811 | 2014-07-14 13:00:14 -0700 | [diff] [blame] | 268 | THIS_LOAD_REQUIRES_READ_BARRIER |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 269 | ldr xIP0, [xIP0, RUNTIME_REFS_AND_ARGS_CALLEE_SAVE_FRAME_OFFSET ] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 270 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 271 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_INTERNAL |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 272 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 273 | str xIP0, [sp] // Store ArtMethod* Runtime::callee_save_methods_[kRefsAndArgs] |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 274 | // Place sp in Thread::Current()->top_quick_frame. |
| 275 | mov xIP0, sp |
| 276 | str xIP0, [xSELF, # THREAD_TOP_QUICK_FRAME_OFFSET] |
| 277 | .endm |
| 278 | |
| 279 | .macro SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_WITH_METHOD_IN_X0 |
| 280 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_INTERNAL |
| 281 | str x0, [sp, #0] // Store ArtMethod* to bottom of stack. |
| 282 | // Place sp in Thread::Current()->top_quick_frame. |
| 283 | mov xIP0, sp |
| 284 | str xIP0, [xSELF, # THREAD_TOP_QUICK_FRAME_OFFSET] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 285 | .endm |
| 286 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 287 | // TODO: Probably no need to restore registers preserved by aapcs64. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 288 | .macro RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 289 | // Restore xSELF. |
| 290 | mov xSELF, xETR |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 291 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 292 | // FP args |
| 293 | ldp d0, d1, [sp, #16] |
| 294 | ldp d2, d3, [sp, #32] |
| 295 | ldp d4, d5, [sp, #48] |
| 296 | ldp d6, d7, [sp, #64] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 297 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 298 | // args and x20(callee-save) |
| 299 | ldp x1, x2, [sp, #80] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 300 | .cfi_restore x1 |
| 301 | .cfi_restore x2 |
| 302 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 303 | ldp x3, x4, [sp, #96] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 304 | .cfi_restore x3 |
| 305 | .cfi_restore x4 |
| 306 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 307 | ldp x5, x6, [sp, #112] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 308 | .cfi_restore x5 |
| 309 | .cfi_restore x6 |
| 310 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 311 | ldp x7, x20, [sp, #128] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 312 | .cfi_restore x7 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 313 | .cfi_restore x20 |
| 314 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 315 | // Callee-saves. |
| 316 | ldp x21, x22, [sp, #144] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 317 | .cfi_restore x21 |
| 318 | .cfi_restore x22 |
| 319 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 320 | ldp x23, x24, [sp, #160] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 321 | .cfi_restore x23 |
| 322 | .cfi_restore x24 |
| 323 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 324 | ldp x25, x26, [sp, #176] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 325 | .cfi_restore x25 |
| 326 | .cfi_restore x26 |
| 327 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 328 | ldp x27, x28, [sp, #192] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 329 | .cfi_restore x27 |
| 330 | .cfi_restore x28 |
| 331 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 332 | // x29(callee-save) and LR |
| 333 | ldp x29, xLR, [sp, #208] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 334 | .cfi_restore x29 |
| 335 | .cfi_restore x30 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 336 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 337 | add sp, sp, #224 |
| 338 | .cfi_adjust_cfa_offset -224 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 339 | .endm |
| 340 | |
| 341 | .macro RETURN_IF_RESULT_IS_ZERO |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 342 | cbnz x0, 1f // result non-zero branch over |
| 343 | ret // return |
| 344 | 1: |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 345 | .endm |
| 346 | |
| 347 | .macro RETURN_IF_RESULT_IS_NON_ZERO |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 348 | cbz x0, 1f // result zero branch over |
| 349 | ret // return |
| 350 | 1: |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 351 | .endm |
| 352 | |
| 353 | /* |
| 354 | * Macro that set calls through to artDeliverPendingExceptionFromCode, where the pending |
| 355 | * exception is Thread::Current()->exception_ |
| 356 | */ |
| 357 | .macro DELIVER_PENDING_EXCEPTION |
| 358 | SETUP_SAVE_ALL_CALLEE_SAVE_FRAME |
| 359 | mov x0, xSELF |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 360 | |
| 361 | // Point of no return. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 362 | b artDeliverPendingExceptionFromCode // artDeliverPendingExceptionFromCode(Thread*) |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 363 | brk 0 // Unreached |
| 364 | .endm |
| 365 | |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 366 | .macro RETURN_OR_DELIVER_PENDING_EXCEPTION_REG reg |
| 367 | ldr \reg, [xSELF, # THREAD_EXCEPTION_OFFSET] // Get exception field. |
| 368 | cbnz \reg, 1f |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 369 | ret |
| 370 | 1: |
| 371 | DELIVER_PENDING_EXCEPTION |
| 372 | .endm |
| 373 | |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 374 | .macro RETURN_OR_DELIVER_PENDING_EXCEPTION |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 375 | RETURN_OR_DELIVER_PENDING_EXCEPTION_REG xIP0 |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 376 | .endm |
| 377 | |
| 378 | // Same as above with x1. This is helpful in stubs that want to avoid clobbering another register. |
| 379 | .macro RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 380 | RETURN_OR_DELIVER_PENDING_EXCEPTION_REG x1 |
| 381 | .endm |
| 382 | |
| 383 | .macro RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 384 | cbnz w0, 1f // result non-zero branch over |
| 385 | ret // return |
| 386 | 1: |
| 387 | DELIVER_PENDING_EXCEPTION |
| 388 | .endm |
| 389 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 390 | .macro NO_ARG_RUNTIME_EXCEPTION c_name, cxx_name |
| 391 | .extern \cxx_name |
| 392 | ENTRY \c_name |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 393 | SETUP_SAVE_ALL_CALLEE_SAVE_FRAME // save all registers as basis for long jump context |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 394 | mov x0, xSELF // pass Thread::Current |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 395 | b \cxx_name // \cxx_name(Thread*) |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 396 | END \c_name |
| 397 | .endm |
| 398 | |
| 399 | .macro ONE_ARG_RUNTIME_EXCEPTION c_name, cxx_name |
| 400 | .extern \cxx_name |
| 401 | ENTRY \c_name |
Serban Constantinescu | 75b9113 | 2014-04-09 18:39:10 +0100 | [diff] [blame] | 402 | SETUP_SAVE_ALL_CALLEE_SAVE_FRAME // save all registers as basis for long jump context. |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 403 | mov x1, xSELF // pass Thread::Current. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 404 | b \cxx_name // \cxx_name(arg, Thread*). |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 405 | brk 0 |
| 406 | END \c_name |
| 407 | .endm |
| 408 | |
| 409 | .macro TWO_ARG_RUNTIME_EXCEPTION c_name, cxx_name |
| 410 | .extern \cxx_name |
| 411 | ENTRY \c_name |
| 412 | SETUP_SAVE_ALL_CALLEE_SAVE_FRAME // save all registers as basis for long jump context |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 413 | mov x2, xSELF // pass Thread::Current |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 414 | b \cxx_name // \cxx_name(arg1, arg2, Thread*) |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 415 | brk 0 |
| 416 | END \c_name |
| 417 | .endm |
| 418 | |
| 419 | /* |
| 420 | * Called by managed code, saves callee saves and then calls artThrowException |
| 421 | * that will place a mock Method* at the bottom of the stack. Arg1 holds the exception. |
| 422 | */ |
| 423 | ONE_ARG_RUNTIME_EXCEPTION art_quick_deliver_exception, artDeliverExceptionFromCode |
| 424 | |
| 425 | /* |
| 426 | * Called by managed code to create and deliver a NullPointerException. |
| 427 | */ |
| 428 | NO_ARG_RUNTIME_EXCEPTION art_quick_throw_null_pointer_exception, artThrowNullPointerExceptionFromCode |
| 429 | |
| 430 | /* |
| 431 | * Called by managed code to create and deliver an ArithmeticException. |
| 432 | */ |
| 433 | NO_ARG_RUNTIME_EXCEPTION art_quick_throw_div_zero, artThrowDivZeroFromCode |
| 434 | |
| 435 | /* |
| 436 | * Called by managed code to create and deliver an ArrayIndexOutOfBoundsException. Arg1 holds |
| 437 | * index, arg2 holds limit. |
| 438 | */ |
| 439 | TWO_ARG_RUNTIME_EXCEPTION art_quick_throw_array_bounds, artThrowArrayBoundsFromCode |
| 440 | |
| 441 | /* |
| 442 | * Called by managed code to create and deliver a StackOverflowError. |
| 443 | */ |
| 444 | NO_ARG_RUNTIME_EXCEPTION art_quick_throw_stack_overflow, artThrowStackOverflowFromCode |
| 445 | |
| 446 | /* |
| 447 | * Called by managed code to create and deliver a NoSuchMethodError. |
| 448 | */ |
| 449 | ONE_ARG_RUNTIME_EXCEPTION art_quick_throw_no_such_method, artThrowNoSuchMethodFromCode |
| 450 | |
| 451 | /* |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 452 | * All generated callsites for interface invokes and invocation slow paths will load arguments |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 453 | * as usual - except instead of loading arg0/x0 with the target Method*, arg0/x0 will contain |
| 454 | * the method_idx. This wrapper will save arg1-arg3, load the caller's Method*, align the |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 455 | * stack and call the appropriate C helper. |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 456 | * NOTE: "this" is first visible argument of the target, and so can be found in arg1/x1. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 457 | * |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 458 | * The helper will attempt to locate the target and return a 128-bit result in x0/x1 consisting |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 459 | * of the target Method* in x0 and method->code_ in x1. |
| 460 | * |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 461 | * If unsuccessful, the helper will return NULL/????. There will be a pending exception in the |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 462 | * thread and we branch to another stub to deliver it. |
| 463 | * |
| 464 | * On success this wrapper will restore arguments and *jump* to the target, leaving the lr |
| 465 | * pointing back to the original caller. |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 466 | * |
| 467 | * Adapted from ARM32 code. |
| 468 | * |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 469 | * Clobbers xIP0. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 470 | */ |
| 471 | .macro INVOKE_TRAMPOLINE c_name, cxx_name |
| 472 | .extern \cxx_name |
| 473 | ENTRY \c_name |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 474 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME // save callee saves in case allocation triggers GC |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 475 | // Helper signature is always |
| 476 | // (method_idx, *this_object, *caller_method, *self, sp) |
| 477 | |
Alexei Zavjalov | 41c507a | 2014-05-15 16:02:46 +0700 | [diff] [blame] | 478 | ldr w2, [sp, #FRAME_SIZE_REFS_AND_ARGS_CALLEE_SAVE] // pass caller Method* |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 479 | mov x3, xSELF // pass Thread::Current |
| 480 | mov x4, sp |
| 481 | bl \cxx_name // (method_idx, this, caller, Thread*, SP) |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 482 | mov xIP0, x1 // save Method*->code_ |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 483 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 484 | cbz x0, 1f // did we find the target? if not go to exception delivery |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 485 | br xIP0 // tail call to target |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 486 | 1: |
| 487 | DELIVER_PENDING_EXCEPTION |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 488 | END \c_name |
| 489 | .endm |
| 490 | |
| 491 | INVOKE_TRAMPOLINE art_quick_invoke_interface_trampoline, artInvokeInterfaceTrampoline |
| 492 | INVOKE_TRAMPOLINE art_quick_invoke_interface_trampoline_with_access_check, artInvokeInterfaceTrampolineWithAccessCheck |
| 493 | |
| 494 | INVOKE_TRAMPOLINE art_quick_invoke_static_trampoline_with_access_check, artInvokeStaticTrampolineWithAccessCheck |
| 495 | INVOKE_TRAMPOLINE art_quick_invoke_direct_trampoline_with_access_check, artInvokeDirectTrampolineWithAccessCheck |
| 496 | INVOKE_TRAMPOLINE art_quick_invoke_super_trampoline_with_access_check, artInvokeSuperTrampolineWithAccessCheck |
| 497 | INVOKE_TRAMPOLINE art_quick_invoke_virtual_trampoline_with_access_check, artInvokeVirtualTrampolineWithAccessCheck |
| 498 | |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 499 | |
| 500 | .macro INVOKE_STUB_CREATE_FRAME |
| 501 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 502 | SAVE_SIZE=6*8 // x4, x5, xSUSPEND, SP, LR & FP saved. |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 503 | SAVE_SIZE_AND_METHOD=SAVE_SIZE+STACK_REFERENCE_SIZE |
| 504 | |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 505 | |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 506 | mov x9, sp // Save stack pointer. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 507 | .cfi_register sp,x9 |
| 508 | |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 509 | add x10, x2, # SAVE_SIZE_AND_METHOD // calculate size of frame. |
| 510 | sub x10, sp, x10 // Calculate SP position - saves + ArtMethod* + args |
| 511 | and x10, x10, # ~0xf // Enforce 16 byte stack alignment. |
| 512 | mov sp, x10 // Set new SP. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 513 | |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 514 | sub x10, x9, #SAVE_SIZE // Calculate new FP (later). Done here as we must move SP |
| 515 | .cfi_def_cfa_register x10 // before this. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 516 | .cfi_adjust_cfa_offset SAVE_SIZE |
| 517 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 518 | stp x9, xSUSPEND, [x10, #32] // Save old stack pointer and xSUSPEND |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 519 | .cfi_rel_offset sp, 32 |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 520 | .cfi_rel_offset x19, 40 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 521 | |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 522 | stp x4, x5, [x10, #16] // Save result and shorty addresses. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 523 | .cfi_rel_offset x4, 16 |
| 524 | .cfi_rel_offset x5, 24 |
| 525 | |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 526 | stp xFP, xLR, [x10] // Store LR & FP. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 527 | .cfi_rel_offset x29, 0 |
| 528 | .cfi_rel_offset x30, 8 |
| 529 | |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 530 | mov xFP, x10 // Use xFP now, as it's callee-saved. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 531 | .cfi_def_cfa_register x29 |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 532 | mov xSELF, x3 // Move thread pointer into SELF register. |
| 533 | mov wSUSPEND, #SUSPEND_CHECK_INTERVAL // reset wSUSPEND to suspend check interval |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 534 | |
| 535 | // Copy arguments into stack frame. |
| 536 | // Use simple copy routine for now. |
| 537 | // 4 bytes per slot. |
| 538 | // X1 - source address |
| 539 | // W2 - args length |
| 540 | // X9 - destination address. |
| 541 | // W10 - temporary |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 542 | add x9, sp, #4 // Destination address is bottom of stack + NULL. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 543 | |
| 544 | // Use \@ to differentiate between macro invocations. |
| 545 | .LcopyParams\@: |
| 546 | cmp w2, #0 |
| 547 | beq .LendCopyParams\@ |
| 548 | sub w2, w2, #4 // Need 65536 bytes of range. |
| 549 | ldr w10, [x1, x2] |
| 550 | str w10, [x9, x2] |
| 551 | |
| 552 | b .LcopyParams\@ |
| 553 | |
| 554 | .LendCopyParams\@: |
| 555 | |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 556 | // Store NULL into StackReference<Method>* at bottom of frame. |
| 557 | str wzr, [sp] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 558 | |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 559 | #if (STACK_REFERENCE_SIZE != 4) |
| 560 | #error "STACK_REFERENCE_SIZE(ARM64) size not as expected." |
| 561 | #endif |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 562 | .endm |
| 563 | |
| 564 | .macro INVOKE_STUB_CALL_AND_RETURN |
| 565 | |
| 566 | // load method-> METHOD_QUICK_CODE_OFFSET |
Mathieu Chartier | 2d72101 | 2014-11-10 11:08:06 -0800 | [diff] [blame^] | 567 | ldr x9, [x0 , #MIRROR_ART_METHOD_QUICK_CODE_OFFSET_64] |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 568 | // Branch to method. |
| 569 | blr x9 |
| 570 | |
| 571 | // Restore return value address and shorty address. |
| 572 | ldp x4,x5, [xFP, #16] |
| 573 | .cfi_restore x4 |
| 574 | .cfi_restore x5 |
| 575 | |
| 576 | // Store result (w0/x0/s0/d0) appropriately, depending on resultType. |
| 577 | ldrb w10, [x5] |
| 578 | |
| 579 | // Don't set anything for a void type. |
| 580 | cmp w10, #'V' |
| 581 | beq .Lexit_art_quick_invoke_stub\@ |
| 582 | |
| 583 | cmp w10, #'D' |
| 584 | bne .Lreturn_is_float\@ |
| 585 | str d0, [x4] |
| 586 | b .Lexit_art_quick_invoke_stub\@ |
| 587 | |
| 588 | .Lreturn_is_float\@: |
| 589 | cmp w10, #'F' |
| 590 | bne .Lreturn_is_int\@ |
| 591 | str s0, [x4] |
| 592 | b .Lexit_art_quick_invoke_stub\@ |
| 593 | |
| 594 | // Just store x0. Doesn't matter if it is 64 or 32 bits. |
| 595 | .Lreturn_is_int\@: |
| 596 | str x0, [x4] |
| 597 | |
| 598 | .Lexit_art_quick_invoke_stub\@: |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 599 | ldp x2, xSUSPEND, [xFP, #32] // Restore stack pointer and xSUSPEND. |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 600 | .cfi_restore x19 |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 601 | mov sp, x2 |
| 602 | .cfi_restore sp |
| 603 | |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 604 | ldp xFP, xLR, [xFP] // Restore old frame pointer and link register. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 605 | .cfi_restore x29 |
| 606 | .cfi_restore x30 |
| 607 | |
| 608 | ret |
| 609 | |
| 610 | .endm |
| 611 | |
| 612 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 613 | /* |
| 614 | * extern"C" void art_quick_invoke_stub(ArtMethod *method, x0 |
| 615 | * uint32_t *args, x1 |
| 616 | * uint32_t argsize, w2 |
| 617 | * Thread *self, x3 |
| 618 | * JValue *result, x4 |
| 619 | * char *shorty); x5 |
| 620 | * +----------------------+ |
| 621 | * | | |
| 622 | * | C/C++ frame | |
| 623 | * | LR'' | |
| 624 | * | FP'' | <- SP' |
| 625 | * +----------------------+ |
| 626 | * +----------------------+ |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 627 | * | x19 | <- Used as wSUSPEND, won't be restored by managed code. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 628 | * | SP' | |
| 629 | * | X5 | |
| 630 | * | X4 | Saved registers |
| 631 | * | LR' | |
| 632 | * | FP' | <- FP |
| 633 | * +----------------------+ |
| 634 | * | uint32_t out[n-1] | |
| 635 | * | : : | Outs |
| 636 | * | uint32_t out[0] | |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 637 | * | StackRef<ArtMethod> | <- SP value=null |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 638 | * +----------------------+ |
| 639 | * |
| 640 | * Outgoing registers: |
| 641 | * x0 - Method* |
| 642 | * x1-x7 - integer parameters. |
| 643 | * d0-d7 - Floating point parameters. |
| 644 | * xSELF = self |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 645 | * wSUSPEND = suspend count |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 646 | * SP = & of ArtMethod* |
| 647 | * x1 = "this" pointer. |
| 648 | * |
| 649 | */ |
| 650 | ENTRY art_quick_invoke_stub |
| 651 | // Spill registers as per AACPS64 calling convention. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 652 | INVOKE_STUB_CREATE_FRAME |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 653 | |
| 654 | // Fill registers x/w1 to x/w7 and s/d0 to s/d7 with parameters. |
| 655 | // Parse the passed shorty to determine which register to load. |
| 656 | // Load addresses for routines that load WXSD registers. |
| 657 | adr x11, .LstoreW2 |
| 658 | adr x12, .LstoreX2 |
| 659 | adr x13, .LstoreS0 |
| 660 | adr x14, .LstoreD0 |
| 661 | |
| 662 | // Initialize routine offsets to 0 for integers and floats. |
| 663 | // x8 for integers, x15 for floating point. |
| 664 | mov x8, #0 |
| 665 | mov x15, #0 |
| 666 | |
| 667 | add x10, x5, #1 // Load shorty address, plus one to skip return value. |
| 668 | ldr w1, [x9],#4 // Load "this" parameter, and increment arg pointer. |
| 669 | |
| 670 | // Loop to fill registers. |
| 671 | .LfillRegisters: |
| 672 | ldrb w17, [x10], #1 // Load next character in signature, and increment. |
| 673 | cbz w17, .LcallFunction // Exit at end of signature. Shorty 0 terminated. |
| 674 | |
| 675 | cmp w17, #'F' // is this a float? |
| 676 | bne .LisDouble |
| 677 | |
| 678 | cmp x15, # 8*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 679 | beq .Ladvance4 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 680 | |
| 681 | add x17, x13, x15 // Calculate subroutine to jump to. |
| 682 | br x17 |
| 683 | |
| 684 | .LisDouble: |
| 685 | cmp w17, #'D' // is this a double? |
| 686 | bne .LisLong |
| 687 | |
| 688 | cmp x15, # 8*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 689 | beq .Ladvance8 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 690 | |
| 691 | add x17, x14, x15 // Calculate subroutine to jump to. |
| 692 | br x17 |
| 693 | |
| 694 | .LisLong: |
| 695 | cmp w17, #'J' // is this a long? |
| 696 | bne .LisOther |
| 697 | |
Andreas Gampe | 9de65ff | 2014-03-21 17:25:57 -0700 | [diff] [blame] | 698 | cmp x8, # 6*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 699 | beq .Ladvance8 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 700 | |
| 701 | add x17, x12, x8 // Calculate subroutine to jump to. |
| 702 | br x17 |
| 703 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 704 | .LisOther: // Everything else takes one vReg. |
Andreas Gampe | 9de65ff | 2014-03-21 17:25:57 -0700 | [diff] [blame] | 705 | cmp x8, # 6*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 706 | beq .Ladvance4 |
| 707 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 708 | add x17, x11, x8 // Calculate subroutine to jump to. |
| 709 | br x17 |
| 710 | |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 711 | .Ladvance4: |
| 712 | add x9, x9, #4 |
| 713 | b .LfillRegisters |
| 714 | |
| 715 | .Ladvance8: |
| 716 | add x9, x9, #8 |
| 717 | b .LfillRegisters |
| 718 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 719 | // Macro for loading a parameter into a register. |
| 720 | // counter - the register with offset into these tables |
| 721 | // size - the size of the register - 4 or 8 bytes. |
| 722 | // register - the name of the register to be loaded. |
| 723 | .macro LOADREG counter size register return |
| 724 | ldr \register , [x9], #\size |
| 725 | add \counter, \counter, 12 |
| 726 | b \return |
| 727 | .endm |
| 728 | |
| 729 | // Store ints. |
| 730 | .LstoreW2: |
| 731 | LOADREG x8 4 w2 .LfillRegisters |
| 732 | LOADREG x8 4 w3 .LfillRegisters |
| 733 | LOADREG x8 4 w4 .LfillRegisters |
| 734 | LOADREG x8 4 w5 .LfillRegisters |
| 735 | LOADREG x8 4 w6 .LfillRegisters |
| 736 | LOADREG x8 4 w7 .LfillRegisters |
| 737 | |
| 738 | // Store longs. |
| 739 | .LstoreX2: |
| 740 | LOADREG x8 8 x2 .LfillRegisters |
| 741 | LOADREG x8 8 x3 .LfillRegisters |
| 742 | LOADREG x8 8 x4 .LfillRegisters |
| 743 | LOADREG x8 8 x5 .LfillRegisters |
| 744 | LOADREG x8 8 x6 .LfillRegisters |
| 745 | LOADREG x8 8 x7 .LfillRegisters |
| 746 | |
| 747 | // Store singles. |
| 748 | .LstoreS0: |
| 749 | LOADREG x15 4 s0 .LfillRegisters |
| 750 | LOADREG x15 4 s1 .LfillRegisters |
| 751 | LOADREG x15 4 s2 .LfillRegisters |
| 752 | LOADREG x15 4 s3 .LfillRegisters |
| 753 | LOADREG x15 4 s4 .LfillRegisters |
| 754 | LOADREG x15 4 s5 .LfillRegisters |
| 755 | LOADREG x15 4 s6 .LfillRegisters |
| 756 | LOADREG x15 4 s7 .LfillRegisters |
| 757 | |
| 758 | // Store doubles. |
| 759 | .LstoreD0: |
| 760 | LOADREG x15 8 d0 .LfillRegisters |
| 761 | LOADREG x15 8 d1 .LfillRegisters |
| 762 | LOADREG x15 8 d2 .LfillRegisters |
| 763 | LOADREG x15 8 d3 .LfillRegisters |
| 764 | LOADREG x15 8 d4 .LfillRegisters |
| 765 | LOADREG x15 8 d5 .LfillRegisters |
| 766 | LOADREG x15 8 d6 .LfillRegisters |
| 767 | LOADREG x15 8 d7 .LfillRegisters |
| 768 | |
| 769 | |
| 770 | .LcallFunction: |
| 771 | |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 772 | INVOKE_STUB_CALL_AND_RETURN |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 773 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 774 | END art_quick_invoke_stub |
| 775 | |
| 776 | /* extern"C" |
| 777 | * void art_quick_invoke_static_stub(ArtMethod *method, x0 |
| 778 | * uint32_t *args, x1 |
| 779 | * uint32_t argsize, w2 |
| 780 | * Thread *self, x3 |
| 781 | * JValue *result, x4 |
| 782 | * char *shorty); x5 |
| 783 | */ |
| 784 | ENTRY art_quick_invoke_static_stub |
| 785 | // Spill registers as per AACPS64 calling convention. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 786 | INVOKE_STUB_CREATE_FRAME |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 787 | |
| 788 | // Fill registers x/w1 to x/w7 and s/d0 to s/d7 with parameters. |
| 789 | // Parse the passed shorty to determine which register to load. |
| 790 | // Load addresses for routines that load WXSD registers. |
| 791 | adr x11, .LstoreW1_2 |
| 792 | adr x12, .LstoreX1_2 |
| 793 | adr x13, .LstoreS0_2 |
| 794 | adr x14, .LstoreD0_2 |
| 795 | |
| 796 | // Initialize routine offsets to 0 for integers and floats. |
| 797 | // x8 for integers, x15 for floating point. |
| 798 | mov x8, #0 |
| 799 | mov x15, #0 |
| 800 | |
| 801 | add x10, x5, #1 // Load shorty address, plus one to skip return value. |
| 802 | |
| 803 | // Loop to fill registers. |
| 804 | .LfillRegisters2: |
| 805 | ldrb w17, [x10], #1 // Load next character in signature, and increment. |
| 806 | cbz w17, .LcallFunction2 // Exit at end of signature. Shorty 0 terminated. |
| 807 | |
| 808 | cmp w17, #'F' // is this a float? |
| 809 | bne .LisDouble2 |
| 810 | |
| 811 | cmp x15, # 8*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 812 | beq .Ladvance4_2 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 813 | |
| 814 | add x17, x13, x15 // Calculate subroutine to jump to. |
| 815 | br x17 |
| 816 | |
| 817 | .LisDouble2: |
| 818 | cmp w17, #'D' // is this a double? |
| 819 | bne .LisLong2 |
| 820 | |
| 821 | cmp x15, # 8*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 822 | beq .Ladvance8_2 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 823 | |
| 824 | add x17, x14, x15 // Calculate subroutine to jump to. |
| 825 | br x17 |
| 826 | |
| 827 | .LisLong2: |
| 828 | cmp w17, #'J' // is this a long? |
| 829 | bne .LisOther2 |
| 830 | |
| 831 | cmp x8, # 7*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 832 | beq .Ladvance8_2 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 833 | |
| 834 | add x17, x12, x8 // Calculate subroutine to jump to. |
| 835 | br x17 |
| 836 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 837 | .LisOther2: // Everything else takes one vReg. |
| 838 | cmp x8, # 7*12 // Skip this load if all registers full. |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 839 | beq .Ladvance4_2 |
| 840 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 841 | add x17, x11, x8 // Calculate subroutine to jump to. |
| 842 | br x17 |
| 843 | |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 844 | .Ladvance4_2: |
| 845 | add x9, x9, #4 |
| 846 | b .LfillRegisters2 |
| 847 | |
| 848 | .Ladvance8_2: |
| 849 | add x9, x9, #8 |
| 850 | b .LfillRegisters2 |
| 851 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 852 | // Store ints. |
| 853 | .LstoreW1_2: |
| 854 | LOADREG x8 4 w1 .LfillRegisters2 |
| 855 | LOADREG x8 4 w2 .LfillRegisters2 |
| 856 | LOADREG x8 4 w3 .LfillRegisters2 |
| 857 | LOADREG x8 4 w4 .LfillRegisters2 |
| 858 | LOADREG x8 4 w5 .LfillRegisters2 |
| 859 | LOADREG x8 4 w6 .LfillRegisters2 |
| 860 | LOADREG x8 4 w7 .LfillRegisters2 |
| 861 | |
| 862 | // Store longs. |
| 863 | .LstoreX1_2: |
| 864 | LOADREG x8 8 x1 .LfillRegisters2 |
| 865 | LOADREG x8 8 x2 .LfillRegisters2 |
| 866 | LOADREG x8 8 x3 .LfillRegisters2 |
| 867 | LOADREG x8 8 x4 .LfillRegisters2 |
| 868 | LOADREG x8 8 x5 .LfillRegisters2 |
| 869 | LOADREG x8 8 x6 .LfillRegisters2 |
| 870 | LOADREG x8 8 x7 .LfillRegisters2 |
| 871 | |
| 872 | // Store singles. |
| 873 | .LstoreS0_2: |
| 874 | LOADREG x15 4 s0 .LfillRegisters2 |
| 875 | LOADREG x15 4 s1 .LfillRegisters2 |
| 876 | LOADREG x15 4 s2 .LfillRegisters2 |
| 877 | LOADREG x15 4 s3 .LfillRegisters2 |
| 878 | LOADREG x15 4 s4 .LfillRegisters2 |
| 879 | LOADREG x15 4 s5 .LfillRegisters2 |
| 880 | LOADREG x15 4 s6 .LfillRegisters2 |
| 881 | LOADREG x15 4 s7 .LfillRegisters2 |
| 882 | |
| 883 | // Store doubles. |
| 884 | .LstoreD0_2: |
| 885 | LOADREG x15 8 d0 .LfillRegisters2 |
| 886 | LOADREG x15 8 d1 .LfillRegisters2 |
| 887 | LOADREG x15 8 d2 .LfillRegisters2 |
| 888 | LOADREG x15 8 d3 .LfillRegisters2 |
| 889 | LOADREG x15 8 d4 .LfillRegisters2 |
| 890 | LOADREG x15 8 d5 .LfillRegisters2 |
| 891 | LOADREG x15 8 d6 .LfillRegisters2 |
| 892 | LOADREG x15 8 d7 .LfillRegisters2 |
| 893 | |
| 894 | |
| 895 | .LcallFunction2: |
| 896 | |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 897 | INVOKE_STUB_CALL_AND_RETURN |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 898 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 899 | END art_quick_invoke_static_stub |
| 900 | |
Andreas Gampe | 03906cf | 2014-04-07 12:08:28 -0700 | [diff] [blame] | 901 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 902 | |
| 903 | /* |
| 904 | * On entry x0 is uintptr_t* gprs_ and x1 is uint64_t* fprs_ |
| 905 | */ |
| 906 | |
| 907 | ENTRY art_quick_do_long_jump |
| 908 | // Load FPRs |
| 909 | ldp d0, d1, [x1], #16 |
| 910 | ldp d2, d3, [x1], #16 |
| 911 | ldp d4, d5, [x1], #16 |
| 912 | ldp d6, d7, [x1], #16 |
| 913 | ldp d8, d9, [x1], #16 |
| 914 | ldp d10, d11, [x1], #16 |
| 915 | ldp d12, d13, [x1], #16 |
| 916 | ldp d14, d15, [x1], #16 |
| 917 | ldp d16, d17, [x1], #16 |
| 918 | ldp d18, d19, [x1], #16 |
| 919 | ldp d20, d21, [x1], #16 |
| 920 | ldp d22, d23, [x1], #16 |
| 921 | ldp d24, d25, [x1], #16 |
| 922 | ldp d26, d27, [x1], #16 |
| 923 | ldp d28, d29, [x1], #16 |
| 924 | ldp d30, d31, [x1] |
| 925 | |
| 926 | // Load GPRs |
| 927 | // TODO: lots of those are smashed, could optimize. |
| 928 | add x0, x0, #30*8 |
| 929 | ldp x30, x1, [x0], #-16 |
| 930 | ldp x28, x29, [x0], #-16 |
| 931 | ldp x26, x27, [x0], #-16 |
| 932 | ldp x24, x25, [x0], #-16 |
| 933 | ldp x22, x23, [x0], #-16 |
| 934 | ldp x20, x21, [x0], #-16 |
| 935 | ldp x18, x19, [x0], #-16 |
| 936 | ldp x16, x17, [x0], #-16 |
| 937 | ldp x14, x15, [x0], #-16 |
| 938 | ldp x12, x13, [x0], #-16 |
| 939 | ldp x10, x11, [x0], #-16 |
| 940 | ldp x8, x9, [x0], #-16 |
| 941 | ldp x6, x7, [x0], #-16 |
| 942 | ldp x4, x5, [x0], #-16 |
| 943 | ldp x2, x3, [x0], #-16 |
| 944 | mov sp, x1 |
| 945 | |
| 946 | // TODO: Is it really OK to use LR for the target PC? |
| 947 | mov x0, #0 |
| 948 | mov x1, #0 |
| 949 | br xLR |
| 950 | END art_quick_do_long_jump |
| 951 | |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 952 | /* |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 953 | * Entry from managed code that calls artLockObjectFromCode, may block for GC. x0 holds the |
| 954 | * possibly null object to lock. |
| 955 | * |
| 956 | * Derived from arm32 code. |
| 957 | */ |
| 958 | .extern artLockObjectFromCode |
| 959 | ENTRY art_quick_lock_object |
| 960 | cbz w0, .Lslow_lock |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 961 | add x4, x0, #MIRROR_OBJECT_LOCK_WORD_OFFSET // exclusive load/store has no immediate anymore |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 962 | .Lretry_lock: |
| 963 | ldr w2, [xSELF, #THREAD_ID_OFFSET] // TODO: Can the thread ID really change during the loop? |
| 964 | ldxr w1, [x4] |
| 965 | cbnz w1, .Lnot_unlocked // already thin locked |
| 966 | stxr w3, w2, [x4] |
| 967 | cbnz w3, .Lstrex_fail // store failed, retry |
Andreas Gampe | 675967d | 2014-05-14 16:28:34 -0700 | [diff] [blame] | 968 | dmb ishld // full (LoadLoad|LoadStore) memory barrier |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 969 | ret |
| 970 | .Lstrex_fail: |
| 971 | b .Lretry_lock // unlikely forward branch, need to reload and recheck r1/r2 |
| 972 | .Lnot_unlocked: |
| 973 | lsr w3, w1, 30 |
| 974 | cbnz w3, .Lslow_lock // if either of the top two bits are set, go slow path |
| 975 | eor w2, w1, w2 // lock_word.ThreadId() ^ self->ThreadId() |
| 976 | uxth w2, w2 // zero top 16 bits |
| 977 | cbnz w2, .Lslow_lock // lock word and self thread id's match -> recursive lock |
| 978 | // else contention, go to slow path |
| 979 | add w2, w1, #65536 // increment count in lock word placing in w2 for storing |
| 980 | lsr w1, w2, 30 // if either of the top two bits are set, we overflowed. |
| 981 | cbnz w1, .Lslow_lock // if we overflow the count go slow path |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 982 | str w2, [x0, #MIRROR_OBJECT_LOCK_WORD_OFFSET] // no need for stxr as we hold the lock |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 983 | ret |
| 984 | .Lslow_lock: |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 985 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case we block |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 986 | mov x1, xSELF // pass Thread::Current |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 987 | bl artLockObjectFromCode // (Object* obj, Thread*) |
| 988 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 989 | RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 990 | END art_quick_lock_object |
| 991 | |
| 992 | /* |
| 993 | * Entry from managed code that calls artUnlockObjectFromCode and delivers exception on failure. |
| 994 | * x0 holds the possibly null object to lock. |
| 995 | * |
| 996 | * Derived from arm32 code. |
| 997 | */ |
| 998 | .extern artUnlockObjectFromCode |
| 999 | ENTRY art_quick_unlock_object |
| 1000 | cbz x0, .Lslow_unlock |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1001 | ldr w1, [x0, #MIRROR_OBJECT_LOCK_WORD_OFFSET] |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 1002 | lsr w2, w1, 30 |
| 1003 | cbnz w2, .Lslow_unlock // if either of the top two bits are set, go slow path |
| 1004 | ldr w2, [xSELF, #THREAD_ID_OFFSET] |
| 1005 | eor w3, w1, w2 // lock_word.ThreadId() ^ self->ThreadId() |
| 1006 | uxth w3, w3 // zero top 16 bits |
| 1007 | cbnz w3, .Lslow_unlock // do lock word and self thread id's match? |
| 1008 | cmp w1, #65536 |
| 1009 | bpl .Lrecursive_thin_unlock |
| 1010 | // transition to unlocked, w3 holds 0 |
Andreas Gampe | 675967d | 2014-05-14 16:28:34 -0700 | [diff] [blame] | 1011 | dmb ish // full (LoadStore|StoreStore) memory barrier |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1012 | str w3, [x0, #MIRROR_OBJECT_LOCK_WORD_OFFSET] |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 1013 | ret |
| 1014 | .Lrecursive_thin_unlock: |
| 1015 | sub w1, w1, #65536 |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1016 | str w1, [x0, #MIRROR_OBJECT_LOCK_WORD_OFFSET] |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 1017 | ret |
| 1018 | .Lslow_unlock: |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1019 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case exception allocation triggers GC |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 1020 | mov x1, xSELF // pass Thread::Current |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1021 | bl artUnlockObjectFromCode // (Object* obj, Thread*) |
| 1022 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 4fc046e | 2014-05-06 16:56:39 -0700 | [diff] [blame] | 1023 | RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1024 | END art_quick_unlock_object |
Andreas Gampe | 525cde2 | 2014-04-22 15:44:50 -0700 | [diff] [blame] | 1025 | |
| 1026 | /* |
| 1027 | * Entry from managed code that calls artIsAssignableFromCode and on failure calls |
| 1028 | * artThrowClassCastException. |
| 1029 | */ |
| 1030 | .extern artThrowClassCastException |
| 1031 | ENTRY art_quick_check_cast |
| 1032 | // Store arguments and link register |
| 1033 | sub sp, sp, #32 // Stack needs to be 16b aligned on calls |
| 1034 | .cfi_adjust_cfa_offset 32 |
| 1035 | stp x0, x1, [sp] |
| 1036 | .cfi_rel_offset x0, 0 |
| 1037 | .cfi_rel_offset x1, 8 |
| 1038 | stp xSELF, xLR, [sp, #16] |
| 1039 | .cfi_rel_offset x18, 16 |
| 1040 | .cfi_rel_offset x30, 24 |
| 1041 | |
| 1042 | // Call runtime code |
| 1043 | bl artIsAssignableFromCode |
| 1044 | |
| 1045 | // Check for exception |
| 1046 | cbz x0, .Lthrow_class_cast_exception |
| 1047 | |
| 1048 | // Restore and return |
| 1049 | ldp x0, x1, [sp] |
| 1050 | .cfi_restore x0 |
| 1051 | .cfi_restore x1 |
| 1052 | ldp xSELF, xLR, [sp, #16] |
| 1053 | .cfi_restore x18 |
| 1054 | .cfi_restore x30 |
| 1055 | add sp, sp, #32 |
| 1056 | .cfi_adjust_cfa_offset -32 |
| 1057 | ret |
| 1058 | |
| 1059 | .Lthrow_class_cast_exception: |
| 1060 | // Restore |
| 1061 | ldp x0, x1, [sp] |
| 1062 | .cfi_restore x0 |
| 1063 | .cfi_restore x1 |
| 1064 | ldp xSELF, xLR, [sp, #16] |
| 1065 | .cfi_restore x18 |
| 1066 | .cfi_restore x30 |
| 1067 | add sp, sp, #32 |
| 1068 | .cfi_adjust_cfa_offset -32 |
| 1069 | |
| 1070 | SETUP_SAVE_ALL_CALLEE_SAVE_FRAME // save all registers as basis for long jump context |
| 1071 | mov x2, xSELF // pass Thread::Current |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1072 | b artThrowClassCastException // (Class*, Class*, Thread*) |
Andreas Gampe | 525cde2 | 2014-04-22 15:44:50 -0700 | [diff] [blame] | 1073 | brk 0 // We should not return here... |
| 1074 | END art_quick_check_cast |
| 1075 | |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1076 | /* |
| 1077 | * Entry from managed code for array put operations of objects where the value being stored |
| 1078 | * needs to be checked for compatibility. |
| 1079 | * x0 = array, x1 = index, x2 = value |
| 1080 | * |
| 1081 | * Currently all values should fit into w0/w1/w2, and w1 always will as indices are 32b. We |
| 1082 | * assume, though, that the upper 32b are zeroed out. At least for x1/w1 we can do better by |
| 1083 | * using index-zero-extension in load/stores. |
| 1084 | * |
| 1085 | * Temporaries: x3, x4 |
| 1086 | * TODO: x4 OK? ip seems wrong here. |
| 1087 | */ |
| 1088 | ENTRY art_quick_aput_obj_with_null_and_bound_check |
| 1089 | tst x0, x0 |
| 1090 | bne art_quick_aput_obj_with_bound_check |
| 1091 | b art_quick_throw_null_pointer_exception |
| 1092 | END art_quick_aput_obj_with_null_and_bound_check |
| 1093 | |
| 1094 | ENTRY art_quick_aput_obj_with_bound_check |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1095 | ldr w3, [x0, #MIRROR_ARRAY_LENGTH_OFFSET] |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1096 | cmp w3, w1 |
| 1097 | bhi art_quick_aput_obj |
| 1098 | mov x0, x1 |
| 1099 | mov x1, x3 |
| 1100 | b art_quick_throw_array_bounds |
| 1101 | END art_quick_aput_obj_with_bound_check |
| 1102 | |
| 1103 | ENTRY art_quick_aput_obj |
| 1104 | cbz x2, .Ldo_aput_null |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1105 | ldr w3, [x0, #MIRROR_OBJECT_CLASS_OFFSET] // Heap reference = 32b |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1106 | // This also zero-extends to x3 |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1107 | ldr w4, [x2, #MIRROR_OBJECT_CLASS_OFFSET] // Heap reference = 32b |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1108 | // This also zero-extends to x4 |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1109 | ldr w3, [x3, #MIRROR_CLASS_COMPONENT_TYPE_OFFSET] // Heap reference = 32b |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1110 | // This also zero-extends to x3 |
| 1111 | cmp w3, w4 // value's type == array's component type - trivial assignability |
| 1112 | bne .Lcheck_assignability |
| 1113 | .Ldo_aput: |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1114 | add x3, x0, #MIRROR_OBJECT_ARRAY_DATA_OFFSET |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1115 | // "Compress" = do nothing |
| 1116 | str w2, [x3, x1, lsl #2] // Heap reference = 32b |
| 1117 | ldr x3, [xSELF, #THREAD_CARD_TABLE_OFFSET] |
| 1118 | lsr x0, x0, #7 |
| 1119 | strb w3, [x3, x0] |
| 1120 | ret |
| 1121 | .Ldo_aput_null: |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1122 | add x3, x0, #MIRROR_OBJECT_ARRAY_DATA_OFFSET |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1123 | // "Compress" = do nothing |
| 1124 | str w2, [x3, x1, lsl #2] // Heap reference = 32b |
| 1125 | ret |
| 1126 | .Lcheck_assignability: |
| 1127 | // Store arguments and link register |
| 1128 | sub sp, sp, #48 // Stack needs to be 16b aligned on calls |
| 1129 | .cfi_adjust_cfa_offset 48 |
| 1130 | stp x0, x1, [sp] |
| 1131 | .cfi_rel_offset x0, 0 |
| 1132 | .cfi_rel_offset x1, 8 |
| 1133 | stp x2, xSELF, [sp, #16] |
| 1134 | .cfi_rel_offset x2, 16 |
| 1135 | .cfi_rel_offset x18, 24 |
| 1136 | str xLR, [sp, #32] |
| 1137 | .cfi_rel_offset x30, 32 |
| 1138 | |
| 1139 | // Call runtime code |
| 1140 | mov x0, x3 // Heap reference, 32b, "uncompress" = do nothing, already zero-extended |
| 1141 | mov x1, x4 // Heap reference, 32b, "uncompress" = do nothing, already zero-extended |
| 1142 | bl artIsAssignableFromCode |
| 1143 | |
| 1144 | // Check for exception |
| 1145 | cbz x0, .Lthrow_array_store_exception |
| 1146 | |
| 1147 | // Restore |
| 1148 | ldp x0, x1, [sp] |
| 1149 | .cfi_restore x0 |
| 1150 | .cfi_restore x1 |
| 1151 | ldp x2, xSELF, [sp, #16] |
| 1152 | .cfi_restore x2 |
| 1153 | .cfi_restore x18 |
| 1154 | ldr xLR, [sp, #32] |
| 1155 | .cfi_restore x30 |
| 1156 | add sp, sp, #48 |
| 1157 | .cfi_adjust_cfa_offset -48 |
| 1158 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1159 | add x3, x0, #MIRROR_OBJECT_ARRAY_DATA_OFFSET |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1160 | // "Compress" = do nothing |
| 1161 | str w2, [x3, x1, lsl #2] // Heap reference = 32b |
| 1162 | ldr x3, [xSELF, #THREAD_CARD_TABLE_OFFSET] |
| 1163 | lsr x0, x0, #7 |
| 1164 | strb w3, [x3, x0] |
| 1165 | ret |
| 1166 | .Lthrow_array_store_exception: |
| 1167 | ldp x0, x1, [sp] |
| 1168 | .cfi_restore x0 |
| 1169 | .cfi_restore x1 |
| 1170 | ldp x2, xSELF, [sp, #16] |
| 1171 | .cfi_restore x2 |
| 1172 | .cfi_restore x18 |
| 1173 | ldr xLR, [sp, #32] |
| 1174 | .cfi_restore x30 |
| 1175 | add sp, sp, #48 |
| 1176 | .cfi_adjust_cfa_offset -48 |
| 1177 | |
| 1178 | SETUP_SAVE_ALL_CALLEE_SAVE_FRAME |
| 1179 | mov x1, x2 // Pass value. |
| 1180 | mov x2, xSELF // Pass Thread::Current. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1181 | b artThrowArrayStoreException // (Object*, Object*, Thread*). |
Andreas Gampe | f4e910b | 2014-04-29 16:55:52 -0700 | [diff] [blame] | 1182 | brk 0 // Unreached. |
| 1183 | END art_quick_aput_obj |
| 1184 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1185 | // Macro to facilitate adding new allocation entrypoints. |
| 1186 | .macro TWO_ARG_DOWNCALL name, entrypoint, return |
| 1187 | .extern \entrypoint |
| 1188 | ENTRY \name |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1189 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 1190 | mov x2, xSELF // pass Thread::Current |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1191 | bl \entrypoint // (uint32_t type_idx, Method* method, Thread*) |
| 1192 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 1193 | \return |
| 1194 | DELIVER_PENDING_EXCEPTION |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1195 | END \name |
| 1196 | .endm |
| 1197 | |
| 1198 | // Macro to facilitate adding new array allocation entrypoints. |
| 1199 | .macro THREE_ARG_DOWNCALL name, entrypoint, return |
| 1200 | .extern \entrypoint |
| 1201 | ENTRY \name |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1202 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 1203 | mov x3, xSELF // pass Thread::Current |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 1204 | bl \entrypoint |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1205 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 00c1e6d | 2014-04-25 15:47:13 -0700 | [diff] [blame] | 1206 | \return |
| 1207 | DELIVER_PENDING_EXCEPTION |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1208 | END \name |
| 1209 | .endm |
| 1210 | |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1211 | // Macros taking opportunity of code similarities for downcalls with referrer. |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1212 | .macro ONE_ARG_REF_DOWNCALL name, entrypoint, return |
| 1213 | .extern \entrypoint |
| 1214 | ENTRY \name |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1215 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 1216 | ldr w1, [sp, #FRAME_SIZE_REFS_ONLY_CALLEE_SAVE] // Load referrer |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1217 | mov x2, xSELF // pass Thread::Current |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1218 | bl \entrypoint // (uint32_t type_idx, Method* method, Thread*, SP) |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1219 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1220 | \return |
| 1221 | END \name |
| 1222 | .endm |
| 1223 | |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1224 | .macro TWO_ARG_REF_DOWNCALL name, entrypoint, return |
| 1225 | .extern \entrypoint |
| 1226 | ENTRY \name |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1227 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 1228 | ldr w2, [sp, #FRAME_SIZE_REFS_ONLY_CALLEE_SAVE] // Load referrer |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1229 | mov x3, xSELF // pass Thread::Current |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1230 | bl \entrypoint |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1231 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1232 | \return |
| 1233 | END \name |
| 1234 | .endm |
| 1235 | |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1236 | .macro THREE_ARG_REF_DOWNCALL name, entrypoint, return |
| 1237 | .extern \entrypoint |
| 1238 | ENTRY \name |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1239 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 1240 | ldr w3, [sp, #FRAME_SIZE_REFS_ONLY_CALLEE_SAVE] // Load referrer |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1241 | mov x4, xSELF // pass Thread::Current |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1242 | bl \entrypoint |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1243 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1244 | \return |
| 1245 | END \name |
| 1246 | .endm |
| 1247 | |
Matteo Franchin | dfd891a | 2014-04-30 12:17:17 +0100 | [diff] [blame] | 1248 | /* |
Vladimir Marko | 3b37073 | 2014-10-09 18:34:28 +0100 | [diff] [blame] | 1249 | * Entry from managed code that calls artHandleFillArrayDataFromCode and delivers exception on |
| 1250 | * failure. |
| 1251 | */ |
| 1252 | TWO_ARG_REF_DOWNCALL art_quick_handle_fill_data, artHandleFillArrayDataFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1253 | |
| 1254 | /* |
Matteo Franchin | dfd891a | 2014-04-30 12:17:17 +0100 | [diff] [blame] | 1255 | * Entry from managed code when uninitialized static storage, this stub will run the class |
| 1256 | * initializer and deliver the exception on error. On success the static storage base is |
| 1257 | * returned. |
| 1258 | */ |
| 1259 | TWO_ARG_DOWNCALL art_quick_initialize_static_storage, artInitializeStaticStorageFromCode, RETURN_IF_RESULT_IS_NON_ZERO |
| 1260 | |
Andreas Gampe | 6aac355 | 2014-06-09 14:55:53 -0700 | [diff] [blame] | 1261 | TWO_ARG_DOWNCALL art_quick_initialize_type, artInitializeTypeFromCode, RETURN_IF_RESULT_IS_NON_ZERO |
| 1262 | TWO_ARG_DOWNCALL art_quick_initialize_type_and_verify_access, artInitializeTypeAndVerifyAccessFromCode, RETURN_IF_RESULT_IS_NON_ZERO |
Matteo Franchin | dfd891a | 2014-04-30 12:17:17 +0100 | [diff] [blame] | 1263 | |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 1264 | ONE_ARG_REF_DOWNCALL art_quick_get_boolean_static, artGetBooleanStaticFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1265 | ONE_ARG_REF_DOWNCALL art_quick_get_byte_static, artGetByteStaticFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1266 | ONE_ARG_REF_DOWNCALL art_quick_get_char_static, artGetCharStaticFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1267 | ONE_ARG_REF_DOWNCALL art_quick_get_short_static, artGetShortStaticFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1268 | ONE_ARG_REF_DOWNCALL art_quick_get32_static, artGet32StaticFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1269 | ONE_ARG_REF_DOWNCALL art_quick_get64_static, artGet64StaticFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1270 | ONE_ARG_REF_DOWNCALL art_quick_get_obj_static, artGetObjStaticFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1271 | |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 1272 | TWO_ARG_REF_DOWNCALL art_quick_get_boolean_instance, artGetBooleanInstanceFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1273 | TWO_ARG_REF_DOWNCALL art_quick_get_byte_instance, artGetByteInstanceFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1274 | TWO_ARG_REF_DOWNCALL art_quick_get_char_instance, artGetCharInstanceFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1275 | TWO_ARG_REF_DOWNCALL art_quick_get_short_instance, artGetShortInstanceFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1276 | TWO_ARG_REF_DOWNCALL art_quick_get32_instance, artGet32InstanceFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1277 | TWO_ARG_REF_DOWNCALL art_quick_get64_instance, artGet64InstanceFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1278 | TWO_ARG_REF_DOWNCALL art_quick_get_obj_instance, artGetObjInstanceFromCode, RETURN_OR_DELIVER_PENDING_EXCEPTION_X1 |
| 1279 | |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 1280 | TWO_ARG_REF_DOWNCALL art_quick_set8_static, artSet8StaticFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1281 | TWO_ARG_REF_DOWNCALL art_quick_set16_static, artSet16StaticFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1282 | TWO_ARG_REF_DOWNCALL art_quick_set32_static, artSet32StaticFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1283 | TWO_ARG_REF_DOWNCALL art_quick_set_obj_static, artSetObjStaticFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1284 | |
Fred Shih | 37f05ef | 2014-07-16 18:38:08 -0700 | [diff] [blame] | 1285 | THREE_ARG_REF_DOWNCALL art_quick_set8_instance, artSet8InstanceFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1286 | THREE_ARG_REF_DOWNCALL art_quick_set16_instance, artSet16InstanceFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1287 | THREE_ARG_REF_DOWNCALL art_quick_set32_instance, artSet32InstanceFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
Stephen Kyle | 0ff20d5 | 2014-10-22 15:23:46 +0100 | [diff] [blame] | 1288 | THREE_ARG_REF_DOWNCALL art_quick_set64_instance, artSet64InstanceFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1289 | THREE_ARG_REF_DOWNCALL art_quick_set_obj_instance, artSetObjInstanceFromCode, RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1290 | |
| 1291 | // This is separated out as the argument order is different. |
| 1292 | .extern artSet64StaticFromCode |
| 1293 | ENTRY art_quick_set64_static |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1294 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves in case of GC |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1295 | mov x3, x1 // Store value |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 1296 | ldr w1, [sp, #FRAME_SIZE_REFS_ONLY_CALLEE_SAVE] // Load referrer |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1297 | mov x2, x3 // Put value param |
| 1298 | mov x3, xSELF // pass Thread::Current |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1299 | bl artSet64StaticFromCode |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1300 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1301 | RETURN_IF_W0_IS_ZERO_OR_DELIVER |
| 1302 | END art_quick_set64_static |
| 1303 | |
Matteo Franchin | dfd891a | 2014-04-30 12:17:17 +0100 | [diff] [blame] | 1304 | /* |
| 1305 | * Entry from managed code to resolve a string, this stub will allocate a String and deliver an |
| 1306 | * exception on error. On success the String is returned. x0 holds the referring method, |
| 1307 | * w1 holds the string index. The fast path check for hit in strings cache has already been |
| 1308 | * performed. |
| 1309 | */ |
| 1310 | TWO_ARG_DOWNCALL art_quick_resolve_string, artResolveStringFromCode, RETURN_IF_RESULT_IS_NON_ZERO |
Andreas Gampe | 6e4e59c | 2014-05-05 20:11:02 -0700 | [diff] [blame] | 1311 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1312 | // Generate the allocation entrypoints for each allocator. |
| 1313 | GENERATE_ALL_ALLOC_ENTRYPOINTS |
| 1314 | |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 1315 | /* |
| 1316 | * Called by managed code when the value in wSUSPEND has been decremented to 0. |
| 1317 | */ |
| 1318 | .extern artTestSuspendFromCode |
| 1319 | ENTRY art_quick_test_suspend |
| 1320 | ldrh w0, [xSELF, #THREAD_FLAGS_OFFSET] // get xSELF->state_and_flags.as_struct.flags |
| 1321 | mov wSUSPEND, #SUSPEND_CHECK_INTERVAL // reset wSUSPEND to SUSPEND_CHECK_INTERVAL |
| 1322 | cbnz w0, .Lneed_suspend // check flags == 0 |
| 1323 | ret // return if flags == 0 |
| 1324 | .Lneed_suspend: |
| 1325 | mov x0, xSELF |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1326 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves for stack crawl |
| 1327 | bl artTestSuspendFromCode // (Thread*) |
| 1328 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME_AND_RETURN |
Zheng Xu | 48241e7 | 2014-05-23 11:52:42 +0800 | [diff] [blame] | 1329 | END art_quick_test_suspend |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1330 | |
Stuart Monteith | d5c78f4 | 2014-06-11 16:44:46 +0100 | [diff] [blame] | 1331 | ENTRY art_quick_implicit_suspend |
| 1332 | mov x0, xSELF |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1333 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME // save callee saves for stack crawl |
| 1334 | bl artTestSuspendFromCode // (Thread*) |
| 1335 | RESTORE_REFS_ONLY_CALLEE_SAVE_FRAME_AND_RETURN |
Stuart Monteith | d5c78f4 | 2014-06-11 16:44:46 +0100 | [diff] [blame] | 1336 | END art_quick_implicit_suspend |
| 1337 | |
Andreas Gampe | e62a07e | 2014-03-26 14:53:21 -0700 | [diff] [blame] | 1338 | /* |
| 1339 | * Called by managed code that is attempting to call a method on a proxy class. On entry |
| 1340 | * x0 holds the proxy method and x1 holds the receiver; The frame size of the invoked proxy |
| 1341 | * method agrees with a ref and args callee save frame. |
| 1342 | */ |
| 1343 | .extern artQuickProxyInvokeHandler |
| 1344 | ENTRY art_quick_proxy_invoke_handler |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1345 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_WITH_METHOD_IN_X0 |
Andreas Gampe | e62a07e | 2014-03-26 14:53:21 -0700 | [diff] [blame] | 1346 | mov x2, xSELF // pass Thread::Current |
| 1347 | mov x3, sp // pass SP |
| 1348 | bl artQuickProxyInvokeHandler // (Method* proxy method, receiver, Thread*, SP) |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1349 | // Use xETR as xSELF might be scratched by native function above. |
| 1350 | ldr x2, [xETR, THREAD_EXCEPTION_OFFSET] |
Andreas Gampe | e62a07e | 2014-03-26 14:53:21 -0700 | [diff] [blame] | 1351 | cbnz x2, .Lexception_in_proxy // success if no exception is pending |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1352 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME // Restore frame |
Andreas Gampe | d1e9167 | 2014-06-02 22:50:05 -0700 | [diff] [blame] | 1353 | fmov d0, x0 // Store result in d0 in case it was float or double |
Andreas Gampe | e62a07e | 2014-03-26 14:53:21 -0700 | [diff] [blame] | 1354 | ret // return on success |
| 1355 | .Lexception_in_proxy: |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1356 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Andreas Gampe | e62a07e | 2014-03-26 14:53:21 -0700 | [diff] [blame] | 1357 | DELIVER_PENDING_EXCEPTION |
| 1358 | END art_quick_proxy_invoke_handler |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1359 | |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 1360 | /* |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1361 | * Called to resolve an imt conflict. xIP1 is a hidden argument that holds the target method's |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 1362 | * dex method index. |
| 1363 | */ |
| 1364 | ENTRY art_quick_imt_conflict_trampoline |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 1365 | ldr w0, [sp, #0] // load caller Method* |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1366 | ldr w0, [x0, #MIRROR_ART_METHOD_DEX_CACHE_METHODS_OFFSET] // load dex_cache_resolved_methods |
| 1367 | add x0, x0, #MIRROR_OBJECT_ARRAY_DATA_OFFSET // get starting address of data |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1368 | ldr w0, [x0, xIP1, lsl 2] // load the target method |
Andreas Gampe | 51f7635 | 2014-05-21 08:28:48 -0700 | [diff] [blame] | 1369 | b art_quick_invoke_interface_trampoline |
| 1370 | END art_quick_imt_conflict_trampoline |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1371 | |
| 1372 | ENTRY art_quick_resolution_trampoline |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1373 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1374 | mov x2, xSELF |
| 1375 | mov x3, sp |
| 1376 | bl artQuickResolutionTrampoline // (called, receiver, Thread*, SP) |
Matteo Franchin | dfd891a | 2014-04-30 12:17:17 +0100 | [diff] [blame] | 1377 | cbz x0, 1f |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1378 | mov xIP0, x0 // Remember returned code pointer in xIP0. |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 1379 | ldr w0, [sp, #0] // artQuickResolutionTrampoline puts called method in *SP. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1380 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1381 | br xIP0 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1382 | 1: |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1383 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1384 | DELIVER_PENDING_EXCEPTION |
| 1385 | END art_quick_resolution_trampoline |
| 1386 | |
| 1387 | /* |
| 1388 | * Generic JNI frame layout: |
| 1389 | * |
| 1390 | * #-------------------# |
| 1391 | * | | |
| 1392 | * | caller method... | |
| 1393 | * #-------------------# <--- SP on entry |
| 1394 | * | Return X30/LR | |
| 1395 | * | X29/FP | callee save |
| 1396 | * | X28 | callee save |
| 1397 | * | X27 | callee save |
| 1398 | * | X26 | callee save |
| 1399 | * | X25 | callee save |
| 1400 | * | X24 | callee save |
| 1401 | * | X23 | callee save |
| 1402 | * | X22 | callee save |
| 1403 | * | X21 | callee save |
| 1404 | * | X20 | callee save |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1405 | * | X7 | arg7 |
| 1406 | * | X6 | arg6 |
| 1407 | * | X5 | arg5 |
| 1408 | * | X4 | arg4 |
| 1409 | * | X3 | arg3 |
| 1410 | * | X2 | arg2 |
| 1411 | * | X1 | arg1 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1412 | * | D7 | float arg 8 |
| 1413 | * | D6 | float arg 7 |
| 1414 | * | D5 | float arg 6 |
| 1415 | * | D4 | float arg 5 |
| 1416 | * | D3 | float arg 4 |
| 1417 | * | D2 | float arg 3 |
| 1418 | * | D1 | float arg 2 |
| 1419 | * | D0 | float arg 1 |
Andreas Gampe | cf4035a | 2014-05-28 22:43:01 -0700 | [diff] [blame] | 1420 | * | Method* | <- X0 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1421 | * #-------------------# |
| 1422 | * | local ref cookie | // 4B |
Mathieu Chartier | 421c537 | 2014-05-14 14:11:40 -0700 | [diff] [blame] | 1423 | * | handle scope size | // 4B |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1424 | * #-------------------# |
| 1425 | * | JNI Call Stack | |
| 1426 | * #-------------------# <--- SP on native call |
| 1427 | * | | |
| 1428 | * | Stack for Regs | The trampoline assembly will pop these values |
| 1429 | * | | into registers for native call |
| 1430 | * #-------------------# |
| 1431 | * | Native code ptr | |
| 1432 | * #-------------------# |
| 1433 | * | Free scratch | |
| 1434 | * #-------------------# |
| 1435 | * | Ptr to (1) | <--- SP |
| 1436 | * #-------------------# |
| 1437 | */ |
| 1438 | /* |
| 1439 | * Called to do a generic JNI down-call |
| 1440 | */ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 1441 | ENTRY art_quick_generic_jni_trampoline |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1442 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME_WITH_METHOD_IN_X0 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1443 | |
| 1444 | // Save SP , so we can have static CFI info. |
| 1445 | mov x28, sp |
| 1446 | .cfi_def_cfa_register x28 |
| 1447 | |
| 1448 | // This looks the same, but is different: this will be updated to point to the bottom |
Mathieu Chartier | eb8167a | 2014-05-07 15:43:14 -0700 | [diff] [blame] | 1449 | // of the frame when the handle scope is inserted. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1450 | mov xFP, sp |
| 1451 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1452 | mov xIP0, #5120 |
| 1453 | sub sp, sp, xIP0 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1454 | |
| 1455 | // prepare for artQuickGenericJniTrampoline call |
| 1456 | // (Thread*, SP) |
| 1457 | // x0 x1 <= C calling convention |
| 1458 | // xSELF xFP <= where they are |
| 1459 | |
| 1460 | mov x0, xSELF // Thread* |
| 1461 | mov x1, xFP |
| 1462 | bl artQuickGenericJniTrampoline // (Thread*, sp) |
| 1463 | |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1464 | // The C call will have registered the complete save-frame on success. |
| 1465 | // The result of the call is: |
| 1466 | // x0: pointer to native code, 0 on error. |
| 1467 | // x1: pointer to the bottom of the used area of the alloca, can restore stack till there. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1468 | |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1469 | // Check for error = 0. |
| 1470 | cbz x0, .Lentry_error |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1471 | |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1472 | // Release part of the alloca. |
| 1473 | mov sp, x1 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1474 | |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1475 | // Save the code pointer |
| 1476 | mov xIP0, x0 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1477 | |
| 1478 | // Load parameters from frame into registers. |
| 1479 | // TODO Check with artQuickGenericJniTrampoline. |
| 1480 | // Also, check again APPCS64 - the stack arguments are interleaved. |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1481 | ldp x0, x1, [sp] |
| 1482 | ldp x2, x3, [sp, #16] |
| 1483 | ldp x4, x5, [sp, #32] |
| 1484 | ldp x6, x7, [sp, #48] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1485 | |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1486 | ldp d0, d1, [sp, #64] |
| 1487 | ldp d2, d3, [sp, #80] |
| 1488 | ldp d4, d5, [sp, #96] |
| 1489 | ldp d6, d7, [sp, #112] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1490 | |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1491 | add sp, sp, #128 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1492 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1493 | blr xIP0 // native call. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1494 | |
| 1495 | // result sign extension is handled in C code |
| 1496 | // prepare for artQuickGenericJniEndTrampoline call |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1497 | // (Thread*, result, result_f) |
| 1498 | // x0 x1 x2 <= C calling convention |
| 1499 | mov x1, x0 // Result (from saved) |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1500 | mov x0, xETR // Thread register, original xSELF might be scratched by native code. |
Andreas Gampe | c200a4a | 2014-06-16 18:39:09 -0700 | [diff] [blame] | 1501 | fmov x2, d0 // d0 will contain floating point result, but needs to go into x2 |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1502 | |
| 1503 | bl artQuickGenericJniEndTrampoline |
| 1504 | |
| 1505 | // Tear down the alloca. |
| 1506 | mov sp, x28 |
| 1507 | .cfi_def_cfa_register sp |
| 1508 | |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1509 | // Pending exceptions possible. |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1510 | // Use xETR as xSELF might be scratched by native code |
| 1511 | ldr x1, [xETR, THREAD_EXCEPTION_OFFSET] |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1512 | cbnz x1, .Lexception_in_native |
| 1513 | |
| 1514 | // Tear down the callee-save frame. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1515 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1516 | |
| 1517 | // store into fpr, for when it's a fpr return... |
| 1518 | fmov d0, x0 |
| 1519 | ret |
| 1520 | |
| 1521 | .Lentry_error: |
| 1522 | mov sp, x28 |
| 1523 | .cfi_def_cfa_register sp |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1524 | .Lexception_in_native: |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1525 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1526 | DELIVER_PENDING_EXCEPTION |
| 1527 | |
| 1528 | END art_quick_generic_jni_trampoline |
| 1529 | |
| 1530 | /* |
| 1531 | * Called to bridge from the quick to interpreter ABI. On entry the arguments match those |
| 1532 | * of a quick call: |
| 1533 | * x0 = method being called/to bridge to. |
| 1534 | * x1..x7, d0..d7 = arguments to that method. |
| 1535 | */ |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 1536 | ENTRY art_quick_to_interpreter_bridge |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1537 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME // Set up frame and save arguments. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1538 | |
| 1539 | // x0 will contain mirror::ArtMethod* method. |
| 1540 | mov x1, xSELF // How to get Thread::Current() ??? |
| 1541 | mov x2, sp |
| 1542 | |
| 1543 | // uint64_t artQuickToInterpreterBridge(mirror::ArtMethod* method, Thread* self, |
| 1544 | // mirror::ArtMethod** sp) |
| 1545 | bl artQuickToInterpreterBridge |
| 1546 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1547 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME // TODO: no need to restore arguments in this case. |
Stuart Monteith | b95a534 | 2014-03-12 13:32:32 +0000 | [diff] [blame] | 1548 | |
| 1549 | fmov d0, x0 |
| 1550 | |
| 1551 | RETURN_OR_DELIVER_PENDING_EXCEPTION |
| 1552 | END art_quick_to_interpreter_bridge |
| 1553 | |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1554 | |
| 1555 | // |
| 1556 | // Instrumentation-related stubs |
| 1557 | // |
| 1558 | .extern artInstrumentationMethodEntryFromCode |
| 1559 | ENTRY art_quick_instrumentation_entry |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1560 | SETUP_REFS_AND_ARGS_CALLEE_SAVE_FRAME |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1561 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1562 | mov x20, x0 // Preserve method reference in a callee-save. |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1563 | |
| 1564 | mov x2, xSELF |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1565 | mov x3, xLR |
| 1566 | bl artInstrumentationMethodEntryFromCode // (Method*, Object*, Thread*, LR) |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1567 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1568 | mov xIP0, x0 // x0 = result of call. |
| 1569 | mov x0, x20 // Reload method reference. |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1570 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1571 | RESTORE_REFS_AND_ARGS_CALLEE_SAVE_FRAME // Note: will restore xSELF |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1572 | adr xLR, art_quick_instrumentation_exit |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1573 | br xIP0 // Tail-call method with lr set to art_quick_instrumentation_exit. |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1574 | END art_quick_instrumentation_entry |
| 1575 | |
| 1576 | .extern artInstrumentationMethodExitFromCode |
| 1577 | ENTRY art_quick_instrumentation_exit |
| 1578 | mov xLR, #0 // Clobber LR for later checks. |
| 1579 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1580 | SETUP_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1581 | |
| 1582 | // We need to save x0 and d0. We could use a callee-save from SETUP_REF_ONLY, but then |
| 1583 | // we would need to fully restore it. As there are a lot of callee-save registers, it seems |
| 1584 | // easier to have an extra small stack area. |
| 1585 | |
Sebastien Hertz | 70f8d4b | 2014-06-19 11:51:41 +0200 | [diff] [blame] | 1586 | str x0, [sp, #-16]! // Save integer result. |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1587 | .cfi_adjust_cfa_offset 16 |
| 1588 | str d0, [sp, #8] // Save floating-point result. |
| 1589 | |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1590 | add x1, sp, #16 // Pass SP. |
| 1591 | mov x2, x0 // Pass integer result. |
| 1592 | fmov x3, d0 // Pass floating-point result. |
Sebastien Hertz | 70f8d4b | 2014-06-19 11:51:41 +0200 | [diff] [blame] | 1593 | mov x0, xSELF // Pass Thread. |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1594 | bl artInstrumentationMethodExitFromCode // (Thread*, SP, gpr_res, fpr_res) |
| 1595 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1596 | mov xIP0, x0 // Return address from instrumentation call. |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1597 | mov xLR, x1 // r1 is holding link register if we're to bounce to deoptimize |
| 1598 | |
| 1599 | ldr d0, [sp, #8] // Restore floating-point result. |
| 1600 | ldr x0, [sp], 16 // Restore integer result, and drop stack area. |
| 1601 | .cfi_adjust_cfa_offset 16 |
| 1602 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1603 | POP_REFS_ONLY_CALLEE_SAVE_FRAME |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1604 | |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1605 | br xIP0 // Tail-call out. |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1606 | END art_quick_instrumentation_exit |
| 1607 | |
| 1608 | /* |
| 1609 | * Instrumentation has requested that we deoptimize into the interpreter. The deoptimization |
| 1610 | * will long jump to the upcall with a special exception of -1. |
| 1611 | */ |
| 1612 | .extern artDeoptimize |
| 1613 | ENTRY art_quick_deoptimize |
| 1614 | SETUP_SAVE_ALL_CALLEE_SAVE_FRAME |
| 1615 | mov x0, xSELF // Pass thread. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1616 | bl artDeoptimize // artDeoptimize(Thread*) |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 1617 | brk 0 |
Andreas Gampe | d58342c | 2014-06-05 14:18:08 -0700 | [diff] [blame] | 1618 | END art_quick_deoptimize |
| 1619 | |
| 1620 | |
Serban Constantinescu | 169489b | 2014-06-11 16:43:35 +0100 | [diff] [blame] | 1621 | /* |
| 1622 | * String's indexOf. |
| 1623 | * |
| 1624 | * TODO: Not very optimized. |
| 1625 | * On entry: |
| 1626 | * x0: string object (known non-null) |
| 1627 | * w1: char to match (known <= 0xFFFF) |
| 1628 | * w2: Starting offset in string data |
| 1629 | */ |
| 1630 | ENTRY art_quick_indexof |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1631 | ldr w3, [x0, #MIRROR_STRING_COUNT_OFFSET] |
| 1632 | ldr w4, [x0, #MIRROR_STRING_OFFSET_OFFSET] |
| 1633 | ldr w0, [x0, #MIRROR_STRING_VALUE_OFFSET] // x0 ? |
Serban Constantinescu | 169489b | 2014-06-11 16:43:35 +0100 | [diff] [blame] | 1634 | |
| 1635 | /* Clamp start to [0..count] */ |
| 1636 | cmp w2, #0 |
| 1637 | csel w2, wzr, w2, lt |
| 1638 | cmp w2, w3 |
| 1639 | csel w2, w3, w2, gt |
| 1640 | |
| 1641 | /* Build a pointer to the start of the string data */ |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1642 | add x0, x0, #MIRROR_CHAR_ARRAY_DATA_OFFSET |
Serban Constantinescu | 169489b | 2014-06-11 16:43:35 +0100 | [diff] [blame] | 1643 | add x0, x0, x4, lsl #1 |
| 1644 | |
| 1645 | /* Save a copy to compute result */ |
| 1646 | mov x5, x0 |
| 1647 | |
| 1648 | /* Build pointer to start of data to compare and pre-bias */ |
| 1649 | add x0, x0, x2, lsl #1 |
| 1650 | sub x0, x0, #2 |
| 1651 | |
| 1652 | /* Compute iteration count */ |
| 1653 | sub w2, w3, w2 |
| 1654 | |
| 1655 | /* |
| 1656 | * At this point we have: |
| 1657 | * x0: start of the data to test |
| 1658 | * w1: char to compare |
| 1659 | * w2: iteration count |
| 1660 | * x5: original start of string data |
| 1661 | */ |
| 1662 | |
| 1663 | subs w2, w2, #4 |
| 1664 | b.lt .Lindexof_remainder |
| 1665 | |
| 1666 | .Lindexof_loop4: |
| 1667 | ldrh w6, [x0, #2]! |
| 1668 | ldrh w7, [x0, #2]! |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1669 | ldrh wIP0, [x0, #2]! |
| 1670 | ldrh wIP1, [x0, #2]! |
Serban Constantinescu | 169489b | 2014-06-11 16:43:35 +0100 | [diff] [blame] | 1671 | cmp w6, w1 |
| 1672 | b.eq .Lmatch_0 |
| 1673 | cmp w7, w1 |
| 1674 | b.eq .Lmatch_1 |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1675 | cmp wIP0, w1 |
Serban Constantinescu | 169489b | 2014-06-11 16:43:35 +0100 | [diff] [blame] | 1676 | b.eq .Lmatch_2 |
Zheng Xu | b551fdc | 2014-07-25 11:49:42 +0800 | [diff] [blame] | 1677 | cmp wIP1, w1 |
Serban Constantinescu | 169489b | 2014-06-11 16:43:35 +0100 | [diff] [blame] | 1678 | b.eq .Lmatch_3 |
| 1679 | subs w2, w2, #4 |
| 1680 | b.ge .Lindexof_loop4 |
| 1681 | |
| 1682 | .Lindexof_remainder: |
| 1683 | adds w2, w2, #4 |
| 1684 | b.eq .Lindexof_nomatch |
| 1685 | |
| 1686 | .Lindexof_loop1: |
| 1687 | ldrh w6, [x0, #2]! |
| 1688 | cmp w6, w1 |
| 1689 | b.eq .Lmatch_3 |
| 1690 | subs w2, w2, #1 |
| 1691 | b.ne .Lindexof_loop1 |
| 1692 | |
| 1693 | .Lindexof_nomatch: |
| 1694 | mov x0, #-1 |
| 1695 | ret |
| 1696 | |
| 1697 | .Lmatch_0: |
| 1698 | sub x0, x0, #6 |
| 1699 | sub x0, x0, x5 |
| 1700 | asr x0, x0, #1 |
| 1701 | ret |
| 1702 | .Lmatch_1: |
| 1703 | sub x0, x0, #4 |
| 1704 | sub x0, x0, x5 |
| 1705 | asr x0, x0, #1 |
| 1706 | ret |
| 1707 | .Lmatch_2: |
| 1708 | sub x0, x0, #2 |
| 1709 | sub x0, x0, x5 |
| 1710 | asr x0, x0, #1 |
| 1711 | ret |
| 1712 | .Lmatch_3: |
| 1713 | sub x0, x0, x5 |
| 1714 | asr x0, x0, #1 |
| 1715 | ret |
| 1716 | END art_quick_indexof |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1717 | |
| 1718 | /* |
| 1719 | * String's compareTo. |
| 1720 | * |
| 1721 | * TODO: Not very optimized. |
| 1722 | * |
| 1723 | * On entry: |
| 1724 | * x0: this object pointer |
| 1725 | * x1: comp object pointer |
| 1726 | * |
| 1727 | */ |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 1728 | .extern __memcmp16 |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1729 | ENTRY art_quick_string_compareto |
| 1730 | mov x2, x0 // x0 is return, use x2 for first input. |
| 1731 | sub x0, x2, x1 // Same string object? |
| 1732 | cbnz x0,1f |
| 1733 | ret |
| 1734 | 1: // Different string objects. |
| 1735 | |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1736 | ldr w6, [x2, #MIRROR_STRING_OFFSET_OFFSET] |
| 1737 | ldr w5, [x1, #MIRROR_STRING_OFFSET_OFFSET] |
| 1738 | ldr w4, [x2, #MIRROR_STRING_COUNT_OFFSET] |
| 1739 | ldr w3, [x1, #MIRROR_STRING_COUNT_OFFSET] |
| 1740 | ldr w2, [x2, #MIRROR_STRING_VALUE_OFFSET] |
| 1741 | ldr w1, [x1, #MIRROR_STRING_VALUE_OFFSET] |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1742 | |
| 1743 | /* |
| 1744 | * Now: CharArray* Offset Count |
| 1745 | * first arg x2 w6 w4 |
| 1746 | * second arg x1 w5 w3 |
| 1747 | */ |
| 1748 | |
| 1749 | // x0 := str1.length(w4) - str2.length(w3). ldr zero-extended w3/w4 into x3/x4. |
| 1750 | subs x0, x4, x3 |
| 1751 | // Min(count1, count2) into w3. |
| 1752 | csel x3, x3, x4, ge |
| 1753 | |
| 1754 | // Build pointer into string data. |
| 1755 | |
| 1756 | // Add offset in array (substr etc.) (sign extend and << 1). |
| 1757 | add x2, x2, w6, sxtw #1 |
| 1758 | add x1, x1, w5, sxtw #1 |
| 1759 | |
| 1760 | // Add offset in CharArray to array. |
Ian Rogers | 1d8cdbc | 2014-09-22 22:51:09 -0700 | [diff] [blame] | 1761 | add x2, x2, #MIRROR_CHAR_ARRAY_DATA_OFFSET |
| 1762 | add x1, x1, #MIRROR_CHAR_ARRAY_DATA_OFFSET |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1763 | |
Serban Constantinescu | 169489b | 2014-06-11 16:43:35 +0100 | [diff] [blame] | 1764 | // TODO: Tune this value. |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1765 | // Check for long string, do memcmp16 for them. |
| 1766 | cmp w3, #28 // Constant from arm32. |
| 1767 | bgt .Ldo_memcmp16 |
| 1768 | |
| 1769 | /* |
| 1770 | * Now: |
| 1771 | * x2: *first string data |
| 1772 | * x1: *second string data |
| 1773 | * w3: iteration count |
| 1774 | * x0: return value if comparison equal |
| 1775 | * x4, x5, x6, x7: free |
| 1776 | */ |
| 1777 | |
| 1778 | // Do a simple unrolled loop. |
| 1779 | .Lloop: |
| 1780 | // At least two more elements? |
| 1781 | subs w3, w3, #2 |
| 1782 | b.lt .Lremainder_or_done |
| 1783 | |
| 1784 | ldrh w4, [x2], #2 |
| 1785 | ldrh w5, [x1], #2 |
| 1786 | |
| 1787 | ldrh w6, [x2], #2 |
| 1788 | ldrh w7, [x1], #2 |
| 1789 | |
| 1790 | subs w4, w4, w5 |
| 1791 | b.ne .Lw4_result |
| 1792 | |
| 1793 | subs w6, w6, w7 |
| 1794 | b.ne .Lw6_result |
| 1795 | |
| 1796 | b .Lloop |
| 1797 | |
| 1798 | .Lremainder_or_done: |
| 1799 | adds w3, w3, #1 |
| 1800 | b.eq .Lremainder |
| 1801 | ret |
| 1802 | |
| 1803 | .Lremainder: |
| 1804 | ldrh w4, [x2], #2 |
| 1805 | ldrh w5, [x1], #2 |
| 1806 | subs w4, w4, w5 |
| 1807 | b.ne .Lw4_result |
| 1808 | ret |
| 1809 | |
| 1810 | // Result is in w4 |
| 1811 | .Lw4_result: |
| 1812 | sxtw x0, w4 |
| 1813 | ret |
| 1814 | |
| 1815 | // Result is in w6 |
| 1816 | .Lw6_result: |
| 1817 | sxtw x0, w6 |
| 1818 | ret |
| 1819 | |
| 1820 | .Ldo_memcmp16: |
Zheng Xu | 62ddb32 | 2014-08-12 17:19:12 +0800 | [diff] [blame] | 1821 | mov x14, x0 // Save x0 and LR. __memcmp16 does not use these temps. |
| 1822 | mov x15, xLR // TODO: Codify and check that? |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1823 | |
| 1824 | mov x0, x2 |
| 1825 | uxtw x2, w3 |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 1826 | bl __memcmp16 |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1827 | |
Zheng Xu | 62ddb32 | 2014-08-12 17:19:12 +0800 | [diff] [blame] | 1828 | mov xLR, x15 // Restore LR. |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1829 | |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 1830 | cmp x0, #0 // Check the memcmp difference. |
Zheng Xu | 62ddb32 | 2014-08-12 17:19:12 +0800 | [diff] [blame] | 1831 | csel x0, x0, x14, ne // x0 := x0 != 0 ? x14(prev x0=length diff) : x1. |
Andreas Gampe | 266340d | 2014-05-02 07:55:24 -0700 | [diff] [blame] | 1832 | ret |
| 1833 | END art_quick_string_compareto |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 1834 | |
| 1835 | // Macro to facilitate adding new entrypoints which call to native function directly. |
| 1836 | // Currently, xSELF is the only thing we need to take care of between managed code and AAPCS. |
| 1837 | // But we might introduce more differences. |
| 1838 | .macro NATIVE_DOWNCALL name, entrypoint |
| 1839 | .extern \entrypoint |
| 1840 | ENTRY \name |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 1841 | stp xSELF, xLR, [sp, #-16]! |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 1842 | bl \entrypoint |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 1843 | ldp xSELF, xLR, [sp], #16 |
Zheng Xu | 0210d11 | 2014-06-17 12:25:48 +0800 | [diff] [blame] | 1844 | ret |
| 1845 | END \name |
| 1846 | .endm |
| 1847 | |
| 1848 | NATIVE_DOWNCALL art_quick_fmod fmod |
| 1849 | NATIVE_DOWNCALL art_quick_fmodf fmodf |
| 1850 | NATIVE_DOWNCALL art_quick_memcpy memcpy |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 1851 | NATIVE_DOWNCALL art_quick_assignable_from_code artIsAssignableFromCode |