[iserv] Fixing the word size for RemotePtr and toWordArray
authorBen Gamari <bgamari.foss@gmail.com>
Wed, 12 Jul 2017 00:50:38 +0000 (20:50 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 12 Jul 2017 12:55:00 +0000 (08:55 -0400)
commit7ae4a28f6a09a0540aab59f5a03fdbcd46a99f17
treee7f80cad2050ade539329caef63cd7aeba9d9487
parent60ec8f74d32a9976ac8ddf6fd366218283fcac3e
[iserv] Fixing the word size for RemotePtr and toWordArray

When we load non absolute pathed .so's this usually implies that we
expect the system to have them in place already, and hence we should not
need to ship them.  Without the absolute path to the library, we are
also unable to open and send said library.  Thus we'll do library
shipping only for libraries with absolute paths.

When dealing with a host and target of different word size (say host
hast 64bit, target has 32bit), we need to fix the RemotePtr size and the
toWordArray function, as they are part of the iserv ResolvedBCO binary
protocol.  This needs to be word size independent.  The choice for
RemotePtr to 64bit was made to ensure we can store 64bit pointers when
targeting 64bit. The choice for 32bit word arrays was made wrt.
encoding/decoding on the potentially slower device.

The efficient serialization code has been graciously provided by
@bgamari.

Reviewers: bgamari, simonmar, austin, hvr

Reviewed By: bgamari

Subscribers: Ericson2314, rwbarton, thomie, ryantrinkle

Differential Revision: https://phabricator.haskell.org/D3443
compiler/ghci/ByteCodeAsm.hs
compiler/ghci/ByteCodeLink.hs
compiler/ghci/ByteCodeTypes.hs
libraries/ghci/GHCi/BinaryArray.hs [new file with mode: 0644]
libraries/ghci/GHCi/CreateBCO.hs
libraries/ghci/GHCi/RemoteTypes.hs
libraries/ghci/GHCi/ResolvedBCO.hs
libraries/ghci/ghci.cabal.in
testsuite/tests/ghci/should_run/BinaryArray.hs [new file with mode: 0644]
testsuite/tests/ghci/should_run/all.T