Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,323
Issues
4,323
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
376
Merge Requests
376
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
53810006
Commit
53810006
authored
Oct 19, 2012
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
profiling fixes
parent
660dc69a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
48 deletions
+50
-48
includes/Cmm.h
includes/Cmm.h
+6
-8
rts/Exception.cmm
rts/Exception.cmm
+4
-4
rts/HeapStackCheck.cmm
rts/HeapStackCheck.cmm
+1
-1
rts/PrimOps.cmm
rts/PrimOps.cmm
+23
-19
rts/StgStartup.cmm
rts/StgStartup.cmm
+1
-1
rts/StgStdThunks.cmm
rts/StgStdThunks.cmm
+9
-9
rts/Updates.cmm
rts/Updates.cmm
+4
-4
rts/Updates.h
rts/Updates.h
+2
-2
No files found.
includes/Cmm.h
View file @
53810006
...
...
@@ -250,7 +250,7 @@
#define LOAD_INFO(ret,x) \
info = %INFO_PTR(UNTAG(x));
#define
MAYBE_UNTAG(x) UNTAG(x);
#define
UNTAG_IF_PROF(x) UNTAG(x)
#else
...
...
@@ -260,7 +260,7 @@
} \
info = %INFO_PTR(x);
#define
MAYBE_UNTAG
(x) (x)
/* already untagged */
#define
UNTAG_IF_PROF
(x) (x)
/* already untagged */
#endif
...
...
@@ -306,7 +306,7 @@
} \
default: \
{ \
x =
MAYBE_UNTAG(x);
\
x =
UNTAG_IF_PROF(x);
\
jump %ENTRY_CODE(info) (x); \
} \
}
...
...
@@ -346,13 +346,11 @@
------------------------------------------------------------------------- */
#if defined(PROFILING)
#define PROF_HDR_FIELDS(w_) PROF_HDR_FIELDS_(w_,prof_hdr_1,prof_hdr_2)
#define PROF_HDR_FIELDS_(w_,hdr1,hdr2) \
w_ hdr1, \
#define PROF_HDR_FIELDS(w_,hdr1,hdr2) \
w_ hdr1, \
w_ hdr2,
#else
#define PROF_HDR_FIELDS(w_)
/* nothing */
#define PROF_HDR_FIELDS_(w_,hdr1,hdr2)
/* nothing */
#define PROF_HDR_FIELDS(w_,hdr1,hdr2)
/* nothing */
#endif
/* -------------------------------------------------------------------------
...
...
rts/Exception.cmm
View file @
53810006
...
...
@@ -341,15 +341,15 @@ stg_killMyself
* kind of return to the activation record underneath us on the stack.
*/
#define
CATCH_FRAME_FIELDS
(
w_
,
p_
,
info_ptr
,
exceptions_blocked
,
handler
)
\
#define
CATCH_FRAME_FIELDS
(
w_
,
p_
,
info_ptr
,
p1
,
p2
,
exceptions_blocked
,
handler
)
\
w_
info_ptr
,
\
PROF_HDR_FIELDS
(
w_
)
\
PROF_HDR_FIELDS
(
w_
,
p1
,
p2
)
\
w_
exceptions_blocked
,
\
p_
handler
INFO_TABLE_RET
(
stg_catch_frame
,
CATCH_FRAME
,
CATCH_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
CATCH_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
p1
,
p2
,
exceptions_blocked
,
handler
))
return
(
P_
ret
)
{
...
...
@@ -388,7 +388,7 @@ stg_catchzh ( P_ io, /* :: IO a */
TICK_SLOW_CALL_v
();
jump
stg_ap_v_fast
(
CATCH_FRAME_FIELDS
(,,
stg_catch_frame_info
,
(
CATCH_FRAME_FIELDS
(,,
stg_catch_frame_info
,
CCCS
,
0
,
exceptions_blocked
,
handler
))
(
io
);
}
...
...
rts/HeapStackCheck.cmm
View file @
53810006
...
...
@@ -216,7 +216,7 @@ stg_gc_prim_n (W_ arg)
/* The stg_enter_checkbh frame has the same shape as an update frame: */
INFO_TABLE_RET
(
stg_enter_checkbh
,
RET_SMALL
,
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
ccs
,
updatee
))
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
ccs
,
p2
,
updatee
))
return
(
P_
ret
)
{
foreign
"
C
"
checkBlockingQueues
(
MyCapability
()
"
ptr
"
,
...
...
rts/PrimOps.cmm
View file @
53810006
...
...
@@ -676,11 +676,12 @@ stg_threadStatuszh ( gcptr tso )
// Catch retry frame -----------------------------------------------------------
#define
CATCH_RETRY_FRAME_FIELDS
(
w_
,
p_
,
info_ptr
,
\
p1
,
p2
,
\
running_alt_code
,
\
first_code
,
\
alt_code
)
\
w_
info_ptr
,
\
PROF_HDR_FIELDS
(
w_
)
\
PROF_HDR_FIELDS
(
w_
,
p1
,
p2
)
\
w_
running_alt_code
,
\
p_
first_code
,
\
p_
alt_code
...
...
@@ -688,7 +689,7 @@ stg_threadStatuszh ( gcptr tso )
INFO_TABLE_RET
(
stg_catch_retry_frame
,
CATCH_RETRY_FRAME
,
CATCH_RETRY_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
info_ptr
,
p1
,
p2
,
running_alt_code
,
first_code
,
alt_code
))
...
...
@@ -712,14 +713,14 @@ INFO_TABLE_RET(stg_catch_retry_frame, CATCH_RETRY_FRAME,
StgTSO_trec
(
CurrentTSO
)
=
new_trec
;
if
(
running_alt_code
!=
0
)
{
jump
stg_ap_v_fast
(
CATCH_RETRY_FRAME_FIELDS
(,,
info_ptr
,
(
CATCH_RETRY_FRAME_FIELDS
(,,
info_ptr
,
p1
,
p2
,
running_alt_code
,
first_code
,
alt_code
))
(
alt_code
);
}
else
{
jump
stg_ap_v_fast
(
CATCH_RETRY_FRAME_FIELDS
(,,
info_ptr
,
(
CATCH_RETRY_FRAME_FIELDS
(,,
info_ptr
,
p1
,
p2
,
running_alt_code
,
first_code
,
alt_code
))
...
...
@@ -731,9 +732,9 @@ INFO_TABLE_RET(stg_catch_retry_frame, CATCH_RETRY_FRAME,
// Atomically frame ------------------------------------------------------------
// This must match StgAtomicallyFrame in Closures.h
#define
ATOMICALLY_FRAME_FIELDS
(
w_
,
p_
,
info_ptr
,
code
,
next
,
result
)
\
#define
ATOMICALLY_FRAME_FIELDS
(
w_
,
p_
,
info_ptr
,
p1
,
p2
,
code
,
next
,
result
)
\
w_
info_ptr
,
\
PROF_HDR_FIELDS
(
w_
)
\
PROF_HDR_FIELDS
(
w_
,
p1
,
p2
)
\
p_
code
,
\
p_
next
,
\
p_
result
...
...
@@ -742,7 +743,7 @@ INFO_TABLE_RET(stg_catch_retry_frame, CATCH_RETRY_FRAME,
INFO_TABLE_RET
(
stg_atomically_frame
,
ATOMICALLY_FRAME
,
// layout of the frame, and bind the field names
ATOMICALLY_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
info_ptr
,
p1
,
p2
,
code
,
next_invariant
,
frame_result
))
...
...
@@ -779,7 +780,8 @@ INFO_TABLE_RET(stg_atomically_frame, ATOMICALLY_FRAME,
StgTSO_trec
(
CurrentTSO
)
=
trec
;
q
=
StgInvariantCheckQueue_invariant
(
next_invariant
);
jump
stg_ap_v_fast
(
ATOMICALLY_FRAME_FIELDS
(,,
info_ptr
,
code
,
next_invariant
,
frame_result
))
(
ATOMICALLY_FRAME_FIELDS
(,,
info_ptr
,
p1
,
p2
,
code
,
next_invariant
,
frame_result
))
(
StgAtomicInvariant_code
(
q
));
}
else
{
...
...
@@ -799,7 +801,8 @@ INFO_TABLE_RET(stg_atomically_frame, ATOMICALLY_FRAME,
jump
stg_ap_v_fast
// push the StgAtomicallyFrame again: the code generator is
// clever enough to only assign the fields that have changed.
(
ATOMICALLY_FRAME_FIELDS
(,,
info_ptr
,
code
,
next_invariant
,
frame_result
))
(
ATOMICALLY_FRAME_FIELDS
(,,
info_ptr
,
p1
,
p2
,
code
,
next_invariant
,
frame_result
))
(
code
);
}
}
...
...
@@ -809,7 +812,7 @@ INFO_TABLE_RET(stg_atomically_frame, ATOMICALLY_FRAME,
INFO_TABLE_RET
(
stg_atomically_waiting_frame
,
ATOMICALLY_FRAME
,
// layout of the frame, and bind the field names
ATOMICALLY_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
info_ptr
,
p1
,
p2
,
code
,
next_invariant
,
frame_result
))
...
...
@@ -822,7 +825,7 @@ INFO_TABLE_RET(stg_atomically_waiting_frame, ATOMICALLY_FRAME,
if
(
valid
!=
0
)
{
/* Previous attempt is still valid: no point trying again yet */
jump
stg_block_noregs
(
ATOMICALLY_FRAME_FIELDS
(,,
info_ptr
,
(
ATOMICALLY_FRAME_FIELDS
(,,
info_ptr
,
p1
,
p2
,
code
,
next_invariant
,
frame_result
))
();
}
else
{
...
...
@@ -832,7 +835,7 @@ INFO_TABLE_RET(stg_atomically_waiting_frame, ATOMICALLY_FRAME,
// change the frame header to stg_atomically_frame_info
jump
stg_ap_v_fast
(
ATOMICALLY_FRAME_FIELDS
(,,
stg_atomically_frame_info
,
(
ATOMICALLY_FRAME_FIELDS
(,,
stg_atomically_frame_info
,
p1
,
p2
,
code
,
next_invariant
,
frame_result
))
(
code
);
}
...
...
@@ -845,15 +848,15 @@ INFO_TABLE_RET(stg_atomically_waiting_frame, ATOMICALLY_FRAME,
* kind of return to the activation record underneath us on the stack.
*/
#define
CATCH_STM_FRAME_FIELDS
(
w_
,
p_
,
info_ptr
,
code
,
handler
)
\
#define
CATCH_STM_FRAME_FIELDS
(
w_
,
p_
,
info_ptr
,
p1
,
p2
,
code
,
handler
)
\
w_
info_ptr
,
\
PROF_HDR_FIELDS
(
w_
)
\
PROF_HDR_FIELDS
(
w_
,
p1
,
p2
)
\
p_
code
,
\
p_
handler
INFO_TABLE_RET
(
stg_catch_stm_frame
,
CATCH_STM_FRAME
,
// layout of the frame, and bind the field names
CATCH_STM_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
code
,
handler
))
CATCH_STM_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
p1
,
p2
,
code
,
handler
))
return
(
P_
ret
)
{
W_
r
,
trec
,
outer
;
...
...
@@ -872,7 +875,7 @@ INFO_TABLE_RET(stg_catch_stm_frame, CATCH_STM_FRAME,
StgTSO_trec
(
CurrentTSO
)
=
new_trec
;
jump
stg_ap_v_fast
(
CATCH_STM_FRAME_FIELDS
(,,
info_ptr
,
code
,
handler
))
(
CATCH_STM_FRAME_FIELDS
(,,
info_ptr
,
p1
,
p2
,
code
,
handler
))
(
code
);
}
}
...
...
@@ -907,7 +910,7 @@ stg_atomicallyzh (P_ stm)
StgTSO_trec
(
CurrentTSO
)
=
new_trec
;
jump
stg_ap_v_fast
(
ATOMICALLY_FRAME_FIELDS
(,,
stg_atomically_frame_info
,
(
ATOMICALLY_FRAME_FIELDS
(,,
stg_atomically_frame_info
,
CCCS
,
0
,
code
,
next_invariant
,
frame_result
))
(
stm
);
}
...
...
@@ -937,7 +940,8 @@ stg_catchSTMzh (P_ code /* :: STM a */,
StgTSO_trec
(
CurrentTSO
)
=
new_trec
;
jump
stg_ap_v_fast
(
CATCH_STM_FRAME_FIELDS
(,,
stg_catch_stm_frame_info
,
code
,
handler
))
(
CATCH_STM_FRAME_FIELDS
(,,
stg_catch_stm_frame_info
,
CCCS
,
0
,
code
,
handler
))
(
code
);
}
...
...
@@ -959,7 +963,7 @@ stg_catchRetryzh (P_ first_code, /* :: STM a */
// push the CATCH_RETRY stack frame, and apply first_code to realWorld#
jump
stg_ap_v_fast
(
CATCH_RETRY_FRAME_FIELDS
(,,
stg_catch_retry_frame_info
,
(
CATCH_RETRY_FRAME_FIELDS
(,,
stg_catch_retry_frame_info
,
CCCS
,
0
,
0
,
/* not running_alt_code */
first_code
,
alt_code
))
...
...
rts/StgStartup.cmm
View file @
53810006
...
...
@@ -36,7 +36,7 @@
INFO_TABLE_RET
(
stg_stop_thread
,
STOP_FRAME
,
W_
info_ptr
,
PROF_HDR_FIELDS
(
W_
))
PROF_HDR_FIELDS
(
W_
,
p1
,
p2
))
/* no return list: explicit stack layout */
{
/*
...
...
rts/StgStdThunks.cmm
View file @
53810006
...
...
@@ -67,11 +67,11 @@
UPD_BH_UPDATABLE
(
node
);
\
LDV_ENTER
(
node
);
\
selectee
=
StgThunk_payload
(
node
,
0
);
\
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
\
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
\
ENTER_CCS_THUNK
(
node
);
\
if
(
NEED_EVAL
(
selectee
))
{
\
SAVE_CCS
;
\
(
P_
constr
)
=
call
%GET_ENTRY
(
selectee
)
(
selectee
);
\
(
P_
constr
)
=
call
%GET_ENTRY
(
UNTAG_IF_PROF
(
selectee
))
(
selectee
);
\
RESTORE_CCS
;
\
selectee
=
constr
;
\
}
\
...
...
@@ -165,7 +165,7 @@ INFO_TABLE(stg_ap_1_upd,1,0,THUNK_1_0,"stg_ap_1_upd_info","stg_ap_1_upd_info")
STK_CHK_NP
(
node
);
UPD_BH_UPDATABLE
(
node
);
LDV_ENTER
(
node
);
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
ENTER_CCS_THUNK
(
node
);
jump
stg_ap_0_fast
(
StgThunk_payload
(
node
,
0
));
...
...
@@ -179,7 +179,7 @@ INFO_TABLE(stg_ap_2_upd,2,0,THUNK_2_0,"stg_ap_2_upd_info","stg_ap_2_upd_info")
STK_CHK_NP
(
node
);
UPD_BH_UPDATABLE
(
node
);
LDV_ENTER
(
node
);
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
ENTER_CCS_THUNK
(
node
);
jump
stg_ap_p_fast
(
StgThunk_payload
(
node
,
0
),
...
...
@@ -194,7 +194,7 @@ INFO_TABLE(stg_ap_3_upd,3,0,THUNK,"stg_ap_3_upd_info","stg_ap_3_upd_info")
STK_CHK_NP
(
node
);
UPD_BH_UPDATABLE
(
node
);
LDV_ENTER
(
node
);
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
ENTER_CCS_THUNK
(
node
);
jump
stg_ap_pp_fast
(
StgThunk_payload
(
node
,
0
),
...
...
@@ -210,7 +210,7 @@ INFO_TABLE(stg_ap_4_upd,4,0,THUNK,"stg_ap_4_upd_info","stg_ap_4_upd_info")
STK_CHK_NP
(
node
);
UPD_BH_UPDATABLE
(
node
);
LDV_ENTER
(
node
);
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
ENTER_CCS_THUNK
(
node
);
jump
stg_ap_ppp_fast
(
StgThunk_payload
(
node
,
0
),
...
...
@@ -227,7 +227,7 @@ INFO_TABLE(stg_ap_5_upd,5,0,THUNK,"stg_ap_5_upd_info","stg_ap_5_upd_info")
STK_CHK_NP
(
node
);
UPD_BH_UPDATABLE
(
node
);
LDV_ENTER
(
node
);
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
ENTER_CCS_THUNK
(
node
);
jump
stg_ap_pppp_fast
(
StgThunk_payload
(
node
,
0
),
...
...
@@ -245,7 +245,7 @@ INFO_TABLE(stg_ap_6_upd,6,0,THUNK,"stg_ap_6_upd_info","stg_ap_6_upd_info")
STK_CHK_NP
(
node
);
UPD_BH_UPDATABLE
(
node
);
LDV_ENTER
(
node
);
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
ENTER_CCS_THUNK
(
node
);
jump
stg_ap_ppppp_fast
(
StgThunk_payload
(
node
,
0
),
...
...
@@ -264,7 +264,7 @@ INFO_TABLE(stg_ap_7_upd,7,0,THUNK,"stg_ap_7_upd_info","stg_ap_7_upd_info")
STK_CHK_NP
(
node
);
UPD_BH_UPDATABLE
(
node
);
LDV_ENTER
(
node
);
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
node
))
{
push
(
UPDATE_FRAME_FIELDS
(,,
stg_upd_frame_info
,
CCCS
,
0
,
node
))
{
ENTER_CCS_THUNK
(
node
);
jump
stg_ap_pppppp_fast
(
StgThunk_payload
(
node
,
0
),
...
...
rts/Updates.cmm
View file @
53810006
...
...
@@ -26,7 +26,7 @@
* we don't mind duplicating this jump.
*/
INFO_TABLE_RET
(
stg_upd_frame
,
UPDATE_FRAME
,
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
_ccs
,
updatee
)
)
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
_ccs
,
_unused
,
updatee
)
)
return
(
P_
ret
)
/* the closure being returned */
{
/* ToDo: it might be a PAP, so we should check... */
...
...
@@ -42,7 +42,7 @@ INFO_TABLE_RET ( stg_upd_frame, UPDATE_FRAME,
* another thread in the meantime.
*/
INFO_TABLE_RET
(
stg_marked_upd_frame
,
UPDATE_FRAME
,
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
_ccs
,
updatee
)
)
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
_ccs
,
_unused
,
updatee
)
)
return
(
P_
ret
)
/* the closure being returned */
{
W_
v
,
i
,
tso
,
link
;
...
...
@@ -77,11 +77,11 @@ INFO_TABLE_RET ( stg_marked_upd_frame, UPDATE_FRAME,
* high watermark.
*/
INFO_TABLE_RET
(
stg_bh_upd_frame
,
UPDATE_FRAME
,
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
ccs
,
updatee
)
)
UPDATE_FRAME_FIELDS
(
W_
,
P_
,
info_ptr
,
ccs
,
_unused
,
updatee
)
)
return
(
P_
ret
)
/* the closure being returned */
{
// This all compiles away to a single jump instruction (sigh)
jump
RET_LBL
(
stg_marked_upd_frame
)
(
UPDATE_FRAME_FIELDS
(,,
info_ptr
,
ccs
,
updatee
)
)
(
UPDATE_FRAME_FIELDS
(,,
info_ptr
,
ccs
,
_unused
,
updatee
)
)
(
ret
);
}
rts/Updates.h
View file @
53810006
...
...
@@ -35,9 +35,9 @@
*/
#ifdef CMINUSMINUS
#define UPDATE_FRAME_FIELDS(w_,p_,info_ptr,ccs,
updatee)
\
#define UPDATE_FRAME_FIELDS(w_,p_,info_ptr,ccs,
p2,updatee)
\
w_ info_ptr, \
PROF_HDR_FIELDS
_(w_,ccs,_unused_)
\
PROF_HDR_FIELDS
(w_,ccs,p2)
\
p_ updatee
...
...
Write
Preview
Markdown
is supported
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