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
Alex D
GHC
Commits
147b5423
Commit
147b5423
authored
Jul 06, 2012
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate slightly less crap to be cleaned up later
parent
7d7c284b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
compiler/codeGen/StgCmmHeap.hs
compiler/codeGen/StgCmmHeap.hs
+7
-10
compiler/codeGen/StgCmmMonad.hs
compiler/codeGen/StgCmmMonad.hs
+7
-1
No files found.
compiler/codeGen/StgCmmHeap.hs
View file @
147b5423
...
...
@@ -45,6 +45,8 @@ import FastString( mkFastString, fsLit )
import
Constants
import
Util
import
Control.Monad
(
when
)
-----------------------------------------------------------
-- Initialise dynamic heap objects
-----------------------------------------------------------
...
...
@@ -491,20 +493,15 @@ do_checks :: Bool -- Should we check the stack?
->
FCode
()
do_checks
checkStack
alloc
do_gc
=
do
gc_id
<-
newLabelC
hp_check
<-
if
alloc
==
0
then
return
mkNop
else
do
ifthen
<-
mkCmmIfThen
hp_oflo
(
alloc_n
<*>
mkBranch
gc_id
)
return
(
mkAssign
hpReg
bump_hp
<*>
ifthen
)
if
checkStack
then
emit
=<<
mkCmmIfThenElse
sp_oflo
(
mkBranch
gc_id
)
hp_check
else
emit
hp_check
when
checkStack
$
emit
=<<
mkCmmIfGoto
sp_oflo
gc_id
emit
$
mkComment
(
mkFastString
"outOfLine should follow:"
)
when
(
alloc
/=
0
)
$
do
emitAssign
hpReg
bump_hp
emit
=<<
mkCmmIfThen
hp_oflo
(
alloc_n
<*>
mkBranch
gc_id
)
emitOutOfLine
gc_id
$
mkComment
(
mkFastString
"outOfLine here"
)
<*>
do_gc
-- this is expected to jump back somewhere
-- Test for stack pointer exhaustion, then
...
...
compiler/codeGen/StgCmmMonad.hs
View file @
147b5423
...
...
@@ -29,7 +29,8 @@ module StgCmmMonad (
getCmm
,
cgStmtsToBlocks
,
getCodeR
,
getCode
,
getHeapUsage
,
mkCmmIfThenElse
,
mkCmmIfThen
,
mkCall
,
mkCmmCall
,
mkSafeCall
,
mkCmmIfThenElse
,
mkCmmIfThen
,
mkCmmIfGoto
,
mkCall
,
mkCmmCall
,
mkSafeCall
,
forkClosureBody
,
forkStatics
,
forkAlts
,
forkProc
,
codeOnly
,
...
...
@@ -676,6 +677,11 @@ mkCmmIfThenElse e tbranch fbranch = do
mkLabel
tid
<*>
tbranch
<*>
mkBranch
endif
<*>
mkLabel
fid
<*>
fbranch
<*>
mkLabel
endif
mkCmmIfGoto
::
CmmExpr
->
BlockId
->
FCode
CmmAGraph
mkCmmIfGoto
e
tid
=
do
endif
<-
newLabelC
return
$
mkCbranch
e
tid
endif
<*>
mkLabel
endif
mkCmmIfThen
::
CmmExpr
->
CmmAGraph
->
FCode
CmmAGraph
mkCmmIfThen
e
tbranch
=
do
endif
<-
newLabelC
...
...
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