Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 1 | #include "asm_support.h" |
| 2 | |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 3 | #if defined(__arm__) |
| 4 | |
| 5 | .balign 4 |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 6 | |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 7 | /* Deliver the given exception */ |
| 8 | .extern artDeliverExceptionFromCode |
| 9 | /* Deliver an exception pending on a thread */ |
| 10 | .extern artDeliverPendingException |
| 11 | |
| 12 | .global art_deliver_exception_from_code |
Ian Rogers | bdb0391 | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 13 | /* |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 14 | * Called by managed code, saves mosts registers (forms basis of long jump context) and passes |
| 15 | * the bottom of the stack. artDeliverExceptionFromCode will place the callee save Method* at |
| 16 | * the bottom of the thread. On entry r0 holds Throwable* |
Ian Rogers | bdb0391 | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 17 | */ |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 18 | art_deliver_exception_from_code: |
Ian Rogers | bdb0391 | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 19 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 20 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 21 | mov r1, r9 @ pass Thread::Current |
| 22 | mov r2, sp @ pass SP |
| 23 | b artDeliverExceptionFromCode @ artDeliverExceptionFromCode(Throwable*, Thread*, SP) |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 24 | |
| 25 | .global art_throw_null_pointer_exception_from_code |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 26 | .extern artThrowNullPointerExceptionFromCode |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 27 | /* |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 28 | * Called by managed code to create and deliver a NullPointerException |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 29 | */ |
| 30 | art_throw_null_pointer_exception_from_code: |
| 31 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 32 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 33 | mov r0, r9 @ pass Thread::Current |
| 34 | mov r1, sp @ pass SP |
| 35 | b artThrowNullPointerExceptionFromCode @ artThrowNullPointerExceptionFromCode(Thread*, SP) |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 36 | |
| 37 | .global art_throw_div_zero_from_code |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 38 | .extern artThrowDivZeroFromCode |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 39 | /* |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 40 | * Called by managed code to create and deliver an ArithmeticException |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 41 | */ |
| 42 | art_throw_div_zero_from_code: |
| 43 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 44 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 45 | mov r0, r9 @ pass Thread::Current |
| 46 | mov r1, sp @ pass SP |
| 47 | b artThrowDivZeroFromCode @ artThrowDivZeroFromCode(Thread*, SP) |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 48 | |
| 49 | .global art_throw_array_bounds_from_code |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 50 | .extern artThrowArrayBoundsFromCode |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 51 | /* |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 52 | * Called by managed code to create and deliver an ArrayIndexOutOfBoundsException |
Ian Rogers | 9651f42 | 2011-09-19 20:26:07 -0700 | [diff] [blame] | 53 | */ |
| 54 | art_throw_array_bounds_from_code: |
| 55 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 56 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 57 | mov r2, r9 @ pass Thread::Current |
| 58 | mov r3, sp @ pass SP |
| 59 | b artThrowArrayBoundsFromCode @ artThrowArrayBoundsFromCode(index, limit, Thread*, SP) |
Ian Rogers | bdb0391 | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 60 | |
Ian Rogers | 932746a | 2011-09-22 18:57:50 -0700 | [diff] [blame] | 61 | .global art_throw_stack_overflow_from_code |
| 62 | .extern artThrowStackOverflowFromCode |
| 63 | art_throw_stack_overflow_from_code: |
| 64 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
| 65 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 66 | mov r1, r9 @ pass Thread::Current |
| 67 | mov r2, sp @ pass SP |
| 68 | b artThrowStackOverflowFromCode @ artThrowStackOverflowFromCode(method, Thread*, SP) |
| 69 | |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 70 | .global art_invoke_interface_trampoline |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 71 | .extern artFindInterfaceMethodInCacheFromCode |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 72 | /* |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 73 | * All generated callsites for interface invokes will load arguments as usual - except instead |
| 74 | * of loading arg0/r0 with the target Method*, arg0/r0 will contain the method_idx. This |
| 75 | * wrapper will save arg1-arg3, load the caller's Method*, align the stack and call the helper |
| 76 | * artFindInterfaceMethodInCacheFromCode(idx, this, method); |
| 77 | * NOTE: "this" is first visable argument of the target, and so can be found in arg1/r1. |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 78 | * |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 79 | * artFindInterfaceMethodInCacheFromCode will attempt to locate the target and return a 64-bit |
| 80 | * result in r0/r1 consisting of the target Method* in r0 and method->code_ in r1. |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 81 | * |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 82 | * If unsuccessful, artFindInterfaceMethodInCacheFromCode will return NULL/NULL. There will be |
| 83 | * a pending exception in the thread and we branch to another stub to deliver it. |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 84 | * |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 85 | * On success this wrapper will restore arguments and *jump* to the target, leaving the lr |
| 86 | * pointing back to the original caller. |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 87 | */ |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 88 | art_invoke_interface_trampoline: |
| 89 | str sp, [R9, #THREAD_TOP_OF_MANAGED_STACK_OFFSET] @ record top of stack and pc in case of |
| 90 | str lr, [R9, #THREAD_TOP_OF_MANAGED_STACK_PC_OFFSET] @ walking stack |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 91 | stmdb sp!, {r1, r2, r3, lr} |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 92 | ldr r2, [sp, #16] @ load caller's Method* |
| 93 | bl artFindInterfaceMethodInCacheFromCode @ (method_idx, this, callerMethod) |
| 94 | mov r12, r1 @ save r0->code_ |
| 95 | ldmia sp!, {r1, r2, r3, lr} @ restore arguments |
| 96 | cmp r0, #0 @ did we find the target? |
| 97 | bxne r12 @ tail call to target if so |
| 98 | @ set up for throwing exception |
| 99 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
| 100 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 101 | mov r0, r9 @ pass Thread::Current |
| 102 | mov r1, sp @ pass SP |
| 103 | b artDeliverPendingExceptionFromCode @ artDeliverPendingExceptionFromCode(Thread*, SP) |
| 104 | |
| 105 | .global art_handle_fill_data_from_code |
| 106 | .extern artHandleFillArrayDataFromCode |
| 107 | /* |
| 108 | * Entry from managed code that calls artHandleFillArrayDataFromCode and delivers exception on |
| 109 | * failure. |
| 110 | */ |
| 111 | art_handle_fill_data_from_code: |
| 112 | str sp, [R9, #THREAD_TOP_OF_MANAGED_STACK_OFFSET] @ record top of stack and pc in case of |
| 113 | str lr, [R9, #THREAD_TOP_OF_MANAGED_STACK_PC_OFFSET] @ walking stack |
| 114 | stmdb sp!, {lr} @ Save LR |
| 115 | sub sp, #12 @ Align stack |
| 116 | bl artHandleFillArrayDataFromCode @ (Array* array, const uint16_t* table) |
| 117 | add sp, #12 |
| 118 | ldmia sp!, {lr} @ restore LR |
| 119 | cmp r0, #0 @ success? |
| 120 | moveq pc, lr @ return on success |
| 121 | @ set up for throwing exception |
| 122 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
| 123 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 124 | mov r0, r9 @ pass Thread::Current |
| 125 | mov r1, sp @ pass SP |
| 126 | b artDeliverPendingExceptionFromCode @ artDeliverPendingExceptionFromCode(Thread*, SP) |
| 127 | |
| 128 | .global art_unlock_object_from_code |
| 129 | .extern artUnlockObjectFromCode |
| 130 | /* |
| 131 | * Entry from managed code that calls artUnlockObjectFromCode and delivers exception on failure. |
| 132 | */ |
| 133 | art_unlock_object_from_code: |
| 134 | str sp, [R9, #THREAD_TOP_OF_MANAGED_STACK_OFFSET] @ record top of stack and pc in case of |
| 135 | str lr, [R9, #THREAD_TOP_OF_MANAGED_STACK_PC_OFFSET] @ walking stack |
| 136 | stmdb sp!, {lr} @ Save LR |
| 137 | sub sp, #12 @ Align stack |
| 138 | bl artUnlockObjectFromCode @ (Thread* thread, Object* obj) |
| 139 | add sp, #12 |
| 140 | ldmia sp!, {lr} @ restore LR |
| 141 | cmp r0, #0 @ success? |
| 142 | moveq pc, lr @ return on success |
| 143 | @ set up for throwing exception |
| 144 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
| 145 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 146 | mov r0, r9 @ pass Thread::Current |
| 147 | mov r1, sp @ pass SP |
| 148 | b artDeliverPendingExceptionFromCode @ artDeliverPendingExceptionFromCode(Thread*, SP) |
| 149 | |
| 150 | .global art_check_cast_from_code |
| 151 | .extern artCheckCastFromCode |
| 152 | /* |
| 153 | * Entry from managed code that calls artCheckCastFromCode and delivers exception on failure. |
| 154 | */ |
| 155 | art_check_cast_from_code: |
| 156 | str sp, [R9, #THREAD_TOP_OF_MANAGED_STACK_OFFSET] @ record top of stack and pc in case of |
| 157 | str lr, [R9, #THREAD_TOP_OF_MANAGED_STACK_PC_OFFSET] @ walking stack |
| 158 | stmdb sp!, {lr} @ Save LR |
| 159 | sub sp, #12 @ Align stack |
| 160 | bl artCheckCastFromCode @ (Class* a, Class* b) |
| 161 | add sp, #12 |
| 162 | ldmia sp!, {lr} @ restore LR |
| 163 | cmp r0, #0 @ success? |
| 164 | moveq pc, lr @ return on success |
| 165 | @ set up for throwing exception |
| 166 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
| 167 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 168 | mov r0, r9 @ pass Thread::Current |
| 169 | mov r1, sp @ pass SP |
| 170 | b artDeliverPendingExceptionFromCode @ artDeliverPendingExceptionFromCode(Thread*, SP) |
buzbee | 4a3164f | 2011-09-03 11:25:10 -0700 | [diff] [blame] | 171 | |
Ian Rogers | e51a511 | 2011-09-23 14:16:35 -0700 | [diff] [blame^] | 172 | .global art_can_put_array_element_from_code |
| 173 | .extern artCanPutArrayElementFromCode |
| 174 | /* |
| 175 | * Entry from managed code that calls artCanPutArrayElementFromCode and delivers exception on |
| 176 | * failure. |
| 177 | */ |
| 178 | art_can_put_array_element_from_code: |
| 179 | cmp r0, #0 @ return if element == NULL |
| 180 | moveq pc, lr |
| 181 | str sp, [R9, #THREAD_TOP_OF_MANAGED_STACK_OFFSET] @ record top of stack and pc in case of |
| 182 | str lr, [R9, #THREAD_TOP_OF_MANAGED_STACK_PC_OFFSET] @ walking stack |
| 183 | stmdb sp!, {lr} @ Save LR |
| 184 | sub sp, #12 @ Align stack |
| 185 | bl artCanPutArrayElementFromCode @ (Object* element, Class* array_class) |
| 186 | add sp, #12 |
| 187 | ldmia sp!, {lr} @ restore LR |
| 188 | cmp r0, #0 @ success? |
| 189 | moveq pc, lr @ return on success |
| 190 | @ set up for throwing exception |
| 191 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
| 192 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 193 | mov r0, r9 @ pass Thread::Current |
| 194 | mov r1, sp @ pass SP |
| 195 | b artDeliverPendingExceptionFromCode @ artDeliverPendingExceptionFromCode(Thread*, SP) |
| 196 | |
Ian Rogers | cbba6ac | 2011-09-22 16:28:37 -0700 | [diff] [blame] | 197 | .global art_initialize_static_storage_from_code |
| 198 | .extern _ZN3art11ClassLinker31InitializeStaticStorageFromCodeEjPKNS_6MethodE |
| 199 | /* |
| 200 | * Entry from managed code when uninitialized static storage, this stub will run the class |
| 201 | * initializer and deliver the exception on error. On success the static storage base is |
| 202 | * returned. |
| 203 | */ |
| 204 | art_initialize_static_storage_from_code: |
| 205 | str sp, [R9, #THREAD_TOP_OF_MANAGED_STACK_OFFSET] @ record top of stack and pc in case of |
| 206 | str lr, [R9, #THREAD_TOP_OF_MANAGED_STACK_PC_OFFSET] @ walking stack |
| 207 | stmdb sp!, {lr} @ Save LR |
| 208 | sub sp, #12 @ Align stack |
| 209 | @ ClassLinker::InitializeStaticStorageFromCode(uint32_t type_idx, Method* referrer) |
| 210 | bl _ZN3art11ClassLinker31InitializeStaticStorageFromCodeEjPKNS_6MethodE |
| 211 | add sp, #12 |
| 212 | ldmia sp!, {lr} @ restore LR |
| 213 | cmp r0, #0 @ success if result is non-null |
| 214 | movne pc, lr @ return on success |
| 215 | @ set up for throwing exception |
| 216 | stmdb sp!, {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} |
| 217 | sub sp, #16 @ 4 words of space, bottom word will hold Method* |
| 218 | mov r0, r9 @ pass Thread::Current |
| 219 | mov r1, sp @ pass SP |
| 220 | b artDeliverPendingExceptionFromCode @ artDeliverPendingExceptionFromCode(Thread*, SP) |
| 221 | |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 222 | .global art_shl_long |
| 223 | art_shl_long: |
| 224 | /* |
| 225 | * Long integer shift. This is different from the generic 32/64-bit |
| 226 | * binary operations because vAA/vBB are 64-bit but vCC (the shift |
| 227 | * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low |
| 228 | * 6 bits. |
| 229 | * On entry: |
| 230 | * r0: low word |
| 231 | * r1: high word |
| 232 | * r2: shift count |
| 233 | */ |
| 234 | /* shl-long vAA, vBB, vCC */ |
| 235 | and r2, r2, #63 @ r2<- r2 & 0x3f |
| 236 | mov r1, r1, asl r2 @ r1<- r1 << r2 |
| 237 | rsb r3, r2, #32 @ r3<- 32 - r2 |
| 238 | orr r1, r1, r0, lsr r3 @ r1<- r1 | (r0 << (32-r2)) |
| 239 | subs ip, r2, #32 @ ip<- r2 - 32 |
| 240 | movpl r1, r0, asl ip @ if r2 >= 32, r1<- r0 << (r2-32) |
| 241 | mov r0, r0, asl r2 @ r0<- r0 << r2 |
| 242 | bx lr |
| 243 | |
| 244 | .balign 4 |
| 245 | .global art_shr_long |
| 246 | art_shr_long: |
| 247 | /* |
| 248 | * Long integer shift. This is different from the generic 32/64-bit |
| 249 | * binary operations because vAA/vBB are 64-bit but vCC (the shift |
| 250 | * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low |
| 251 | * 6 bits. |
| 252 | * On entry: |
| 253 | * r0: low word |
| 254 | * r1: high word |
| 255 | * r2: shift count |
| 256 | */ |
| 257 | /* shr-long vAA, vBB, vCC */ |
| 258 | and r2, r2, #63 @ r0<- r0 & 0x3f |
| 259 | mov r0, r0, lsr r2 @ r0<- r2 >> r2 |
| 260 | rsb r3, r2, #32 @ r3<- 32 - r2 |
| 261 | orr r0, r0, r1, asl r3 @ r0<- r0 | (r1 << (32-r2)) |
| 262 | subs ip, r2, #32 @ ip<- r2 - 32 |
| 263 | movpl r0, r1, asr ip @ if r2 >= 32, r0<-r1 >> (r2-32) |
| 264 | mov r1, r1, asr r2 @ r1<- r1 >> r2 |
| 265 | bx lr |
| 266 | |
| 267 | .balign 4 |
| 268 | .global art_ushr_long |
| 269 | art_ushr_long: |
| 270 | /* |
| 271 | * Long integer shift. This is different from the generic 32/64-bit |
| 272 | * binary operations because vAA/vBB are 64-bit but vCC (the shift |
| 273 | * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low |
| 274 | * 6 bits. |
| 275 | * On entry: |
| 276 | * r0: low word |
| 277 | * r1: high word |
| 278 | * r2: shift count |
| 279 | */ |
| 280 | /* ushr-long vAA, vBB, vCC */ |
| 281 | and r2, r2, #63 @ r0<- r0 & 0x3f |
| 282 | mov r0, r0, lsr r2 @ r0<- r2 >> r2 |
| 283 | rsb r3, r2, #32 @ r3<- 32 - r2 |
| 284 | orr r0, r0, r1, asl r3 @ r0<- r0 | (r1 << (32-r2)) |
| 285 | subs ip, r2, #32 @ ip<- r2 - 32 |
| 286 | movpl r0, r1, lsr ip @ if r2 >= 32, r0<-r1 >>> (r2-32) |
| 287 | mov r1, r1, lsr r2 @ r1<- r1 >>> r2 |
| 288 | bx lr |
| 289 | |
buzbee | c1f4504 | 2011-09-21 16:03:19 -0700 | [diff] [blame] | 290 | .balign 4 |
| 291 | .global art_test_suspend |
| 292 | .extern artCheckSuspendFromCode |
| 293 | art_test_suspend: |
| 294 | /* |
| 295 | * Check to see if there's a pending suspend request on our thread. |
| 296 | * reset rSUSPEND to SUSPEND_CHECK_INTERVAL. |
| 297 | * On entry, rSUSPEND holds the suspend request value |
| 298 | * [TUNING: move load of suspend check value into this stub. |
| 299 | */ |
| 300 | cmp rSUSPEND, #0 |
| 301 | mov rSUSPEND, #SUSPEND_CHECK_INTERVAL |
| 302 | bxeq rLR |
| 303 | mov r0, rSELF |
| 304 | b artCheckSuspendFromCode |
| 305 | |
| 306 | |
buzbee | 5433072 | 2011-08-23 16:46:55 -0700 | [diff] [blame] | 307 | #endif |
Ian Rogers | 67375ac | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 308 | |
| 309 | #if defined(__i386__) |
| 310 | |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 311 | .global art_deliver_exception_from_code |
| 312 | .extern artDeliverExceptionFromCode |
Ian Rogers | 67375ac | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 313 | /* |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 314 | * Called by managed code, saves callee saves and then calls artThrowException |
Ian Rogers | 67375ac | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 315 | * that will place a mock Method* at the bottom of the stack. |
| 316 | * EAX holds the exception. |
| 317 | */ |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 318 | art_deliver_exception_from_code: |
Ian Rogers | 67375ac | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 319 | // Create frame |
| 320 | pushl %edi // Save callee saves |
| 321 | pushl %esi |
| 322 | pushl %ebp |
| 323 | pushl %ebx |
| 324 | pushl $0 |
| 325 | pushl $0 |
| 326 | pushl $0 // Will be clobbered to be Method* |
| 327 | mov %esp, %ecx |
| 328 | // Outgoing argument set up |
Ian Rogers | ff1ed47 | 2011-09-20 13:46:24 -0700 | [diff] [blame] | 329 | pushl $0 // Alignment padding |
| 330 | pushl %ecx // pass SP |
| 331 | pushl %fs:THREAD_SELF_OFFSET // pass fs:offsetof(Thread,self_) |
| 332 | pushl %eax // pass Throwable* |
| 333 | call artDeliverExceptionFromCode // artDeliverExceptionFromCode(Throwable*, Thread*, SP) |
Ian Rogers | 67375ac | 2011-09-14 00:55:44 -0700 | [diff] [blame] | 334 | int3 |
| 335 | |
| 336 | #endif |