diff options
author | Simon Marlow <marlowsd@gmail.com> | 2018-04-22 14:28:47 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2018-05-16 13:36:13 +0100 |
commit | 2b0918c9834be1873728176e4944bec26271234a (patch) | |
tree | f47689b64d3339c9cd92ad286fe01db478b53550 /libraries/ghci/GHCi | |
parent | fbd28e2c6b5f1302cd2d36d79149e3b0a9f01d84 (diff) | |
download | haskell-2b0918c9834be1873728176e4944bec26271234a.tar.gz |
Save a word in the info table on x86_64
Summary:
An info table with an SRT normally looks like this:
StgWord64 srt_offset
StgClosureInfo layout
StgWord32 layout
StgWord32 has_srt
But we only need 32 bits for srt_offset on x86_64, because the small
memory model requires that code segments are at most 2GB. So we can
optimise this to
StgClosureInfo layout
StgWord32 layout
StgWord32 srt_offset
saving a word. We can tell whether the info table has an SRT or not,
because zero is not a valid srt_offset, so zero still indicates that
there's no SRT.
Test Plan:
* validate
* For results, see D4632.
Reviewers: bgamari, niteria, osa1, erikd
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D4634
Diffstat (limited to 'libraries/ghci/GHCi')
-rw-r--r-- | libraries/ghci/GHCi/InfoTable.hsc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/ghci/GHCi/InfoTable.hsc b/libraries/ghci/GHCi/InfoTable.hsc index d5e50c2dff..afcfefc7fa 100644 --- a/libraries/ghci/GHCi/InfoTable.hsc +++ b/libraries/ghci/GHCi/InfoTable.hsc @@ -58,7 +58,7 @@ peekItbl a0 = do nptrs' <- (#peek StgInfoTable, layout.payload.nptrs) a0 tipe' <- (#peek StgInfoTable, type) a0 #if __GLASGOW_HASKELL__ > 804 - srtlen' <- (#peek StgInfoTable, has_srt) a0 + srtlen' <- (#peek StgInfoTable, srt) a0 #else srtlen' <- (#peek StgInfoTable, srt_bitmap) a0 #endif @@ -398,7 +398,7 @@ pokeItbl a0 itbl = do (#poke StgInfoTable, layout.payload.nptrs) a0 (nptrs itbl) (#poke StgInfoTable, type) a0 (tipe itbl) #if __GLASGOW_HASKELL__ > 804 - (#poke StgInfoTable, has_srt) a0 (srtlen itbl) + (#poke StgInfoTable, srt) a0 (srtlen itbl) #else (#poke StgInfoTable, srt_bitmap) a0 (srtlen itbl) #endif |