| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Conceptually, all functions get their vararg arguments in a vararg
table. The storing of vararg arguments in the stack is always treated
as an optimization.
|
| |
|
|
| |
A '__mode' metafield and an "n" key both can be external strings.
|
| |
|
|
|
| |
Initialization "global a = 10" raises an error if global 'a' is already
defined, that is, it has a non-nil value.
|
| |
|
|
|
|
| |
- New macro l_strcoll to ease changing 'strcoll' to something else.
- MAXINDEXRK==1 in 'ltests.h' is enough to run test 'code.lua'.
- Removed unused '#include' in 'lutf8lib.c'.
|
| |
|
|
|
|
|
| |
A vararg table can be virtual. If the vararg table is used only as
a base in indexing expressions, the code does not need to create an
actual table for it. Instead, it compiles the indexing expressions
into direct accesses to the internal vararg data.
|
| |
|
|
| |
Not yet optimized nor documented.
|
| |
|
|
|
| |
The reasoning in commit 519c57d5 is wrong: A sequence of nils generates
several fields with just one OP_LOADNIL.
|
| | |
|
| |
|
|
|
| |
Opcodes OP_SHLI-OP_SHRI and the cases for opcodes OP_SHL-OP_SHR were
out of order.
|
| | |
|
| |
|
|
|
|
|
| |
A bad actor could fill only a few entries in a table (power of twos in
decreasing order, see tests) and produce a small table with a huge
length. If your program builds a table with external data and iterates
over its length, this behavior could be an issue.
|
| |
|
|
|
|
|
| |
That complicates a little object equality (and therefore table access
for long strings), but the old behavior was somewhat weird. (Short
strings, a concept otherwise absent from the manual, could not be
external.)
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
If a metatable is a weak table, its __newindex field could be collected
by an emergency collection while being used in 'luaV_finishset'. (This
bug has similarities with bug 5.3.2-1, fixed in commit a272fa66.)
|
| |
|
|
| |
New year (2024->2025), typos in comments
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The compilation of a goto or a label just create an entry and generate
boilerplate code for the gotos. As we don't know yet whether it needs a
CLOSE, we code a jump followed by a CLOSE, which is then dead code.
When a block ends (and then we know for sure whether there are variables
that need to be closed), we check the goto's against the labels of that
block. When closing a goto against a label, if it needs a CLOSE, the
compiler swaps the order of the jump and the CLOSE, making the CLOSE
active.
|
| |
|
|
| |
Small improvement in line-tracing for internal debugging.
|
| |
|
|
|
|
| |
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'.
|
| |
|
|
|
|
|
|
|
|
| |
Instead of using 'alimit' for keeping the size of the array and at
the same time being a hint for '#t', a table now keeps these two
values separate. The Table structure has a field 'asize' with the
size of the array, while the length hint is kept in the array itself.
That way, tables with no array part waste no space with that field.
Moreover, the space for the hint may have zero cost for small arrays,
if the array of tags plus the hint still fits in a single word.
|
| |
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
| |
|
|
| |
That gives us more free bits in 'callstatus', for future use.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
As the encoding of array indices is (~index), 0 is encoded as -1 and
INT_MAX is encoded as INT_MIN.
|
| |
|
|
|
| |
Corrections in comments and manual. Added note in the manual about
local variables in the REPL.
|
| |
|
|
| |
Bug introduced in 05932567.
|
| |
|
|
|
|
|
| |
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.)
|
| |\ |
|
| | |
| |
| |
| |
| | |
Even if the string fits in size_t, the whole size of the TString object
can overflow when we add the header.
|
| |\ \ |
|
| | |\| |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The array part of a table wastes too much space, due to padding.
To avoid that, we need to store values in the array as something
different from a TValue. Therefore, the API for table access
should not assume that any value in a table lives in a *TValue.
This commit is the first step to remove that assumption: functions
luaH_get*, instead of returning a *TValue where the value lives,
receive a *TValue where to put the value being accessed.
(We still have to change the luaH_set* functions.)
|
| | | |
| | |
| | |
| | | |
Accesses content and length of a 'TString'.
|
| |\ \ \
| | |/
| |/| |
|
| | | |
| | |
| | |
| | |
| | | |
We may want to add other string variants in the future; this change
documents better where the code may need to handle those variants.
|
| | | |
| | |
| | |
| | |
| | | |
Took the opportunity and moved the code that controls call hooks
in 'luaV_execute' into a function.
|
| |\| | |
|
| | | |
| | |
| | |
| | |
| | | |
Equality according to 'strcoll' does not imply that strings have
the same length.
|
| | |/
| |
| |
| |
| | |
- Better comments about short strings in opcodes.
- luaH_newkey made static.
|
| | |
| |
| |
| |
| | |
It also causes 'L->top' to be wrong when the error happens,
triggering an 'assert'.
|
| | |
| |
| |
| |
| | |
Again, as the control variable is read only, the code doesn't need
to keep an internal copy of it.
|
| |/
|
|
|
| |
As the control variable is read only, the code doesn't need to keep
an internal copy of it.
|
| |
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|