ByteCodeGen: use byte indexing for BCenv
authorMichal Terepeta <michal.terepeta@gmail.com>
Fri, 28 Jul 2017 15:47:28 +0000 (11:47 -0400)
committerBen Gamari <ben@smart-cactus.org>
Fri, 28 Jul 2017 16:36:48 +0000 (12:36 -0400)
commitdac4b9d3cdca83c99d5d894d2743cc0bbca450ac
tree6786c239315cd9c8c56df566fe32ba385fa53013
parent274e9b27de30e1b7d5db8cb97b34d53ae9609a9b
ByteCodeGen: use byte indexing for BCenv

This is another change needed for #13825 (also based on D38 by Simon
Marlow).

With the change, we count the stack depth in bytes (instead of words).
We also introduce some `newtype`s to help with the change.

Note that this only changes how `ByteCodeGen` works and shouldn't
affect the generated bytecode.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: ./validate

Reviewers: bgamari, simonmar, austin, hvr

Reviewed By: bgamari, simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #13825

Differential Revision: https://phabricator.haskell.org/D3746
compiler/ghci/ByteCodeGen.hs