Re: Understanding SNAP

  • From: Raj <rajlistuser@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 5 Oct 2017 10:44:03 +0530

On Thu, Oct 5, 2017 at 3:16 AM, Peter Cawley <corsix@xxxxxxxxxx> wrote:

As mentioned above, the only IR you need is SNAP 0. Once you have
that, you need to go to your Lua source, identify which locals are
live, consider them in lexicographical order of definition, and line
them up 1:1 with SNAP entries - noting that function arguments count
as locals for this purpose (and obviously are lexicographically before
everything declared using the "local" keyword), for-loops count as an
extra three, etc.

Thank you so much for the detailed answer. You have demystified the
register coalescing too complex NYI and given a clear path to tackle
it. I guess I can now go back and fix my code :)

Thanks again,

Raj

Other related posts: