[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: VM compilation question
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 21 Jul 2021 14:00:38 -0300
> Hmmm. Did that change add much complexity to the compiler? In
> particular, the logic in the compiler that has to fall back on a
> multi-instruction sequence when the number of constants is large?
It does add complexity, but not in that part. The complexity comes
because now there are several different kinds of operands and
instructions for one same operation. For instance, a sum can be
coded with OP_ADD (two registers), OP_ADDI (a register plus an
immediate small integer), and OP_ADDK (a register plus a constant
in the contant table). Moreover, 1+x is coded as x+1 to use OP_ADDI.