From: Taylor R Campbell Date: Tue, 8 Jan 2019 16:40:11 +0000 (+0000) Subject: Convert to SCHEME_OBJECT * first before subtracting membase. X-Git-Tag: mit-scheme-pucked-10.1.10~6^2~75 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fdb53626fe074b3eb65ece02905808046e3bc37c;p=mit-scheme.git Convert to SCHEME_OBJECT * first before subtracting membase. This system (with or without the change) requires all addresses that are tagged to be word-aligned, which expands the address space by a factor of four on 32-bit systems, but means we can't tag pointers to unaligned instruction addresses. This means that i386 compiled code won't be able to take advantage of membase, but it can't anyway without changes to the compiler, which doesn't know about membase as is. However, this _also_ means that multiclosures in SVM won't work because only the first entry (and every four or eight entries) is guaranteed to be word-aligned. We could address this by aligning the entries, and maybe remove the ENTER-CLOSURE instruction overhead by using indirection for entries like riastradh-20181220-closentry-v3 does for amd64. (Don't want to change CC_ENTRY_NEW_ADDRESS or anything because there's an outstanding branch that changes them already for other reasons.) --- diff --git a/src/microcode/object.h b/src/microcode/object.h index 28799ef94..02f5641c2 100644 --- a/src/microcode/object.h +++ b/src/microcode/object.h @@ -163,7 +163,8 @@ extern SCHEME_OBJECT * memory_base; #endif #ifndef ADDRESS_TO_DATUM -# define ADDRESS_TO_DATUM(address) ((SCHEME_OBJECT) ((address) - MEMBASE)) +# define ADDRESS_TO_DATUM(address) \ + ((SCHEME_OBJECT) (((SCHEME_OBJECT *) (address)) - MEMBASE)) #endif #endif /* not HEAP_IN_LOW_MEMORY */