| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Vararg functions with vararg tables don't use the arguments hidden in
the stack; therfore, it doesn't need to build/keep them.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
To allow some optimizations on its use.
|
| |
|
|
| |
Not yet optimized nor documented.
|
| | |
|
| |
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
| |
|
|
| |
Bug introduced in 05932567.
|
| | |
|
| |\ |
|
| | | |
|
| |/
|
|
|
| |
Function calls do not create new objects. (It may use memory with
stack reallocation, but now that is irrelevant to the GC.)
|
| |
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
| |
|
|
|
|
| |
More uses of macros 'likely'/'unlikely' (renamed to
'l_likely'/'l_unlikely'), both in range (extended to the
libraries) and in scope (extended to hooks, stack growth).
|
| |
|
|
|
|
|
|
| |
Macro 'checkstackGC' was doing a GC step after resizing the stack;
the GC could shrink the stack and undo the resize. Moreover, macro
'checkstackp' also does a GC step, which could remove the preallocated
CallInfo when calling a function. (Its name has been changed to
'checkstackGCp' to emphasize that it calls the GC.)
|
| |
|
|
|
| |
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
|
| | |
|
| |
|
|
|
|
| |
With MMBIN instructions, there are fewer opcodes that need to update
'L->top', so that change does not seem to pay for the increased
complexity.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
| |
Instead of updating 'L->top' in every place that may call a
metamethod, the metamethod functions themselves (luaT_trybinTM and
luaT_callorderTM) correct the top. (When calling metamethods from
the C API, however, the callers must preserve 'L->top'.)
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When calling metamethods for things like 'a < 3.0', which generates
the opcode OP_LTI, the C register tells that the operand was
converted to an integer, so that it can be corrected to float when
calling a metamethod.
This commit also includes some other stuff:
- file 'onelua.c' added to the project
- opcode OP_PREPVARARG renamed to OP_VARARGPREP
- comparison opcodes rewritten through macros
|
| |
|
|
|
|
|
| |
The repetitive code of the arithmetic and bitwise operators in
the main iterpreter loop was moved to appropriate macros.
(As a detail, the function 'luaV_div' was renamed 'luaV_idiv',
as it does an "integer division" (floor division).
|
| |
|
|
|
|
|
| |
Still missing:
- handling of memory errors when creating upvalue (must run closing
method all the same)
- interaction with coroutines
|
| |
|
|
|
|
|
|
|
|
|
| |
As hinted in the manual for Lua 5.3, the emulation of the metamethod
for '__le' using '__le' has been deprecated. It is slow, complicates
the logic, and it is easy to avoid this emulation by defining a proper
'__le' function.
Moreover, often this emulation was used wrongly, with a programmer
assuming that an order is total when it is not (e.g., NaN in
floating-point numbers).
|
| |
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
|
| |
|
|
| |
addresses of static variables
|
| | |
|
| |
|
|
| |
(now uses static variables)
|
| | |
|
| | |
|
| |
|
|
|
| |
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag;
tnov -> ttype
|
| |
|
|
| |
(so that, in the future, tables can contain regular nil entries)
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
new implementation should have zero overhead for non-vararg functions
|
| |
|
|
| |
(avoids test for vararg function in all function calls)
|
| |
|
|
| |
(when adjusting missing parameters)
|
| |
|
|
| |
(because it creates a new table)
|
| | |
|
| |
|
|
| |
set it only when needed.
|
| |
|
|
| |
hooks, where C code can run inside a Lua function).
|
| |
|
|
| |
(one less subtraction when calling functions...)
|
| |
|
|
|
| |
because, too often, masks in bitwise operations are integers larger
than one byte.)
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
string coercions) + string operands to bitwise operations handled
by string metamethods
|