Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Convert nested interpreter calls into a single loop #20
Previously, each frame of a Lua function was run in its own interpreter. While this made the implementation simpler (and possibly more elegant), it did mean the Lua stack depth was bound by Java's (which wasn't very high, due to the 3-4 calls needed to execute a function).
Instead, we convert an interpreter into a nested loop, with the outer one setting up the function from the current frame, and the inner one acting mostly the same as before. However, instead of using
We don't currently support running metamethods inside the same interpreter, but I think that is acceptable - Lua is the same, and it would mean we have to inline most of
As far as performances goes, it's rather hard to tell. I've tried to run an awful lot of benchmarks, but they're a) hazy at best and b) some have improved, some have got worse. It appears that call-heavy code has become worse, though I'm not entirely sure why - it's something I'd like to resolve before merging, but is not entirely a blocker.