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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
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
jberryman
GHC
Commits
155d943c
Commit
155d943c
authored
Apr 04, 2013
by
nfrisby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ticky counters for heap and stack checks
parent
27cf625a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
1 deletion
+21
-1
compiler/codeGen/StgCmmHeap.hs
compiler/codeGen/StgCmmHeap.hs
+2
-1
compiler/codeGen/StgCmmTicky.hs
compiler/codeGen/StgCmmTicky.hs
+9
-0
includes/Cmm.h
includes/Cmm.h
+2
-0
includes/stg/Ticky.h
includes/stg/Ticky.h
+3
-0
rts/Linker.c
rts/Linker.c
+2
-0
rts/Ticky.c
rts/Ticky.c
+3
-0
No files found.
compiler/codeGen/StgCmmHeap.hs
View file @
155d943c
...
...
@@ -570,10 +570,11 @@ do_checks mb_stk_hwm checkYield mb_alloc_lit do_gc = do
case
mb_stk_hwm
of
Nothing
->
return
()
Just
stk_hwm
->
emit
=<<
mkCmmIfGoto
(
sp_oflo
stk_hwm
)
gc_id
Just
stk_hwm
->
tickyStackCheck
>>
(
emit
=<<
mkCmmIfGoto
(
sp_oflo
stk_hwm
)
gc_id
)
if
(
isJust
mb_alloc_lit
)
then
do
tickyHeapCheck
emitAssign
hpReg
bump_hp
emit
=<<
mkCmmIfThen
hp_oflo
(
alloc_n
<*>
mkBranch
gc_id
)
else
do
...
...
compiler/codeGen/StgCmmTicky.hs
View file @
155d943c
...
...
@@ -70,9 +70,12 @@ module StgCmmTicky (
tickyDynAlloc
,
tickyAllocHeap
,
tickyAllocPrim
,
tickyAllocThunk
,
tickyAllocPAP
,
tickyHeapCheck
,
tickyStackCheck
,
tickyUnknownCall
,
tickyDirectCall
,
...
...
@@ -481,6 +484,12 @@ tickyAllocPAP _goods _slop = ifTicky $ do
bumpTickyCounterByE
(
fsLit
"ALLOC_PAP_gds"
)
_goods
bumpTickyCounterByE
(
fsLit
"ALLOC_PAP_slp"
)
_slop
tickyHeapCheck
::
FCode
()
tickyHeapCheck
=
ifTicky
$
bumpTickyCounter
(
fsLit
"HEAP_CHK_ctr"
)
tickyStackCheck
::
FCode
()
tickyStackCheck
=
ifTicky
$
bumpTickyCounter
(
fsLit
"STK_CHK_ctr"
)
-- -----------------------------------------------------------------------------
-- Ticky utils
...
...
includes/Cmm.h
View file @
155d943c
...
...
@@ -373,6 +373,7 @@
CCCS_ALLOC(bytes);
#define HEAP_CHECK(bytes,failure) \
TICK_BUMP(HEAP_CHK_ctr); \
Hp = Hp + (bytes); \
if (Hp > HpLim) { HpAlloc = (bytes); failure; } \
TICK_ALLOC_HEAP_NOCTR(bytes);
...
...
@@ -476,6 +477,7 @@
}
#define STK_CHK(n, fun) \
TICK_BUMP(STK_CHK_ctr); \
if (Sp - (n) < SpLim) { \
GC_PRIM(fun) \
}
...
...
includes/stg/Ticky.h
View file @
155d943c
...
...
@@ -111,6 +111,9 @@ EXTERN StgInt UPD_PAP_IN_PLACE_ctr INIT(0);
EXTERN
StgInt
ALLOC_HEAP_ctr
INIT
(
0
);
EXTERN
StgInt
ALLOC_HEAP_tot
INIT
(
0
);
EXTERN
StgInt
HEAP_CHK_ctr
INIT
(
0
);
EXTERN
StgInt
STK_CHK_ctr
INIT
(
0
);
EXTERN
StgInt
ALLOC_RTS_ctr
INIT
(
0
);
EXTERN
StgInt
ALLOC_RTS_tot
INIT
(
0
);
...
...
rts/Linker.c
View file @
155d943c
...
...
@@ -958,6 +958,8 @@ typedef struct _RtsSymbolVal {
SymI_HasProto(UPD_PAP_IN_PLACE_ctr) \
SymI_HasProto(ALLOC_HEAP_ctr) \
SymI_HasProto(ALLOC_HEAP_tot) \
SymI_HasProto(HEAP_CHK_ctr) \
SymI_HasProto(STK_CHK_ctr) \
SymI_HasProto(ALLOC_RTS_ctr) \
SymI_HasProto(ALLOC_RTS_tot) \
SymI_HasProto(ALLOC_FUN_ctr) \
...
...
rts/Ticky.c
View file @
155d943c
...
...
@@ -330,6 +330,9 @@ PrintTickyInfo(void)
PR_CTR
(
ALLOC_HEAP_ctr
);
PR_CTR
(
ALLOC_HEAP_tot
);
PR_CTR
(
HEAP_CHK_ctr
);
PR_CTR
(
STK_CHK_ctr
);
PR_CTR
(
ALLOC_RTS_ctr
);
PR_CTR
(
ALLOC_RTS_tot
);
...
...
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