From: simonmar Date: Wed, 15 Mar 2000 17:36:02 +0000 (+0000) Subject: [project @ 2000-03-15 17:36:02 by simonmar] X-Git-Tag: Approximately_9120_patches~4975 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=13aa3feea26b69b0c5ae2092b2088a6879f3915b;p=ghc-hetmet.git [project @ 2000-03-15 17:36:02 by simonmar] optimise SaveThreadState/LoadThreadState slightly by caching CurrentTSO in a local variable. --- diff --git a/ghc/includes/StgMacros.h b/ghc/includes/StgMacros.h index 1e28474..efa11fc 100644 --- a/ghc/includes/StgMacros.h +++ b/ghc/includes/StgMacros.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: StgMacros.h,v 1.21 2000/03/08 17:48:26 simonmar Exp $ + * $Id: StgMacros.h,v 1.22 2000/03/15 17:36:02 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -679,15 +679,18 @@ extern DLL_IMPORT_DATA const StgPolyInfoTable seq_frame_info; static __inline__ void SaveThreadState(void) { + StgTSO *tso; + /* Don't need to save REG_Base, it won't have changed. */ - CurrentTSO->sp = Sp; - CurrentTSO->su = Su; - CurrentTSO->splim = SpLim; + tso = CurrentTSO; + tso->sp = Sp; + tso->su = Su; + tso->splim = SpLim; CloseNursery(Hp); #ifdef REG_CurrentTSO - SAVE_CurrentTSO = CurrentTSO; + SAVE_CurrentTSO = tso; #endif #ifdef REG_CurrentNursery SAVE_CurrentNursery = CurrentNursery; @@ -700,14 +703,18 @@ SaveThreadState(void) static __inline__ void LoadThreadState (void) { - Sp = CurrentTSO->sp; - Su = CurrentTSO->su; - SpLim = CurrentTSO->splim; - OpenNursery(Hp,HpLim); + StgTSO *tso; #ifdef REG_CurrentTSO CurrentTSO = SAVE_CurrentTSO; #endif + + tso = CurrentTSO; + Sp = tso->sp; + Su = tso->su; + SpLim = tso->splim; + OpenNursery(Hp,HpLim); + #ifdef REG_CurrentNursery CurrentNursery = SAVE_CurrentNursery; #endif