hippyvm/hippyvm — pull request #79 by ltratt (2014-10-17 17:32:47+00:00)
Title: Opt globals

This branch substantially rewrites the handling of globals.

Previously, there was a special handler for GLOBALS which tried to keep that
array and actual variables in sync. This was hampered by the fact that several
other classes peeked into the contents of frames.

This branch does two things 1) it makes globals more efficient by moving to a
cell-indirection scheme that covers more cases than the previous version 2)
reduces the amount of jiggery-pokery between classes.

Benchmarks which use global variables normally can get speed-ups of about 50%;
those accessing the $GLOBALS array can be upto 3x faster. Even Richards gets a
7% boost.