diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2019-08-21 17:31:49 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-30 22:39:53 -0400 |
commit | f3cb8c7cb99e05feb0f62f5a076400dcf9f930a0 (patch) | |
tree | 9f3ec4b8040bcfb0b48a71367199a5f9ad46b768 /ghc | |
parent | ce64b397777408731c6dd3f5c55ea8415f9f565b (diff) | |
download | haskell-f3cb8c7cb99e05feb0f62f5a076400dcf9f930a0.tar.gz |
Refactor iface file generation:
This commit refactors interface file generation to allow information
from the later passed (NCG, STG) to be stored in interface files.
We achieve this by splitting interface file generation into two parts:
* Partial interfaces, built based on the result of the core pipeline
* A fully instantiated interface, which also contains the final
fingerprints and can optionally contain information produced by the backend.
This change is required by !1304 and !1530.
-dynamic-too handling is refactored too: previously when generating code
we'd branch on -dynamic-too *before* code generation, but now we do it
after.
(Original code written by @AndreasK in !1530)
Performance
~~~~~~~~~~~
Before this patch interface files where created and immediately flushed
to disk which made space leaks impossible.
With this change we instead use NFData to force all iface related data
structures to avoid space leaks.
In the process of refactoring it was discovered that the code in the
ToIface Module allocated a lot of thunks which were immediately forced
when writing/forcing the interface file. So we made this module more
strict to avoid creating many of those thunks.
Bottom line is that allocations go down by about ~0.1% compared to
master.
Residency is not meaningfully different after this patch.
Runtime was not benchmarked.
Co-Authored-By: Andreas Klebinger <klebinger.andreas@gmx.at>
Co-Authored-By: Ömer Sinan Ağacan <omer@well-typed.com>
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/Main.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs index ea320be40f..d53c71a779 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -903,7 +903,7 @@ abiHash strs = do put_ bh hiVersion -- package hashes change when the compiler version changes (for now) -- see #5328 - mapM_ (put_ bh . mi_mod_hash) ifaces + mapM_ (put_ bh . mi_mod_hash . mi_final_exts) ifaces f <- fingerprintBinMem bh putStrLn (showPpr dflags f) |