aboutsummaryrefslogtreecommitdiff
path: root/lobject.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Avoid taking the address of a 'TValue' fieldRoberto Ierusalimschy2021-10-111-1/+1
| | | | That structure can be packed in the future.
* DetailsRoberto Ierusalimschy2021-03-291-1/+1
| | | | Comments and small improvements in the manual.
* New implementation for 'tbclist'Roberto Ierusalimschy2021-03-101-2/+3
| | | | | | | | | | | | | | - 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.)
* New implementation for to-be-closed variablesRoberto Ierusalimschy2021-02-091-1/+9
| | | | | | | | 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.
* Cleaner definition for macro 'ttisclosure'Roberto Ierusalimschy2020-12-161-1/+2
|
* Fixed bug of keys removed from tables vs 'next'Roberto Ierusalimschy2020-10-141-8/+10
| | | | | | 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.
* Free bit 7 of GC 'marked' fieldRoberto Ierusalimschy2020-08-071-3/+3
| | | | | | | | 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.
* Detail (in asserts)Roberto Ierusalimschy2020-08-031-1/+2
| | | | Macro 'checkconsistency' replaced by the similar 'checkliveness".
* Cleaner definition for 'TString'Roberto Ierusalimschy2020-05-191-4/+3
| | | | | Use a variable-sized array to store string contents at the end of a structure 'TString', instead of raw memory.
* Several details about 5.4.0 rc1Roberto Ierusalimschy2020-04-231-2/+1
| | | | | Corrected several small details: added 'const', adjusts in tabs x spaces, removed unused #includes and #defines, misspellings, etc.
* Tag values don't need to be different from type valuesRoberto Ierusalimschy2020-01-311-18/+19
| | | | Variants can use zero for first variant.
* Clearer distinction between types and tagsRoberto Ierusalimschy2020-01-311-60/+76
| | | | | LUA_T* represents only types; tags (types + Variants) are represented by LUA_V* constants.
* New macro 'makevariant' to codify variant tagsRoberto Ierusalimschy2020-01-061-11/+14
|
* Changed internal representation of booleansRoberto Ierusalimschy2020-01-061-7/+10
| | | | | | | 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.)
* Changed definition of macro 'l_isfalse'Roberto Ierusalimschy2019-10-221-1/+1
| | | | | | 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.
* Details (mostly comments)Roberto Ierusalimschy2019-10-221-8/+23
|
* Tag LUA_TUPVALTBC replaced by a flagRoberto Ierusalimschy2019-07-191-3/+1
| | | | | It is simpler to signal a to-be-closed upvalue with a boolean flag, instead of using a different tag.
* DetailsRoberto Ierusalimschy2019-07-181-5/+5
| | | | | | | - 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 keeps exact size of arraysRoberto Ierusalimschy2019-07-121-2/+0
| | | | | | 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.)
* First implementation of constant propagationRoberto Ierusalimschy2019-07-121-1/+1
| | | | | Local constant variables initialized with compile-time constants are optimized away from the code.
* New implementation for constantsRoberto Ierusalimschy2019-07-091-0/+1
| | | | | | | | | 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.
* Added field 'srclen' to structure 'lua_Debug'Roberto Ierusalimschy2019-04-041-1/+1
| | | | | | 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.
* Strings inside Lua are not fully alignedRoberto Ierusalimschy2019-03-131-9/+1
| | | | | | 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.
* Removed internal cache for closuresRoberto Ierusalimschy2018-11-011-2/+0
| | | | | | | | | | | | | | | | | | | 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.)
* Towards "to closed" local variablesRoberto Ierusalimschy2018-10-081-0/+4
| | | | | | | | | | | | 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.
* Removed extra information from RCS keyword stringsRoberto Ierusalimschy2018-08-231-1/+1
| | | | | Version numbers and dates (mostly wrong) from RCS keyword strings removed from all source files; only the file name are kept.
* new field 'nilvalue' in struct 'global_State' to avoid the use ofRoberto Ierusalimschy2018-06-151-4/+1
| | | | addresses of static variables
* field 'sizearray' in struct 'Table' changed to 'alimit', which canRoberto Ierusalimschy2018-06-151-2/+15
| | | | be used as a hint for '#t'
* no more 'luaO_nilobject' to avoid comparison of global variable addressesRoberto Ierusalimschy2018-06-011-7/+1
| | | | (now uses static variables)
* no more 'luaH_emptyobject' and comparisons of addresses of global variablesRoberto Ierusalimschy2018-06-011-8/+28
| | | | | (instead, use a different kind of nil to signal the fake entry returned when a key is not found in a table)
* no more nil-in-tableRoberto Ierusalimschy2018-04-041-8/+2
|
* better names for macros for tags and types.Roberto Ierusalimschy2018-02-261-11/+11
| | | | | rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag; tnov -> ttype
* special compact representation for userdata with no user valuesRoberto Ierusalimschy2018-02-261-9/+28
| | | | (a common case)
* avoid variant tags with the same value of the original typeRoberto Ierusalimschy2018-02-251-9/+9
| | | | (to expose bugs more easily)
* first (parcial) implementation of 'keyin'/'removekey'Roberto Ierusalimschy2018-02-251-5/+12
| | | | (still no metamethods, no raw verssions)
* first version of empty entries in tablesRoberto Ierusalimschy2018-02-231-3/+27
| | | | (so that, in the future, tables can contain regular nil entries)
* some reorganization in 'lobject.h'Roberto Ierusalimschy2018-02-221-187/+218
| | | | (just moving stuff around)
* details (comments)Roberto Ierusalimschy2018-02-211-19/+26
|
* userdata can have multiple user valuesRoberto Ierusalimschy2018-02-201-26/+34
|
* janitor work on castsRoberto Ierusalimschy2018-01-281-4/+4
|
* detail (comment)Roberto Ierusalimschy2018-01-281-2/+2
|
* detail (typo in comments)Roberto Ierusalimschy2017-11-231-2/+2
|
* back to 'CallInfo' (no gains with its removal)Roberto Ierusalimschy2017-11-071-31/+1
|
* fitting a StackValue structure into 32 bytes (for 64-bit machines)Roberto Ierusalimschy2017-11-061-8/+9
|
* no more useful fields in CallInfoRoberto Ierusalimschy2017-11-031-2/+16
|
* more fields moved out of 'CallInfo'Roberto Ierusalimschy2017-11-031-1/+12
|
* baby steps to remove 'CallInfo': keeping 'L->func' correctRoberto Ierusalimschy2017-10-311-1/+5
|
* new type 'StackValue' for stack elementsRoberto Ierusalimschy2017-06-291-11/+22
| | | | (we may want to put extra info there in the future)
* 'lineinfo' in prototypes saved as differences instead of absoluteRoberto Ierusalimschy2017-06-271-4/+21
| | | | | | values, so that the array can use bytes instead of ints, reducing its size. (A new array 'abslineinfo' is used when line differences do not fit in a byte.)
* no more 'DEADKEY'. Table traversals do not need to consider dead keys;Roberto Ierusalimschy2017-06-121-10/+12
| | | | | | 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.