Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
8d4760fb
Commit
8d4760fb
authored
Jul 20, 2016
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comments re ApThunks + small refactor in mkRhsClosure
parent
9c54185b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
compiler/codeGen/StgCmmBind.hs
compiler/codeGen/StgCmmBind.hs
+21
-15
No files found.
compiler/codeGen/StgCmmBind.hs
View file @
8d4760fb
...
...
@@ -299,24 +299,30 @@ mkRhsClosure dflags bndr _cc _bi
[]
-- No args; a thunk
(
StgApp
fun_id
args
)
|
args
`
lengthIs
`
(
arity
-
1
)
&&
all
(
isGcPtrRep
.
idPrimRep
.
unsafe_stripNV
)
fvs
&&
isUpdatable
upd_flag
&&
arity
<=
mAX_SPEC_AP_SIZE
dflags
&&
not
(
gopt
Opt_SccProfilingOn
dflags
)
-- not when profiling: we don't want to
-- lose information about this particular
-- thunk (e.g. its type) (#949)
-- Ha! an Ap thunk
-- We are looking for an "ApThunk"; see data con ApThunk in StgCmmClosure
-- of form (x1 x2 .... xn), where all the xi are locals (not top-level)
-- So the xi will all be free variables
|
args
`
lengthIs
`
(
n_fvs
-
1
)
-- This happens only if the fun_id and
-- args are all distinct local variables
-- The "-1" is for fun_id
-- Missed opportunity: (f x x) is not detected
,
all
(
isGcPtrRep
.
idPrimRep
.
unsafe_stripNV
)
fvs
,
isUpdatable
upd_flag
,
n_fvs
<=
mAX_SPEC_AP_SIZE
dflags
,
not
(
gopt
Opt_SccProfilingOn
dflags
)
-- not when profiling: we don't want to
-- lose information about this particular
-- thunk (e.g. its type) (#949)
-- Ha! an Ap thunk
=
cgRhsStdThunk
bndr
lf_info
payload
where
lf_info
=
mkApLFInfo
bndr
upd_flag
arity
-- the payload has to be in the correct order, hence we can't
-- just use the fvs.
payload
=
StgVarArg
fun_id
:
args
arity
=
length
fv
s
n_fvs
=
length
fvs
lf_info
=
mkApLFInfo
bndr
upd_flag
n_fvs
-- the payload has to be in the correct order, hence we can't
-- just use the fvs.
payload
=
StgVarArg
fun_id
:
arg
s
---------- Default case ------------------
mkRhsClosure
dflags
bndr
cc
_
fvs
upd_flag
args
body
...
...
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