| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Moreover, each function being parsed has its own table.
The code is cleaner when each table is used for one specific purpose:
The scanner uses its table to anchor and unify strings, mapping strings
to themselves; the parser uses it to reuse constants in the code,
mapping constants to their indices in the constant table. A different
table for each task avoids false collisions.
|
|
|
|
|
|
| |
The extra check in checknoTM (versus only checking whether there is a
metatable) is cheap, and it is not that uncommon for a table to have a
metatable without a __newindex metafield.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Sums of size_t may not fit in a size_t.
|
| |
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
|
|
|
|
| |
As the encoding of array indices is (~index), 0 is encoded as -1 and
INT_MAX is encoded as INT_MIN.
|
|
|
|
|
|
| |
This "linear" representation (see ltable.h for details) has worse
locality than cells, but the simpler access code seems to compensate
that.
|
|
|
|
|
| |
'unsigned int' is too long sometimes. (We already write 'long' instead
of 'long int'...)
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
| |
Negligible performance gains don't justify extra complexity.
|
|
|
|
|
| |
A few operations on arrays can be performed "in bulk", treating all
tags of a cell as a simple (or a few) word(s).
|
|
|
|
|
|
| |
'lua_rawgeti' now uses "fast track"; 'lua_rawseti' still calls
'luaH_setint', but the latter was recoded to avoid extra overhead
when writing to the array part after 'alimit'.
|
|
|
|
|
| |
With the tags comming first in a cell, we can define the whole cell
as a C type and let C do part of the address computations.
|
|
|
|
| |
Comments and parameter name in header file.
|
|\ |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.)
|
|\ \ \
| | |/
| |/| |
|
| |/
| |
| |
| |
| | |
- Better comments about short strings in opcodes.
- luaH_newkey made static.
|
|/
|
|
|
| |
Only tables with some minimum number of entries in their hash part
have a 'lastfree' field, kept in a header before the node vector.
|
|
|
|
| |
It was not being used anywhere.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Corrected several small details: added 'const', adjusts in tabs x
spaces, removed unused #includes and #defines, misspellings, etc.
|
|
|
|
|
| |
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)
|
|
|
|
| |
(so that, in the future, tables can contain regular nil entries)
|
|
|
|
| |
space with alignments
|
|
|
|
|
| |
allow the boundary-search algorithm to use 'maxinteger' when
it cannot find a good upper bound.
|
| |
|
|
|
|
| |
node for its hash part + new macro 'allocsizenode'
|
|
|
|
| |
general, but only for short strings
|
|
|
|
| |
'unsigned int', which allows twice as many elements in the array part
|
| |
|
|
|
|
| |
a single constant table for all functions in a chunk)
|
| |
|
|
|
|
|
| |
metatable + luaV_settable does not create entry when there is a
metamethod (and therefore entry is useless)
|
|
|
|
| |
to be set.
|
| |
|
| |
|
|
|
|
| |
not generic numbers)
|
| |
|
| |
|