summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/X86/Ppr.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2019-02-11 17:40:00 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-14 02:29:54 -0500
commit1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3 (patch)
tree4abf3da5c8a8d5fdd88903613d2ce42346e4943f /compiler/nativeGen/X86/Ppr.hs
parent0f1eb88c93143359fa671bb72aceebc299c87a95 (diff)
downloadhaskell-1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3.tar.gz
NCG: fast compilation of very large strings (#16190)
This patch adds an optimization into the NCG: for large strings (threshold configurable via -fbinary-blob-threshold=NNN flag), instead of printing `.asciz "..."` in the generated ASM source, we print `.incbin "tmpXXX.dat"` and we dump the contents of the string into a temporary "tmpXXX.dat" file. See the note for more details.
Diffstat (limited to 'compiler/nativeGen/X86/Ppr.hs')
-rw-r--r--compiler/nativeGen/X86/Ppr.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs
index 075bb26337..83356758af 100644
--- a/compiler/nativeGen/X86/Ppr.hs
+++ b/compiler/nativeGen/X86/Ppr.hs
@@ -47,7 +47,6 @@ import FastString
import Outputable
import Data.Word
-
import Data.Bits
-- -----------------------------------------------------------------------------
@@ -154,8 +153,7 @@ pprDatas (align, (Statics lbl dats))
= vcat (pprAlign align : pprLabel lbl : map pprData dats)
pprData :: CmmStatic -> SDoc
-pprData (CmmString str)
- = ptext (sLit "\t.asciz ") <> doubleQuotes (pprASCII str)
+pprData (CmmString str) = pprBytes str
pprData (CmmUninitialised bytes)
= sdocWithPlatform $ \platform ->