More profiling fixes.
import CgMonad
import AbsCSyn
-import Constants ( uF_SIZE, sCC_UF_SIZE, sEQ_FRAME_SIZE )
+import Constants ( uF_SIZE, sCC_UF_SIZE, sEQ_FRAME_SIZE, sCC_SEQ_FRAME_SIZE )
import PrimRep ( PrimRep(..) )
import CgStackery ( allocUpdateFrame )
import CgUsages ( getSpRelOffset )
it will also push the SEQ frame, using pushSeqFrame.
\begin{code}
+seq_frame_size | opt_SccProfilingOn = sCC_SEQ_FRAME_SIZE
+ | otherwise = sEQ_FRAME_SIZE
+
reserveSeqFrame :: EndOfBlockInfo -> EndOfBlockInfo
reserveSeqFrame (EndOfBlockInfo args_sp (CaseAlts amode stuff))
- = EndOfBlockInfo (args_sp + sEQ_FRAME_SIZE) (SeqFrame amode stuff)
+ = EndOfBlockInfo (args_sp + seq_frame_size) (SeqFrame amode stuff)
pushSeqFrame :: VirtualSpOffset -> FCode VirtualSpOffset
pushSeqFrame args_sp
= getSpRelOffset args_sp `thenFC` \ sp_rel ->
absC (CMacroStmt PUSH_SEQ_FRAME [CAddr sp_rel]) `thenC`
- returnFC (args_sp - sEQ_FRAME_SIZE)
+ returnFC (args_sp - seq_frame_size)
\end{code}
uF_CCS,
sEQ_FRAME_SIZE,
+ sCC_SEQ_FRAME_SIZE,
mAX_Vanilla_REG,
mAX_Float_REG,
uF_CCS = (UF_CCS::Int)
\end{code}
+Seq frame sizes.
+
\begin{code}
-sEQ_FRAME_SIZE = (SEQ_FRAME_SIZE::Int)
+sEQ_FRAME_SIZE = (NOSCC_SEQ_FRAME_SIZE::Int)
+sCC_SEQ_FRAME_SIZE = (SCC_SEQ_FRAME_SIZE::Int)
\end{code}
\begin{code}
/* ----------------------------------------------------------------------------
- * $Id: Constants.h,v 1.5 1999/02/05 16:02:21 simonm Exp $
+ * $Id: Constants.h,v 1.6 1999/03/26 10:29:02 simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
#define NOSCC_UF_SIZE 3
#define SCC_UF_SIZE 4
-#if defined(PROFILING)
-#define UF_SIZE SCC_UF_SIZE
-#else
-#define UF_SIZE NOSCC_UF_SIZE
-#endif
-
#define UF_RET 0
#define UF_SU 1
#define UF_UPDATEE 2
/* -----------------------------------------------------------------------------
SEQ frame size
+
+ I don't think seq frames really need sccs --SDM
-------------------------------------------------------------------------- */
-#if defined(PROFILING)
-#define SEQ_FRAME_SIZE 3
-#else
-#define SEQ_FRAME_SIZE 2
-#endif
+#define NOSCC_SEQ_FRAME_SIZE 2
+#define SCC_SEQ_FRAME_SIZE 3
/* -----------------------------------------------------------------------------
STG Registers.
/* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.56 1999/03/25 13:14:05 simonm Exp $
+ * $Id: GC.c,v 1.57 1999/03/26 10:29:04 simonm Exp $
*
* (c) The GHC Team 1998-1999
*
*/
while (p < stack_end) {
- q = *stgCast(StgPtr*,p);
+ q = *(P_ *)p;
/* If we've got a tag, skip over that many words on the stack */
- if (IS_ARG_TAG(stgCast(StgWord,q))) {
+ if (IS_ARG_TAG((W_)q)) {
p += ARG_SIZE(q);
p++; continue;
}
* record. All activation records have 'bitmap' style layout
* info.
*/
- info = get_itbl(stgCast(StgClosure*,p));
+ info = get_itbl((StgClosure *)p);
switch (info->type) {
/* Dynamic bitmap: the mask is stored on the stack */
case RET_DYN:
bitmap = ((StgRetDyn *)p)->liveness;
- p = (P_)((StgRetDyn *)p)->payload[0];
+ p = (P_)&((StgRetDyn *)p)->payload[0];
goto small_bitmap;
/* probably a slow-entry point return address: */
/* -----------------------------------------------------------------------------
- * $Id: StgStdThunks.hc,v 1.3 1999/02/05 16:03:00 simonm Exp $
+ * $Id: StgStdThunks.hc,v 1.4 1999/03/26 10:29:05 simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
FN_(__ap_7_upd_entry);
FN_(__ap_8_upd_entry);
+#define UF_SIZE (sizeofW(StgUpdateFrame))
+
/* __ap_1_upd_info is a bit redundant, but there appears to be a bug
* in the compiler that means __ap_1 is generated occasionally (ToDo)
*/
/* -----------------------------------------------------------------------------
- * $Id: Updates.hc,v 1.12 1999/03/25 13:14:08 simonm Exp $
+ * $Id: Updates.hc,v 1.13 1999/03/26 10:29:06 simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
#if defined(PROFILING)
/* set "CC_pap" to go in the updatee (see Sansom thesis, p 183) */
-
- CCS_pap = (CostCentreStack *) Fun->header.prof.ccs;
- if (IS_CAF_OR_SUB_CCS(CCS_pap)) {
- CCS_pap = CCCS;
- }
+ CCS_pap = Fun->header.prof.ccs;
#endif
if (Words == 0) {
SEQ_FRAME_ENTRY_TEMPLATE(seq_frame_6_entry,ENTRY_CODE(Sp[0]));
SEQ_FRAME_ENTRY_TEMPLATE(seq_frame_7_entry,ENTRY_CODE(Sp[0]));
-VEC_POLY_INFO_TABLE(seq_frame,1, NULL/*srt*/, 0/*srt_off*/, 0/*srt_len*/, SEQ_FRAME);
+VEC_POLY_INFO_TABLE(seq_frame, UPD_FRAME_BITMAP, NULL/*srt*/, 0/*srt_off*/, 0/*srt_len*/, SEQ_FRAME);
/* -----------------------------------------------------------------------------
* The seq infotable
{
FB_
STK_CHK_GEN(sizeofW(StgSeqFrame), NO_PTRS, seq_entry, );
- Sp -= sizeof(StgSeqFrame);
+ Sp -= sizeofW(StgSeqFrame);
PUSH_SEQ_FRAME(Sp);
R1.cl = R1.cl->payload[0];
JMP_(ENTRY_CODE(*R1.p));