1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team 1998-2008
5 * Generational garbage collector: evacuation functions
7 * Documentation on the architecture of the Garbage Collector can be
8 * found in the online commentary:
10 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
12 * ---------------------------------------------------------------------------*/
17 // Use a register argument for evacuate, if available.
18 // Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this
19 // generated warnings on PPC. So the use is restricted further.
20 // See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html that says
22 // On the Intel 386, the regparm attribute causes the compiler to pass
23 // arguments number one to number if they are of integral type in
24 // registers EAX, EDX, and ECX instead of on the stack. Functions that
25 // take a variable number of arguments will continue to be passed all of
26 // their arguments on the stack.
27 #if __GNUC__ >= 2 && (defined(x86_64_TARGET_ARCH) || defined(i386_TARGET_ARCH))
28 #define REGPARM1 __attribute__((regparm(1)))
33 REGPARM1 void evacuate (StgClosure **p);
34 REGPARM1 void evacuate1 (StgClosure **p);
36 extern lnat thunk_selector_depth;
38 #endif /* SM_EVAC_H */