Roberto Ierusalimschy
934e77a286
Details
- Better comments about short strings in opcodes.
- luaH_newkey made static.
2 years ago
Roberto Ierusalimschy
1de2f31694
Corrected support for 16-bit systems
We still need access to a 16-bit system to correctly test
these changes.
2 years ago
Roberto Ierusalimschy
b85816b9a8
Removed test function 'luaH_isdummy'
It was not being used anywhere.
2 years ago
Roberto Ierusalimschy
14d2803e55
Details
Some cast operations rewritten to use respective macros.
2 years ago
Roberto Ierusalimschy
ad3942adba
Main 'mainposition' replaced by 'mainpositionTV'
Handle values in table keys as the special cases they are, and not
the other way around.
3 years ago
Roberto Ierusalimschy
0e5071b5fb
Avoid taking the address of a 'TValue' field
That structure can be packed in the future.
3 years ago
Roberto Ierusalimschy
7fbe215808
New hash function for integer keys
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.)
4 years ago
Roberto Ierusalimschy
014daf43cb
Details
Comments and order of hashing macros in 'ltable.c'.
4 years ago
Roberto Ierusalimschy
59c88f846d
Broadening the use of branch hints
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).
4 years ago
Roberto Ierusalimschy
553b37ce4f
Do not insert nil values into tables
4 years ago
Roberto Ierusalimschy
23051e830a
Changes in the API of 'luaH_set' and related functions
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.
4 years ago
Roberto Ierusalimschy
d742a193e5
Comments
4 years ago
Roberto Ierusalimschy
52c8679760
Fixed bug of keys removed from tables vs 'next'
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
.
4 years ago
Roberto Ierusalimschy
7c3cb71fa4
Free bit 7 of GC 'marked' field
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.
4 years ago
Roberto Ierusalimschy
46c3587a6f
Clearer distinction between types and tags
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
5 years ago
Roberto Ierusalimschy
5ff408d218
Changed internal representation of booleans
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.)
5 years ago
Roberto Ierusalimschy
d30569c064
Using an enumeration for float->integer coercion modes
5 years ago
Roberto Ierusalimschy
e592f94a64
Details (mostly comments)
5 years ago
Roberto Ierusalimschy
b2a580bdb1
Janitorial work
- 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'
5 years ago
Roberto Ierusalimschy
279c3a6961
A few changes in tests about number of bits in integers
- 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.
6 years ago
Roberto Ierusalimschy
d12262068d
Small optimizations in range checks
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.
6 years ago
Roberto Ierusalimschy
f99509581e
Removed extra information from RCS keyword strings
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
6 years ago
Roberto Ierusalimschy
2c107e13a8
warning (comparison between signed and unsigned integers)
6 years ago
Roberto Ierusalimschy
6e600695f8
field 'sizearray' in struct 'Table' changed to 'alimit', which can
be used as a hint for '#t'
6 years ago
Roberto Ierusalimschy
fb8fa66136
no more 'luaH_emptyobject' and comparisons of addresses of global variables
(instead, use a different kind of nil to signal the fake entry returned
when a key is not found in a table)
7 years ago
Roberto Ierusalimschy
34aa0c5bd7
new macros 'likely'/'unlikely' with hints for jump predictions
(used only in errors for now)
7 years ago
Roberto Ierusalimschy
950fbcb971
detail ('l_castU2S' should only be used over lua_Unsigned values)
7 years ago
Roberto Ierusalimschy
ef8263f81f
better names for macros for tags and types.
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag;
tnov -> ttype
7 years ago
Roberto Ierusalimschy
9243c414d9
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
7 years ago
Roberto Ierusalimschy
465b474899
small reorganization of 'luaV_flttointeger'/'luaV_tointeger'
7 years ago
Roberto Ierusalimschy
1afd5a152d
more generic way to handle 'gclist'
7 years ago
Roberto Ierusalimschy
e2b15aa21d
janitor work on casts
7 years ago
Roberto Ierusalimschy
68af7cc81a
another try with table resize.
(Old version was leaving some elements unanchored while allocating
new memory)
7 years ago
Roberto Ierusalimschy
e663a24ab0
more freedom in handling memory-allocation errors (not all allocations
automatically raise an error), which allows fixing a bug when resizing
a table.
7 years ago
Roberto Ierusalimschy
7622373033
using explicit tests for allocation overflow whenever possible
7 years ago
Roberto Ierusalimschy
599f1742c6
detail (typo in comments)
7 years ago
Roberto Ierusalimschy
26679ea35b
new function 'luaV_flttointeger' to convert floats to integers (without
string coercions) + string operands to bitwise operations handled
by string metamethods
7 years ago
Roberto Ierusalimschy
f96497397a
new type 'StackValue' for stack elements
(we may want to put extra info there in the future)
7 years ago
Roberto Ierusalimschy
73ec04fcf3
no more 'DEADKEY'. Table traversals do not need to consider dead keys;
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.
8 years ago
Roberto Ierusalimschy
b6f87491af
in hash nodes, keys are stored in separate pieces to avoid wasting
space with alignments
8 years ago
Roberto Ierusalimschy
e3d52da144
BUG: in 'computesizes', 'twotoi' overflows when a sequence has
more than 2^30 elements.
8 years ago
Roberto Ierusalimschy
84910e04e2
better implementation for 'hash_search', without using 'size_t'
(simpler to implement and to explain)
8 years ago
Roberto Ierusalimschy
3d879fbc5d
reimplementation of 'luaH_getn', trying to handle numeric limits
properly.
8 years ago
Roberto Ierusalimschy
b1b7790f7c
detail ('1' -> '1u' in unsigned operation)
8 years ago
Roberto Ierusalimschy
7b1fba69b7
using 'lastfree == NULL' to signal that table is using the dummy
node for its hash part + new macro 'allocsizenode'
8 years ago
Roberto Ierusalimschy
d103312661
details (typos in comments)
9 years ago
Roberto Ierusalimschy
5100bc8aa1
no need for a special case to get long strings (not that common)
9 years ago
Roberto Ierusalimschy
7485512384
added comment and assert about dead keys
9 years ago
Roberto Ierusalimschy
46de77b219
bug: despite its name, 'luaH_getstr' did not work for strings in
general, but only for short strings
9 years ago
Roberto Ierusalimschy
8950e0c049
avoid possibility of subtle arith. overflow
9 years ago