[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 4.0 opcode sizes
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 12 Jan 2005 10:36:02 -0200
> That's an easy one; the trickier issue is that MAXSTACK must be <=
> MAXARG_B; and lots of our code depends on a nice large MAXSTACK. So
> question 1: can I lift this restriction purely by adding new opcodes,
> or are there other dependencies I'm missing?
>
> Also, is there an unstated dependency that MAXSTACK must be <=
> MAXARG_A as well? Opcodes like OP_CALL seem to use A as a stack index.
> Is it also true that MAXARG_A must be >= MAXARG_B?
Lua 4.0 is already quite out of my memory, but as long as I remember
there are no hidden dependencies among those sizes, with one possible
exception. When computing overflows in operands, Lua may assume those
relationships. For instance, when generating a OP_CALL, Lua may not
check whether A fits in that many bits, because it is a stack index and
MAXSTACK must be smaller than MAXARG_A.
-- Roberto