| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| | |
The test whether key is inside the array part of a table uses a bit
trick to avoid computing the real size of the array part.
|
| |
| |
| |
| |
| | |
- Better comments about short strings in opcodes.
- luaH_newkey made static.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
| |
We still need access to a 16-bit system to correctly test
these changes.
|
|
|
|
| |
It was not being used anywhere.
|
|
|
|
| |
Some cast operations rewritten to use respective macros.
|
|
|
|
|
| |
Handle values in table keys as the special cases they are, and not
the other way around.
|
|
|
|
| |
That structure can be packed in the future.
|
|
|
|
|
|
|
| |
When integer keys do not form a sequence, it is better to use all their
bits to compute their hashes. (The previous implementation was quite bad
for integer keys with common lower bits, and disastrous for integer keys
changing only in their upper 32 bits.)
|
|
|
|
| |
Comments and order of hashing macros in 'ltable.c'.
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.)
|
| |
|
| |
|
|
|
|
|
|
|
| |
- 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'
|
|
|
|
|
|
| |
- The preprocessor must work with at least 'long', and therefore must
do shifts of up to 31 bits correctly.
- Whenever possible, use unsigned types in shifts.
|
|
|
|
|
|
|
|
| |
Checks of the form '1 <= x && x <= M' were rewritten in the form
'(unsigned)x - 1 < (unsigned)M', which is usually more efficient.
(Other similar checks have similar translations.) Although
some compilers do these optimizations, that does not happen
for all compilers or all cases.
|
|
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
|
| |
|
|
|
|
| |
be used as a hint for '#t'
|
|
|
|
|
| |
(instead, use a different kind of nil to signal the fake entry returned
when a key is not found in a table)
|
|
|
|
| |
(used only in errors for now)
|
| |
|
|
|
|
|
| |
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag;
tnov -> ttype
|
|
|
|
| |
(so that, in the future, tables can contain regular nil entries)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
(Old version was leaving some elements unanchored while allocating
new memory)
|
|
|
|
|
| |
automatically raise an error), which allows fixing a bug when resizing
a table.
|
| |
|
| |
|
|
|
|
|
| |
string coercions) + string operands to bitwise operations handled
by string metamethods
|
|
|
|
| |
(we may want to put extra info there in the future)
|
|
|
|
|
|
| |
if the key is dead, it cannot be given to 'next'. Instead, we now
use a 'table' tag without the collectable bit, which makes it
a unique tag good enough to reserve space.
|
|
|
|
| |
space with alignments
|
|
|
|
| |
more than 2^30 elements.
|
|
|
|
| |
(simpler to implement and to explain)
|