From 59e40c2c25e4da778fe2c378bfb646ff6f6d29b3 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 26 Mar 2003 15:56:25 +0000 Subject: [PATCH] [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. --- ghc/rts/GC.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 ); -- 1.7.10.4