| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Bug introduced in commit 42d40581.
|
|
|
|
|
|
|
|
|
|
| |
Because error handling (luaG_errormsg) uses slots from EXTRA_STACK,
and some errors can recur (e.g., string overflow while creating an
error message in 'luaG_runerror', or a C-stack overflow before calling
the message handler), the code should use stack slots with parsimony.
This commit fixes the bug "Lua-stack overflow when C stack overflows
while handling an error".
|
|
|
|
|
| |
Comments + manual + identation + asserts about stack limits that were
not allowing the use of the full stack
|
|
|
|
|
|
| |
luaV_execute should compute 'ra' only when the instruction uses it.
Computing an illegal address is undefined behavior even if the address
is never dereferenced.
|
|
|
|
|
|
|
|
|
|
|
| |
'luaD_pretailcall' mimics 'luaD_precall', handling call metamethods
and calling C functions directly. That makes the code in the
interpreter loop simpler.
This commit also goes back to emulating the tail call in 'luaD_precall'
with a goto, as C compilers may not do proper tail calls and the C
stack can overflow much sooner than the Lua stack (which grows as the
metamethod is added to it).
|
|
|
|
|
| |
Better explanation about the guaranties of multiple assignment in
the manual.
|
|
|
|
|
| |
According to ISO C, "making a function an inline function suggests that
calls to the function be as fast as possible." (Not available in C89.)
|
| |
|
|
|
|
| |
Not that simpler and slower.
|
|
|
|
| |
Negation of an unchecked lua_Integer overflows with mininteger.
|
|
|
|
|
|
| |
The parameters 'nresults' and 'delta1', in 'luaD_precall', were never
meaningful simultaneously. So, they were combined in a single parameter
'retdel'.
|
|
|
|
|
| |
A tail call to a C function can have the behavior of a "real" tail
call, reusing the stack frame of the caller.
|
|
|
|
|
| |
Tail calls handled by 'luaD_precall', like regular calls, to avoid
code duplication.
|
|
|
|
|
| |
Yielding in a __close metamethod called when returning vararg results
changes the top and so messes up the number of returned values.
|
| |
|
|
|
|
|
|
|
|
| |
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".
|