Re: Understanding SNAP

  • From: Raj <rajlistuser@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 26 Sep 2017 14:18:58 +0530

Thanks a lot for your clear and concise explanations! This thread has
been very helpful to understand the innards of luajit.

On Tue, Sep 26, 2017 at 2:17 AM, Peter Cawley <corsix@xxxxxxxxxx> wrote:

That said, if values are in C stack spill slots rather than CPU registers

Just to clarify: Is the number of CPU registers determined by the
actual CPU architecture? ie. same code/luajit combination which spills
registers in a CPU with less number of registers will not spill
registers in a CPU with more number of registers? Consequently
register coalescing  NYI in one CPU may disappear in another CPU with
more number of registers?

At a slightly higher level, you can consider the
register / C stack layout at the exit point in the parent trace, and
the register / C stack layout at the entry point in the side trace,
and LuaJIT's job is to shuffle things around in order to reach the
layout desired by the side trace,

Can you please shed some light on "shuffle things around" and layout
desired by the side trace" part?

An SLOAD indicates a load from the stack rather than a load from any 
preceding snapshot

This was the part I missed.

In a SNAP line like this:

[ app.lua:379|---- ---- 0001 0002 0003 0004 0005 0006 0007 0008
app.lua:471|0009 0004 0002 0008 0007 0015 heap.lua:145|0010 +1   0016
0017 0011 +4   ]

Does Each filename:num| separation represents one stack frame from the
function at that filename:num called previously?

Also what does the +1 and +4 denote?


Thanks again,

Raj

Other related posts: