1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team 1998-2008
4  *
5  * Generational garbage collector: evacuation functions
6  *
7  * Documentation on the architecture of the Garbage Collector can be
8  * found in the online commentary:
9  *
10  *   https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/storage/gc
11  *
12  * ---------------------------------------------------------------------------*/
13 
14 #pragma once
15 
16 #include "BeginPrivate.h"
17 
18 // Use a register argument for evacuate, if available.
19 // Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this
20 // generated warnings on PPC. So the use is restricted further.
21 // See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html that says
22 //     regparm (number)
23 //         On the Intel 386, the regparm attribute causes the compiler to pass
24 //         arguments number one to number if they are of integral type in
25 //         registers EAX, EDX, and ECX instead of on the stack. Functions that
26 //         take a variable number of arguments will continue to be passed all of
27 //         their arguments on the stack.
28 #if __GNUC__ >= 2 && (defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH))
29 #define REGPARM1 __attribute__((regparm(1)))
30 #else
31 #define REGPARM1
32 #endif
33 
34 REGPARM1 void evacuate  (StgClosure **p);
35 REGPARM1 void evacuate1 (StgClosure **p);
36 
37 void evacuate_BLACKHOLE(StgClosure **p);
38 void evacuate_BLACKHOLE1(StgClosure **p);
39 
40 extern W_ thunk_selector_depth;
41 
42 #include "EndPrivate.h"
43