ByteCodeGen: use byte indexing for BCenv
ClosedPublic

Authored by michalt on Jul 16 2017, 7:13 AM.

Details

Summary

This is another change needed for Trac #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 newtypes 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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
michalt created this revision.Jul 16 2017, 7:13 AM
simonmar accepted this revision.Jul 18 2017, 6:55 AM

Didn't read it all in detail, but in principle this looks fine. Please fix the long lines before committing.

compiler/ghci/ByteCodeGen.hs
227–230

Use quotRem here

233

The $! has no effect

This revision is now accepted and ready to land.Jul 18 2017, 6:55 AM
michalt updated this revision to Diff 13220.Jul 18 2017, 2:13 PM
michalt marked 2 inline comments as done.

address comments from Simon

Marking comments as "Done"

bgamari requested changes to this revision.Jul 20 2017, 3:38 PM

@michalt, can I ask you to rebase this?

This revision now requires changes to proceed.Jul 20 2017, 3:38 PM
michalt updated this revision to Diff 13295.Jul 22 2017, 10:47 AM
michalt edited edge metadata.

rebase

bgamari accepted this revision.Jul 28 2017, 10:46 AM

Thanks!

This revision is now accepted and ready to land.Jul 28 2017, 10:46 AM
This revision was automatically updated to reflect the committed changes.