From: simonmar Date: Wed, 26 Mar 2003 15:56:25 +0000 (+0000) Subject: [project @ 2003-03-26 15:56:25 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1028 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=59e40c2c25e4da778fe2c378bfb646ff6f6d29b3;p=ghc-hetmet.git [project @ 2003-03-26 15:56:25 by simonmar] Add __attribute__((regparm(1))) to evacuate()'s prototype. This avoids a lot of stack assignments between scavenge() and evacuate(). Performance isn't affected measurably, though. --- diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c index c6744ed..429746a 100644 --- a/ghc/rts/GC.c +++ b/ghc/rts/GC.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: GC.c,v 1.151 2003/03/26 14:52:02 simonmar Exp $ + * $Id: GC.c,v 1.152 2003/03/26 15:56:25 simonmar Exp $ * * (c) The GHC Team 1998-2003 * @@ -139,7 +139,14 @@ static lnat thunk_selector_depth = 0; static bdescr * gc_alloc_block ( step *stp ); static void mark_root ( StgClosure **root ); -static StgClosure * evacuate ( StgClosure *q ); + +// Use a register argument for evacuate, if available. +#if __GNUC__ >= 2 +static StgClosure * evacuate (StgClosure *q) __attribute__((regparm(1))); +#else +static StgClosure * evacuate (StgClosure *q); +#endif + static void zero_static_object_list ( StgClosure* first_static ); static void zero_mutable_list ( StgMutClosure *first );