question about upvalue bytecode encoding

  • From: Francesco Abbate <francesco.bbt@xxxxxxxxx>
  • To: luajit <luajit@xxxxxxxxxxxxx>
  • Date: Tue, 25 Mar 2014 23:44:51 +0100

Hi,

I'm working on luajit-lang-toolkit to complete the bytecode generator.

In case someone is interested: I've completed the implementation of
goto statements and included a test suite. I'm now ironing out the
last few remaining issues.

Working on the bytecode encoding of the prototypes I've seen that
upvalues are sometimes encoded with a bitwise or with 0x8000 or
0xc000. I was wondering the difference between these two kinds of
upvalues.

In Nyanga's bytecode generator Richard's was using only the 0x8000 form.

I know that there is a difference between direct upvalues (local
variables of the enclosing functions) and indirect upvalues but the
0x8000 vs 0xc000 is unclear to me.

I would greatly appreciate to have some clarifications or otherwise to
have an indication of where to look in the source code.

Francesco

Other related posts: