| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
New instruction format 'ivABC' (a variant of iABC where parameter vC has
10 bits) allows constructors of up to 1024 elements to be coded without
EXTRAARG.
|
| | |
|
| |
|
|
|
|
|
|
| |
Instead of a fixed limit of 50 registers (which, in a bad worst case,
can limit the nesting of constructors to 5 levels), the compiler
computes an individual limit for each constructor based on how many
registers are available when it runs. This limit then controls the
frequency of SETLIST instructions.
|
| |
|
|
| |
Plus, added a test to check that limit.
|
| |
|
|
|
|
| |
Several definitions that don't need to be "global" (that is, that
concerns only specific parts of the code) moved out of llimits.h,
to more appropriate places.
|
| |
|
|
|
| |
ISO C forbids assignment of a union field to another field of the same
union.
|
| |
|
|
|
|
|
| |
Undoing previous commit. Returning TValue increases code size without
any visible gains. Returning the tag is a little simpler than returning
a special code (HOK/HNOTFOUND) and the tag is useful by itself in
some cases.
|
| |
|
|
|
|
| |
Instead of receiving a parameter telling them where to put the result
of the query, these functions return the TValue directly. (That is,
they return a structure.)
|
| |\ |
|
| | |\ |
|
| | | | |
|
| | |/
|/|
| |
| | |
So that the other bits can be used for other purposes.
|
| | |
| |
| |
| |
| | |
Several functions that were already being used only inside their
own file have been declared as 'static'.
|
| |/
|
|
|
| |
- Better comments about short strings in opcodes.
- luaH_newkey made static.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Warnings with clang when using long double for Lua floats.
|
| |
|
|
|
|
|
|
| |
In 'lcode.c', when adding constants to the list of constants of a
function, integers represent themselves in the cache and floats
with integral values get a small delta to avoid collision with
integers. (This change avoids creating artificial addresses; the old
implementation converted integers to pointers to index the cache.)
|
| |
|
|
|
|
|
|
| |
Some places don't need the "fast path" macro tointegerns, either
because speed is not essential (lcode.c) or because the value is not
supposed to be an integer already (luaV_equalobj and luaG_tointerror).
Moreover, luaV_equalobj should always use F2Ieq, even if Lua is
compiled to "round to floor".
|
| |
|
|
|
| |
By producing absolute line information at regular intervals, a simple
division can compute the correct entry for a given instruction.
|
| |
|
|
|
| |
The function 'changedline' tries harder to avoid calling
'luaG_getfuncline' plus small changes in the use of 'L->oldpc'.
|
| |
|
|
|
| |
Functions to set values in a table (luaH_set, luaH_newkey, etc.) receive
the new value, instead of returning a slot where to put the value.
|
| |
|
|
| |
Names in the parser and other details that do not change actual code.
|
| |
|
|
|
|
| |
- small corrections in the manual
- ldo.c: 'docall' -> 'ccall' ('docall' already used in 'lua.c')
- comments
|
| |
|
|
|
|
|
|
| |
This function was computing invalid instruction addresses when the
expression was not a multi-return instruction. (Virtually all machines
don't raise errors when computing an invalid address, as long as the
address is not accessed, but this computation is undefined behavior in
ISO C.)
|
| |
|
|
|
| |
Several details in code (e.g., moving a variable to the most inner
scope that encloses its uses), comments, parameter names, extra tests.
|
| | |
|
| |
|
|
|
| |
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
|
| |
|
|
|
|
|
| |
Instead of an explicit value (field 'b'), true and false use different
tag variants. This avoids reading an extra field and results in more
direct code. (Most code that uses booleans needs to distinguish between
true and false anyway.)
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Fixed some minor issues from the feedback for 5.4-beta rc1.
|
| |
|
|
|
|
|
| |
- Several details in 'lcode.c'
- A few more tests for code generation
- Bug in assert in 'lcode.c' ("=" x "==")
- Comments in 'lopcodes.h' and 'ltable.c'
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
The difference in performance between immediate operands and K operands
does not seem to justify all those extra opcodes. We only keep OP_ADDI,
due to its ubiquity and because the difference is a little more relevant.
(Later, OP_SUBI will be implemented by OP_ADDI, negating the constant.)
|
| |
|
|
| |
Plus, this commit removes useless 'tm' parameters in 'op_*' macros.
|
| |
|
|
|
|
|
|
|
|
|
| |
In arithmetic/bitwise operators, the call to metamethods is made
in a separate opcode following the main one. (The main
opcode skips this next one when the operation succeeds.) This
change reduces slightly the size of the binary and the complexity
of the arithmetic/bitwise opcodes. It also simplfies the treatment
of errors and yeld/resume in these operations, as there are much
fewer cases to consider. (Only OP_MMBIN/OP_MMBINI/OP_MMBINK,
instead of all variants of all arithmetic/bitwise operators.)
|
| |
|
|
|
|
|
|
| |
Constants directly assigned to other constants were not propagating:
For instance, in
local <const> k1 = 10
local <const> k2 = k1
'k2' were not treated as a compile-time constant.
|
| |
|
|
|
|
|
| |
String literal expressions have their own kind VKSTR, instead of the
generic VK. This allows strings to "cross" functions without entering
their constant tables (e.g., if they are used only by some nested
function).
|
| |
|
|
|
| |
Many functions are vararg but create no upvalues, so it is better
to separate the tests for these two kinds of "extra work".
|
| |
|
|
|
|
| |
Opcodes OP_NEWTABLE and OP_SETLIST use the same representation to
store the size of the array part of a table. This new representation
can go up to 2^33 (8 + 25 bits).
|
| |
|
|
|
|
| |
OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep
the exact size of the array part of the table to be created.
(Functions 'luaO_int2fb'/'luaO_fb2int' were removed.)
|
| |
|
|
|
| |
Local constant variables initialized with compile-time constants
are optimized away from the code.
|
| |
|
|
|
|
|
| |
This commit detaches the number of active variables from the
number of variables in the stack, during compilation. Soon,
compile-time constants will be propagated and therefore will
not exist during run time (in the stack).
|
| |
|
|
|
|
|
|
|
| |
VLOCAL expressions keep a reference to their corresponding 'Vardesc',
and 'Upvaldesc' (for upvalues) has a field 'ro' (read-only). So, it is
easier to check whether a variable is read-only. The decoupling in
VLOCAL between 'vidx' ('Vardesc' index) and 'sidx' (stack index)
should also help the forthcoming implementation of compile-time
constant propagation.
|