5 #define RETURN_REG %rax
8 #define STACK_PADDING 56
10 #define NV_TEMP_REG %rbp
12 #define ARITH_TEMP_1 %r8
13 #define ARITH_TEMP_2 %r9
14 #define DIV_RESULT %rax
23 #define PUSH_NONVOLATILE \
32 #define POP_NONVOLATILE \
48 #define PUSH_NONVOLATILE \
55 #define POP_NONVOLATILE \
64 #define QUOT_XT_OFFSET 28
66 /* We pass a function pointer to memcpy to work around a Mac OS X
67 ABI limitation which would otherwise require us to do a bizzaro PC-relative
68 trampoline to retrieve the function address */
69 DEF(void,set_callstack,(F_STACK_FRAME *to, F_STACK_FRAME *from, CELL length, void *memcpy)):
70 sub ARG2,ARG0 /* compute new stack pointer */
72 call *ARG3 /* call memcpy */
73 ret /* return _with new stack_ */
75 DEF(long long,read_timestamp_counter,(void)):
82 DEF(void,primitive_inline_cache_miss,(void *vm)):
84 DEF(void,primitive_inline_cache_miss_tail,(void *vm)):
85 sub $STACK_PADDING,%rsp
88 call MANGLE(inline_cache_miss)
89 add $STACK_PADDING,%rsp
93 DEF(void,get_sse_env,(void*)):
97 DEF(void,set_sse_env,(const void*)):
101 DEF(void,get_x87_env,(void*)):
106 DEF(void,set_x87_env,(const void*)):
111 DEF(F_FASTCALL void,throw_impl,(CELL quot, F_STACK_FRAME *rewind_to, void *vm)):
112 /* clear x87 stack, but preserve rounding mode and exception flags */
119 mov ARG2,ARG1 /* make vm ptr 2nd arg in case quot_xt = lazy_jit_compile */
120 jmp *QUOT_XT_OFFSET(ARG0)
122 DEF(F_FASTCALL void,lazy_jit_compile,(CELL quot, void *vm)):
123 mov ARG1,ARG2 /* vm is 3rd arg */
124 mov STACK_REG,ARG1 /* Save stack pointer */
125 sub $STACK_PADDING,STACK_REG
126 call MANGLE(lazy_jit_compile_impl)
127 mov RETURN_REG,ARG0 /* No-op on 32-bit */
128 add $STACK_PADDING,STACK_REG
129 jmp *QUOT_XT_OFFSET(ARG0) /* Call the quotation */