From f9ec0a07c5cbae0947033774b6e2cc626dbf3155 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 30 Apr 2009 18:00:49 -0500 Subject: [PATCH] Fix PICs for x86-64 --- basis/bootstrap/image/image.factor | 2 +- basis/cpu/x86/bootstrap.factor | 1 + vm/cpu-x86.64.S | 2 +- vm/cpu-x86.h | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index dde945e9af..fe1677a7a0 100644 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -98,7 +98,7 @@ SYMBOL: jit-define-rt SYMBOL: jit-define-offset : compute-offset ( -- offset ) - building get length jit-define-rc get rc-absolute-cell = cell 4 ? - ; + building get length jit-define-rc get rc-absolute-cell = bootstrap-cell 4 ? - ; : jit-rel ( rc rt -- ) jit-define-rt set diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index fe5b85057d..337c3ae575 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -241,6 +241,7 @@ big-endian off temp0 0 MOV rc-absolute-cell rt-immediate jit-rel ! key = class temp2 temp1 MOV + bootstrap-cell 8 = [ temp2 1 SHL ] when ! key &= cache.length - 1 temp2 mega-cache-size get 1- bootstrap-cell * AND ! cache += array-start-offset diff --git a/vm/cpu-x86.64.S b/vm/cpu-x86.64.S index 26cb753d59..a110bf1d51 100644 --- a/vm/cpu-x86.64.S +++ b/vm/cpu-x86.64.S @@ -78,6 +78,6 @@ DEF(F_FASTCALL void,primitive_inline_cache_miss,(void)): sub $STACK_PADDING,%rsp call MANGLE(inline_cache_miss) add $STACK_PADDING,%rsp - jmp *WORD_XT_OFFSET(%rax) + jmp *%rax #include "cpu-x86.S" diff --git a/vm/cpu-x86.h b/vm/cpu-x86.h index ab09893707..0888ec57fd 100755 --- a/vm/cpu-x86.h +++ b/vm/cpu-x86.h @@ -25,11 +25,11 @@ INLINE void check_call_site(CELL return_address) INLINE CELL get_call_target(CELL return_address) { check_call_site(return_address); - return *(F_FIXNUM *)(return_address - 4) + return_address; + return *(int *)(return_address - 4) + return_address; } INLINE void set_call_target(CELL return_address, CELL target) { check_call_site(return_address); - *(F_FIXNUM *)(return_address - 4) = (target - return_address); + *(int *)(return_address - 4) = (target - return_address); }