Lua registers selection

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua registers selection

Marco Bambini
Is there an explanation somewhere about how Lua decides which registers to use during codegen?

Thanks a lot.
--
Marco Bambini
http://www.sqlabs.com
http://twitter.com/sqlabs
http://instagram.com/sqlabs



Reply | Threaded
Open this post in threaded view
|

Re: Lua registers selection

Lourival Vieira Neto
On Tue, Jun 14, 2016 at 11:53 AM, Marco Bambini <[hidden email]> wrote:
> Is there an explanation somewhere about how Lua decides which registers to use during codegen?

https://www.lua.org/doc/jucs05.pdf

--
Lourival Vieira Neto

Reply | Threaded
Open this post in threaded view
|

Re: Lua registers selection

Roberto Ierusalimschy
In reply to this post by Marco Bambini
> Is there an explanation somewhere about how Lua decides which
> registers to use during codegen?

Basically it gets the next available free register. Because Lua does
few optimizations on its opcodes, the use of registers most of the
time follows a stack discipline. Moreover, as each function can use
as much as 250 free registers, reducing register use is not a concern.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: Lua registers selection

Lourival Vieira Neto
In reply to this post by Lourival Vieira Neto
On Tue, Jun 14, 2016 at 12:02 PM, Lourival Vieira Neto
<[hidden email]> wrote:
> On Tue, Jun 14, 2016 at 11:53 AM, Marco Bambini <[hidden email]> wrote:
>> Is there an explanation somewhere about how Lua decides which registers to use during codegen?
>
> https://www.lua.org/doc/jucs05.pdf

Sorry for the noise; I've misread this..
--
Lourival Vieira Neto