| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Plus some other details. (Option '-Wuninitialized' was removed from
the makefile because it is already enabled by -Wall.)
|
|
|
|
|
| |
Ensure that float constants never use integer keys, so that only
floats can collide in 'k2proto'.
|
|
|
|
|
|
|
|
|
|
| |
Moreover, each function being parsed has its own table.
The code is cleaner when each table is used for one specific purpose:
The scanner uses its table to anchor and unify strings, mapping strings
to themselves; the parser uses it to reuse constants in the code,
mapping constants to their indices in the constant table. A different
table for each task avoids false collisions.
|
| |
|
|
|
|
|
|
| |
Optimize this opcode for the common case. For long names or method
calls after too many constants, operation can be coded as a move
followed by 'gettable'.
|
|
|
|
| |
Identation + comments
|
| |
|
| |
|
|
|
|
|
|
|
| |
In function 'luaK_exp2val', used to generate code for indices: Macro
'hasjumps' does not consider the case when the whole expression is a
"jump" (a test). In all other of its uses, the surrounding code ensures
that the expression cannot be VJMP.
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
|
|
|
|
|
| |
The parameter 'nresults' in 'lua_call' and similar functions has a
limit of 250. It already had an undocumented (and unchecked) limit of
SHRT_MAX, but it is seldom larger than 2.
|
|
|
|
|
|
| |
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'
|
| |
|
| |
|
| |
|