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
92 DEF(void,get_sse_env,(void*)):
96 DEF(void,set_sse_env,(const void*)):
100 DEF(void,get_x87_env,(void*)):
105 DEF(void,set_x87_env,(const void*)):
110 DEF(F_FASTCALL void,throw_impl,(CELL quot, F_STACK_FRAME *rewind_to, void *vm)):
111 /* clear x87 stack, but preserve rounding mode and exception flags */
118 mov ARG2,ARG1 /* make vm ptr 2nd arg in case quot_xt = lazy_jit_compile */
119 jmp *QUOT_XT_OFFSET(ARG0)
121 DEF(F_FASTCALL void,lazy_jit_compile,(CELL quot, void *vm)):
122 mov ARG1,ARG2 /* vm is 3rd arg */
123 mov STACK_REG,ARG1 /* Save stack pointer */
124 sub $STACK_PADDING,STACK_REG
125 call MANGLE(lazy_jit_compile_impl)
126 mov RETURN_REG,ARG0 /* No-op on 32-bit */
127 add $STACK_PADDING,STACK_REG
128 jmp *QUOT_XT_OFFSET(ARG0) /* Call the quotation */