blob: e621eff8fc741437b43861942ebbc25891841f8f [file] [log] [blame]
Elliott Hughes5c9f0b42011-12-15 18:15:46 -08001#include "asm_support.h"
2
Shih-wei Liaod1029982012-01-19 17:53:17 +08003#if defined(__APPLE__)
4 // Mac OS X mangles the functions with an underscore prefix
5 #define art_deliver_exception_from_code _art_deliver_exception_from_code
6 #define art_proxy_invoke_handler _art_proxy_invoke_handler
7 #define artDeliverExceptionFromCode _artDeliverExceptionFromCode
8#endif
9
Elliott Hughes5c9f0b42011-12-15 18:15:46 -080010 .globl art_deliver_exception_from_code
11 /*
12 * Called by managed code, saves callee saves and then calls artThrowException
13 * that will place a mock Method* at the bottom of the stack.
14 * EAX holds the exception.
15 */
16art_deliver_exception_from_code:
17 // Create frame
18 pushl %edi // Save callee saves
19 pushl %esi
20 pushl %ebp
21 pushl %ebx
22 pushl $0
23 pushl $0
24 pushl $0 // Will be clobbered to be Method*
25 mov %esp, %ecx
26 // Outgoing argument set up
27 pushl $0 // Alignment padding
28 pushl %ecx // pass SP
29 pushl %fs:THREAD_SELF_OFFSET // pass fs:offsetof(Thread,self_)
30 pushl %eax // pass Throwable*
31 call artDeliverExceptionFromCode // artDeliverExceptionFromCode(Throwable*, Thread*, SP)
32 int3
33
34 // TODO
35 .globl art_proxy_invoke_handler
36art_proxy_invoke_handler:
37 int3