X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-64-assem.S;h=d8084769be9adf2f06904184354b23a5851cb926;hb=b83353d9f998e5c0e34604b5593df70c66d2c510;hp=7c91ef0f12e447dd1488ec280d7494df37a4193d;hpb=26ac616b6783b8841ccda8b4f1caa7d898d91b86;p=sbcl.git diff --git a/src/runtime/x86-64-assem.S b/src/runtime/x86-64-assem.S index 7c91ef0..d808476 100644 --- a/src/runtime/x86-64-assem.S +++ b/src/runtime/x86-64-assem.S @@ -156,12 +156,23 @@ GNAME(call_into_lisp_first_time): * return values in rax rdx * callee saves rbp rbx r12-15 if it uses them */ - +#ifdef LISP_FEATURE_WIN32 +# define SUPPORT_FOMIT_FRAME_POINTER +#endif .align align_16byte,0x90 GNAME(call_into_lisp): +#ifdef SUPPORT_FOMIT_FRAME_POINTER + mov %rbp,%rax +#endif push %rbp # Save old frame pointer. mov %rsp,%rbp # Establish new frame. Lstack: +#ifdef SUPPORT_FOMIT_FRAME_POINTER + /* If called through call_into_lisp_first_time, %r15 becomes invalid + * here, but we will not return in that case. */ + push %r15 + mov %rax,%r15 +#endif /* FIXME x86 saves FPU state here */ push %rbx # these regs are callee-saved according to C push %r12 # so must be preserved and restored when @@ -176,6 +187,13 @@ Lstack: push %rsi # push %rdx # #ifdef LISP_FEATURE_SB_THREAD +# ifdef SUPPORT_FOMIT_FRAME_POINTER + mov (%rbp),%rcx + sub $32,%rsp + call GNAME(carry_frame_pointer) + add $32,%rsp + mov %rax,(%rbp) +# endif #ifdef LISP_FEATURE_GCC_TLS movq %fs:0, %rax movq GNAME(current_thread)@TPOFF(%rax), %r12 @@ -238,7 +256,13 @@ LsingleValue: /* FIXME Restore the NPX state. */ mov %rdx,%rax # c-val +#ifdef SUPPORT_FOMIT_FRAME_POINTER + mov %r15,%rbp # orig rbp + pop %r15 # orig r15 + add $8,%rsp # no need for saved (overridden) rbp +#else leave +#endif ret SIZE(GNAME(call_into_lisp)) @@ -277,6 +301,24 @@ GNAME(undefined_tramp): ret SIZE(GNAME(undefined_tramp)) + .text + .align align_16byte,0x90 + .globl GNAME(undefined_alien_function) + TYPE(GNAME(undefined_alien_function)) +GNAME(undefined_alien_function): + pop 8(%rbp) # Save return PC for backtrace. + TRAP + .byte trap_Error + .byte 4 + .byte UNDEFINED_ALIEN_FUN_ERROR + /* Encode RBX + FIXME: make independt of the encoding changes. */ + .byte 0xFE + .byte 0x9F + .byte 0x01 + ret + SIZE(GNAME(undefined_alien_function)) + /* KLUDGE: FIND-ESCAPED-FRAME (SYS:SRC;CODE;DEBUG-INT.LISP) needs * to know the name of the function immediately following the * undefined-function trampoline. */