| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
To avoid the need of both the old and the new stack addresses valid
at the same time, to correct the pointers to the stack, these pointers
are changed to offsets before the reallocation and then changed back
to pointers after the reallocation.
|
|
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
| |
|
|
|
|
| |
That structure can be packed in the future.
|
|
|
|
| |
Comments and small improvements in the manual.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fixes a bug, by removing dummy nodes together with the node
itself. (The previous implementation could leave dummy nodes in frames
which otherwise had no tbc variables, and therefore would not close
variables; that could leave 'tbclist' pointing higher than 'top', which
could dangle if the stack shrank.)
- Computes MAXDELTA based on the type of delta, to ease changing its
type if needed.
- Instead of 'isdummy', uses 'delta==0' to signal dummy nodes. (Dummy
nodes always have MAXDELTA for their real delta.)
|
|
|
|
|
|
|
|
| |
To-be-closed variables are linked in their own list, embedded into the
stack elements. (Due to alignment, this information does not change
the size of the stack elements in most architectures.) This new list
does not produce garbage and avoids memory errors when creating tbc
variables.
|
| |
|
|
|
|
|
|
| |
Fixed the bug that a key removed from a table might not be found
again by 'next'. (This is needed to allow keys to be removed during a
traversal.) This bug was introduced in commit 73ec04fc.
|
|
|
|
|
|
|
|
| |
Tables were using this bit to indicate their array sizes were real
('isrealasize'), but this bit can be useful for tests. Instead, they
can use bit 7 of their 'flag' field for that purpose. (There are only
six fast-access metamethods.) This 'flag' field only exists in tables,
so this use does not affect other types.
|
|
|
|
| |
Macro 'checkconsistency' replaced by the similar 'checkliveness".
|
|
|
|
|
| |
Use a variable-sized array to store string contents at the end of a
structure 'TString', instead of raw memory.
|
|
|
|
|
| |
Corrected several small details: added 'const', adjusts in tabs x
spaces, removed unused #includes and #defines, misspellings, etc.
|
|
|
|
| |
Variants can use zero for first variant.
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
The old definition did one test for nil, but three tests for the all
too common booleans (and two tests for other values); this definition
does two tests for all values.
|
| |
|
|
|
|
|
| |
It is simpler to signal a to-be-closed upvalue with a boolean flag,
instead of using a different tag.
|
|
|
|
|
|
|
| |
- Macro 'checkliveness' (for debug) always uses 'L', to avoid warnings.
- Some old 'while' changed to 'for' in 'testes/gc.lua'.
- In 'testes/libs/makefile', do not make files depend on 'ltests.h',
which may not even exist.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This new field gets the length of 'source' in the same structure.
Unlike the other strings in that structure, 'source' can be
relatively large, and Lua already has its length readily available.
|
|
|
|
|
|
| |
Removed code to ensure that strings inside Lua (as returned by
'lua_tolstring') always start in fully aligned addresses.
Since version 5.3 the documentation does not ensure that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mechanism of "caching the last closure created for a prototype to
try to reuse it the next time a closure for that prototype is created"
was removed. There are several reasons:
- It is hard to find a natural example where this cache has a measurable
impact on performance.
- Programmers already perceive closure creation as something slow,
so they tend to avoid it inside hot paths. (Any case where the cache
could reuse a closure can be rewritten predefining the closure in some
variable and using that variable.)
- The implementation was somewhat complex, due to a bad interaction
with the generational collector. (Typically, new closures are new,
while prototypes are old. So, the cache breaks the invariant that
old objects should not point to new ones.)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start of the implementation of "scoped variables" or "to be closed"
variables, local variables whose '__close' (or themselves) are called
when they go out of scope. This commit implements the syntax, the
opcode, and the creation of the corresponding upvalue, but it still
does not call the finalizations when the variable goes out of scope
(the most important part).
Currently, the syntax is 'local scoped name = exp', but that will
probably change.
|
|
|
|
|
| |
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
|
|
|
|
| |
be used as a hint for '#t'
|
|
|
|
| |
(now uses static variables)
|
|
|
|
|
| |
(instead, use a different kind of nil to signal the fake entry returned
when a key is not found in a table)
|
| |
|
|
|
|
|
| |
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag;
tnov -> ttype
|
|
|
|
| |
(a common case)
|
|
|
|
| |
(to expose bugs more easily)
|
|
|
|
| |
(still no metamethods, no raw verssions)
|
|
|
|
| |
(so that, in the future, tables can contain regular nil entries)
|
|
|
|
| |
(just moving stuff around)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|