X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2Fsm%2FEvac.h;h=78d024f3e99409549d73fa78cf77846828056868;hp=c89e4d9a7d552f4c863f669c7c0fc11a2b90cdda;hb=a2a67cd520b9841114d69a87a423dabcb3b4368e;hpb=ab0e778ccfde61aed4c22679b24d175fc6cc9bf3 diff --git a/rts/sm/Evac.h b/rts/sm/Evac.h index c89e4d9..78d024f 100644 --- a/rts/sm/Evac.h +++ b/rts/sm/Evac.h @@ -1,18 +1,39 @@ /* ----------------------------------------------------------------------------- * - * (c) The GHC Team 1998-2006 + * (c) The GHC Team 1998-2008 * * Generational garbage collector: evacuation functions * + * Documentation on the architecture of the Garbage Collector can be + * found in the online commentary: + * + * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC + * * ---------------------------------------------------------------------------*/ +#ifndef SM_EVAC_H +#define SM_EVAC_H + // Use a register argument for evacuate, if available. -#if __GNUC__ >= 2 +// Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this +// generated warnings on PPC. So the use is restricted further. +// See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html that says +// regparm (number) +// On the Intel 386, the regparm attribute causes the compiler to pass +// arguments number one to number if they are of integral type in +// registers EAX, EDX, and ECX instead of on the stack. Functions that +// take a variable number of arguments will continue to be passed all of +// their arguments on the stack. +#if __GNUC__ >= 2 && (defined(x86_64_TARGET_ARCH) || defined(i386_TARGET_ARCH)) #define REGPARM1 __attribute__((regparm(1))) #else #define REGPARM1 #endif -REGPARM1 StgClosure * evacuate (StgClosure *q); +REGPARM1 void evacuate (StgClosure **p); +REGPARM1 void evacuate1 (StgClosure **p); extern lnat thunk_selector_depth; + +#endif /* SM_EVAC_H */ +