From 3fa88f96f487677db1b42de45721fa1b4784f782 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 16 Mar 2000 12:40:40 +0000 Subject: [PATCH] [project @ 2000-03-16 12:40:40 by simonmar] Use Sp instead of the global init_stack for the stack pointer during module initialisation. This should cut down the code size for module initialisation blocks. --- ghc/includes/StgMacros.h | 8 +++----- ghc/rts/StgStartup.hc | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ghc/includes/StgMacros.h b/ghc/includes/StgMacros.h index efa11fc..3c4b451 100644 --- a/ghc/includes/StgMacros.h +++ b/ghc/includes/StgMacros.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: StgMacros.h,v 1.22 2000/03/15 17:36:02 simonmar Exp $ + * $Id: StgMacros.h,v 1.23 2000/03/16 12:40:40 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -729,13 +729,11 @@ LoadThreadState (void) Module initialisation -------------------------------------------------------------------------- */ -extern F_ *init_stack; - #define PUSH_INIT_STACK(reg_function) \ - *(init_stack++) = (F_)reg_function + *(Sp++) = (W_)reg_function #define POP_INIT_STACK() \ - *(--init_stack) + *(--Sp) #define START_MOD_INIT(reg_mod_name) \ static int _module_registered = 0; \ diff --git a/ghc/rts/StgStartup.hc b/ghc/rts/StgStartup.hc index 997277a..cb8beca 100644 --- a/ghc/rts/StgStartup.hc +++ b/ghc/rts/StgStartup.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: StgStartup.hc,v 1.7 2000/03/09 11:49:34 simonmar Exp $ + * $Id: StgStartup.hc,v 1.8 2000/03/16 12:40:40 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -137,6 +137,8 @@ STGFUN(stg_enterStackTop) #ifndef INTERPRETER +extern F_ *init_stack; + STGFUN(stg_init_ret) { FB_ @@ -149,6 +151,7 @@ STGFUN(stg_init) EF_(__init_Main); EF_(__init_Prelude); FB_ + Sp = (P_)init_stack; PUSH_INIT_STACK(stg_init_ret); PUSH_INIT_STACK(__init_Prelude); JMP_(__init_Main); -- 1.7.10.4