From e8008af5d09b6beb31a3e1eba7d13b8de549c1e5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 28 Apr 2009 16:58:38 -0500 Subject: [PATCH] inline-cache-miss primitive now jumps to the new stub --- vm/cpu-x86.32.S | 9 +++++++++ vm/cpu-x86.64.S | 8 ++++++++ vm/cpu-x86.S | 4 ---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/vm/cpu-x86.32.S b/vm/cpu-x86.32.S index 22228eb6d9..2b4a736228 100755 --- a/vm/cpu-x86.32.S +++ b/vm/cpu-x86.32.S @@ -30,6 +30,7 @@ and the callstack top is passed in EDX */ pop %ebx #define QUOT_XT_OFFSET 14 +#define WORD_XT_OFFSET 30 /* We pass a function pointer to memcpy to work around a Mac OS X ABI limitation which would otherwise require us to do a bizzaro PC-relative @@ -59,6 +60,14 @@ DEF(bool,check_sse2,(void)): mov %edx,%eax ret +DEF(F_FASTCALL void,primitive_inline_cache_miss,(void)): + mov (%esp),%eax + sub $8,%esp + push %eax + call MANGLE(inline_cache_miss) + add $12,%esp + jmp *WORD_XT_OFFSET(%eax) + #include "cpu-x86.S" #ifdef WINDOWS diff --git a/vm/cpu-x86.64.S b/vm/cpu-x86.64.S index ba1f5b5409..984f7d1842 100644 --- a/vm/cpu-x86.64.S +++ b/vm/cpu-x86.64.S @@ -62,6 +62,7 @@ #endif #define QUOT_XT_OFFSET 34 +#define WORD_XT_OFFSET 66 /* We pass a function pointer to memcpy to work around a Mac OS X ABI limitation which would otherwise require us to do a bizzaro PC-relative @@ -72,4 +73,11 @@ DEF(void,set_callstack,(F_STACK_FRAME *to, F_STACK_FRAME *from, CELL length, voi call *ARG3 /* call memcpy */ ret /* return _with new stack_ */ +DEF(F_FASTCALL void,primitive_inline_cache_miss,(void)): + mov (%rsp),ARG0 + sub $STACK_PADDING,%rsp + call MANGLE(inline_cache_miss) + add $STACK_PADDING,%rsp + jmp *WORD_XT_OFFSET(%rax) + #include "cpu-x86.S" diff --git a/vm/cpu-x86.S b/vm/cpu-x86.S index 5dfc55cbd5..e83bb0fd7d 100755 --- a/vm/cpu-x86.S +++ b/vm/cpu-x86.S @@ -68,10 +68,6 @@ DEF(F_FASTCALL void,lazy_jit_compile,(CELL quot)): add $STACK_PADDING,STACK_REG jmp *QUOT_XT_OFFSET(ARG0) /* Call the quotation */ -DEF(F_FASTCALL void,primitive_inline_cache_miss,(void)): - mov (STACK_REG),ARG0 - jmp MANGLE(inline_cache_miss) - #ifdef WINDOWS .section .drectve .ascii " -export:c_to_factor"