diff --git a/src/CHANGELOG b/src/CHANGELOG index 3011f1f09..933777408 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -1,6 +1,11 @@ ECL 0.9i ======== +* New platforms: + + - Patches in assembler code and GC headers to build ECL on Mac OSX/Intel + contributed by Brad Beveridge. + * Visible changes: - Many functions have got now the prefix "ecl_" so as to avoid namespace @@ -88,10 +93,11 @@ ECL 0.9i COMPUTE-SLOTS assign a location to each slot definition that has allocation :INSTANCE or :CLASS. - - A new defclass option, :optimize-slot-access, which defaults to T, controls - whether the slots accessors should address directly the values in the class - or use SLOT-VALUE. It should be set to NIL when one intends to redefine the - SLOT-*-USING-CLASS methods. + - A new defclass option, :OPTIMIZE-SLOT-ACCESS, which defaults to the value of + CLOS:*OPTIMIZE-SLOT-ACCESS*, controls whether the slots accessors should + address directly the values in the class or use SLOT-VALUE. It should be set + to NIL when one intends to redefine the SLOT-*-USING-CLASS methods, and + to T when trying to get the most of the speed. - Implemented [FUNCALLABLE-]STANDARD-INSTANCE-ACCESS. They are synonyms for SI:INSTANCE-REF and are, as such, inlined and _very_ unsafe. Use with care. diff --git a/src/c/arch/ffi_x86.d b/src/c/arch/ffi_x86.d index 3778b3bdd..ff59f50d8 100644 --- a/src/c/arch/ffi_x86.d +++ b/src/c/arch/ffi_x86.d @@ -74,7 +74,9 @@ ecl_fficall_execute(void *f_ptr, struct ecl_fficall *fficall, enum ecl_ffi_tag r "subl %1, %%esp\n\t" "movl %2, %%esi\n\t" "movl %%esp, %%edi\n\t" - "rep movsb\n\t": "=a" (stack_p) : "c" (bufsize), "d" (buf) : "%edi", "%esi"); + "rep\n\t" + "movsb\n\t" + : "=a" (stack_p) : "c" (bufsize), "d" (buf) : "%edi", "%esi"); #endif if (return_type <= ECL_FFI_UNSIGNED_LONG) { fficall->output.i = ((int (*)())f_ptr)(); diff --git a/src/gc/include/private/gcconfig.h b/src/gc/include/private/gcconfig.h index 9546c206c..344e8949d 100644 --- a/src/gc/include/private/gcconfig.h +++ b/src/gc/include/private/gcconfig.h @@ -300,7 +300,7 @@ # define mach_type_known # elif defined(__i386__) # define I386 - --> Not really supported, but at least we recognize it. +# define mach_type_known # endif # endif # if defined(NeXT) && defined(mc68000) @@ -1278,6 +1278,50 @@ /* # define MPROTECT_VDB Not quite working yet? */ # define DYNAMIC_LOADING # endif +# ifdef DARWIN +# if defined(__LP64__) || defined(_WIN64) +# define CPP_WORDSZ 64 +# define ALIGNMENT 8 +# else +# define CPP_WORDSZ 32 +# define ALIGNMENT 4 + /* Appears to hold for all "32 bit" compilers */ + /* except Borland. The -a4 option fixes */ + /* Borland. */ + /* Ivan Demakov: For Watcom the option is -zp4. */ +# endif +# define OS_TYPE "DARWIN" +# define DYNAMIC_LOADING + /* XXX: see get_end(3), get_etext() and get_end() should not be used. + These aren't used when dyld support is enabled (it is by default) */ +# define DATASTART ((ptr_t) get_etext()) +# define DATAEND ((ptr_t) get_end()) +# define STACKBOTTOM ((ptr_t) 0xc0000000) +# define USE_MMAP +# define USE_MMAP_ANON +# define USE_ASM_PUSH_REGS + /* This is potentially buggy. It needs more testing. See the comments in + os_dep.c. It relies on threads to track writes. */ +# ifdef GC_DARWIN_THREADS +/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */ +# endif +# include +# define GETPAGESIZE() getpagesize() + +#if 0 +# if defined(USE_PPC_PREFETCH) && defined(__GNUC__) + /* The performance impact of prefetches is untested */ +# define PREFETCH(x) \ + __asm__ __volatile__ ("dcbt 0,%0" : : "r" ((const void *) (x))) +# define PREFETCH_FOR_WRITE(x) \ + __asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x))) +# endif +#endif + /* There seems to be some issues with trylock hanging on darwin. This + should be looked into some more */ +# define NO_PTHREAD_TRYLOCK +# endif + # endif # ifdef NS32K