Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
d4e0cee2
Commit
d4e0cee2
authored
Mar 26, 1999
by
simonm
Browse files
[project @ 1999-03-26 10:29:02 by simonm]
More profiling fixes.
parent
e1db55d8
Changes
6
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/codeGen/CgUpdate.lhs
View file @
d4e0cee2
...
...
@@ -11,7 +11,7 @@ module CgUpdate ( pushUpdateFrame, reserveSeqFrame, pushSeqFrame ) where
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 )
...
...
@@ -71,13 +71,16 @@ args_sp. When the scrutinee comes around to pushing a return address,
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 + s
EQ_FRAME_SIZE
) (SeqFrame amode stuff)
= EndOfBlockInfo (args_sp + s
eq_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 - s
EQ_FRAME_SIZE
)
returnFC (args_sp - s
eq_frame_size
)
\end{code}
ghc/compiler/main/Constants.lhs
View file @
d4e0cee2
...
...
@@ -50,6 +50,7 @@ module Constants (
uF_CCS,
sEQ_FRAME_SIZE,
sCC_SEQ_FRAME_SIZE,
mAX_Vanilla_REG,
mAX_Float_REG,
...
...
@@ -186,8 +187,11 @@ uF_UPDATEE = (UF_UPDATEE::Int)
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}
...
...
ghc/includes/Constants.h
View file @
d4e0cee2
/* ----------------------------------------------------------------------------
* $Id: Constants.h,v 1.
5
1999/0
2/05 16:02:21
simonm Exp $
* $Id: Constants.h,v 1.
6
1999/0
3/26 10:29:02
simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
...
...
@@ -103,12 +103,6 @@
#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
...
...
@@ -116,13 +110,12 @@
/* -----------------------------------------------------------------------------
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.
...
...
ghc/rts/GC.c
View file @
d4e0cee2
/* -----------------------------------------------------------------------------
* $Id: GC.c,v 1.5
6
1999/03/2
5
1
3:14
:0
5
simonm Exp $
* $Id: GC.c,v 1.5
7
1999/03/2
6
1
0:29
:0
4
simonm Exp $
*
* (c) The GHC Team 1998-1999
*
...
...
@@ -2313,10 +2313,10 @@ scavenge_stack(StgPtr p, StgPtr stack_end)
*/
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
;
}
...
...
@@ -2342,14 +2342,14 @@ scavenge_stack(StgPtr p, StgPtr stack_end)
* 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: */
...
...
ghc/rts/StgStdThunks.hc
View file @
d4e0cee2
/* -----------------------------------------------------------------------------
* $Id: StgStdThunks.hc,v 1.
3
1999/0
2/05 16:03:00
simonm Exp $
* $Id: StgStdThunks.hc,v 1.
4
1999/0
3/26 10:29:05
simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
...
...
@@ -145,6 +145,8 @@ FN_(__ap_6_upd_entry);
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)
*/
...
...
ghc/rts/Updates.hc
View file @
d4e0cee2
/* -----------------------------------------------------------------------------
* $Id: Updates.hc,v 1.1
2
1999/03/2
5
1
3:14
:0
8
simonm Exp $
* $Id: Updates.hc,v 1.1
3
1999/03/2
6
1
0:29
:0
6
simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
...
...
@@ -227,11 +227,7 @@ EXTFUN(stg_update_PAP)
#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) {
...
...
@@ -467,7 +463,7 @@ SEQ_FRAME_ENTRY_TEMPLATE(seq_frame_5_entry,ENTRY_CODE(Sp[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
...
...
@@ -485,7 +481,7 @@ STGFUN(seq_entry)
{
FB_
STK_CHK_GEN(sizeofW(StgSeqFrame), NO_PTRS, seq_entry, );
Sp -= sizeof(StgSeqFrame);
Sp -= sizeof
W
(StgSeqFrame);
PUSH_SEQ_FRAME(Sp);
R1.cl = R1.cl->payload[0];
JMP_(ENTRY_CODE(*R1.p));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment