Save a word in the info table on x86_64
authorSimon Marlow <marlowsd@gmail.com>
Sun, 22 Apr 2018 13:28:47 +0000 (14:28 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 16 May 2018 12:36:13 +0000 (13:36 +0100)
commit2b0918c9834be1873728176e4944bec26271234a
treef47689b64d3339c9cd92ad286fe01db478b53550
parentfbd28e2c6b5f1302cd2d36d79149e3b0a9f01d84
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
compiler/cmm/CmmBuildInfoTables.hs
compiler/cmm/CmmExpr.hs
compiler/cmm/CmmInfo.hs
includes/rts/storage/ClosureMacros.h
includes/rts/storage/InfoTables.h
libraries/ghci/GHCi/InfoTable.hsc
rts/RtsAPI.c
rts/sm/Evac.c
rts/sm/Scav.c