diff options
author | Edward Z. Yang <ezyang@mit.edu> | 2013-08-26 13:34:15 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-10-01 22:26:38 -0700 |
commit | b23ba2a7d612c6b466521399b33fe9aacf5c4f75 (patch) | |
tree | 83b044b5fb30cd0fa6256af61d38b96a5792cff0 /compiler/cmm | |
parent | 644c76a3574a623fa5d2a9a28d8e6fc971aca901 (diff) | |
download | haskell-b23ba2a7d612c6b466521399b33fe9aacf5c4f75.tar.gz |
Place static closures in their own section.
Summary:
The primary reason for doing this is assisting debuggability:
if static closures are all in the same section, they are
guaranteed to be adjacent to one another. This will help
later when we add some code that takes section start/end and
uses this to sanity-check the sections.
Part of remove HEAP_ALLOCED patch set (#8199)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Test Plan: validate
Reviewers: simonmar, austin
Subscribers: simonmar, ezyang, carter, thomie
Differential Revision: https://phabricator.haskell.org/D263
GHC Trac Issues: #8199
Diffstat (limited to 'compiler/cmm')
-rw-r--r-- | compiler/cmm/Cmm.hs | 1 | ||||
-rw-r--r-- | compiler/cmm/CmmParse.y | 2 | ||||
-rw-r--r-- | compiler/cmm/PprCmmDecl.hs | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs index 9e9bae93c6..98c5b59f23 100644 --- a/compiler/cmm/Cmm.hs +++ b/compiler/cmm/Cmm.hs @@ -170,6 +170,7 @@ data Section | RelocatableReadOnlyData | UninitialisedData | ReadOnlyData16 -- .rodata.cst16 on x86_64, 16-byte aligned + | StaticClosures | OtherSection String data CmmStatic diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 803333001c..db6cc49927 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -1105,7 +1105,7 @@ staticClosure :: PackageKey -> FastString -> FastString -> [CmmLit] -> CmmParse staticClosure pkg cl_label info payload = do dflags <- getDynFlags let lits = mkStaticClosure dflags (mkCmmInfoLabel pkg info) dontCareCCS payload [] [] [] - code $ emitDataLits (mkCmmDataLabel pkg cl_label) lits + code $ emitStaticClosure (mkCmmDataLabel pkg cl_label) lits foreignCall :: String diff --git a/compiler/cmm/PprCmmDecl.hs b/compiler/cmm/PprCmmDecl.hs index dd80f5cd56..417f90d360 100644 --- a/compiler/cmm/PprCmmDecl.hs +++ b/compiler/cmm/PprCmmDecl.hs @@ -162,6 +162,7 @@ pprSection s = case s of RelocatableReadOnlyData -> section <+> doubleQuotes (ptext (sLit "relreadonly")) UninitialisedData -> section <+> doubleQuotes (ptext (sLit "uninitialised")) + StaticClosures -> section <+> doubleQuotes (ptext (sLit "staticclosures")) OtherSection s' -> section <+> doubleQuotes (text s') where section = ptext (sLit "section") |