aboutsummaryrefslogtreecommitdiff
path: root/ltm.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Stack indices changed to union'sRoberto Ierusalimschy2022-10-291-19/+19
| | | | | That will allow to change pointers to offsets while reallocating the stack.
* Broadening the use of branch hintsRoberto Ierusalimschy2021-02-241-2/+3
| | | | | | 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).
* Fixed bugs of stack reallocation x GCRoberto Ierusalimschy2020-07-071-2/+2
| | | | | | | | Macro 'checkstackGC' was doing a GC step after resizing the stack; the GC could shrink the stack and undo the resize. Moreover, macro 'checkstackp' also does a GC step, which could remove the preallocated CallInfo when calling a function. (Its name has been changed to 'checkstackGCp' to emphasize that it calls the GC.)
* Clearer distinction between types and tagsRoberto Ierusalimschy2020-01-311-1/+1
| | | | | LUA_T* represents only types; tags (types + Variants) are represented by LUA_V* constants.
* Comment about LUA_COMPAT_LT_LE moved to proper placeRoberto Ierusalimschy2019-12-101-0/+9
|
* Undo change in the handling of 'L->top' (commit b80077b8f3)Roberto Ierusalimschy2019-08-291-2/+0
| | | | | | With MMBIN instructions, there are fewer opcodes that need to update 'L->top', so that change does not seem to pay for the increased complexity.
* First version of OP_MMBIN opcodesRoberto Ierusalimschy2019-08-271-2/+2
| | | | | | | | | | | In arithmetic/bitwise operators, the call to metamethods is made in a separate opcode following the main one. (The main opcode skips this next one when the operation succeeds.) This change reduces slightly the size of the binary and the complexity of the arithmetic/bitwise opcodes. It also simplfies the treatment of errors and yeld/resume in these operations, as there are much fewer cases to consider. (Only OP_MMBIN/OP_MMBINI/OP_MMBINK, instead of all variants of all arithmetic/bitwise operators.)
* Change in the handling of 'L->top' when calling metamethodsRoberto Ierusalimschy2019-07-261-3/+9
| | | | | | | Instead of updating 'L->top' in every place that may call a metamethod, the metamethod functions themselves (luaT_trybinTM and luaT_callorderTM) correct the top. (When calling metamethods from the C API, however, the callers must preserve 'L->top'.)
* Details (typos in comments)Roberto Ierusalimschy2019-07-051-6/+6
|
* Keep correct type for immediate operands in comparisonsRoberto Ierusalimschy2019-03-221-2/+6
| | | | | | | | | | | | When calling metamethods for things like 'a < 3.0', which generates the opcode OP_LTI, the C register tells that the operand was converted to an integer, so that it can be corrected to float when calling a metamethod. This commit also includes some other stuff: - file 'onelua.c' added to the project - opcode OP_PREPVARARG renamed to OP_VARARGPREP - comparison opcodes rewritten through macros
* New macros for arithmetic/bitwise operations in 'luaV_execute'Roberto Ierusalimschy2018-11-051-1/+1
| | | | | | | The repetitive code of the arithmetic and bitwise operators in the main iterpreter loop was moved to appropriate macros. (As a detail, the function 'luaV_div' was renamed 'luaV_idiv', as it does an "integer division" (floor division).
* First "complete" implementation of to-be-closed variablesRoberto Ierusalimschy2018-10-171-1/+1
| | | | | | | Still missing: - handling of memory errors when creating upvalue (must run closing method all the same) - interaction with coroutines
* Deprecated the emulation of '__le' using '__lt'Roberto Ierusalimschy2018-08-241-0/+2
| | | | | | | | | | | As hinted in the manual for Lua 5.3, the emulation of the metamethod for '__le' using '__le' has been deprecated. It is slow, complicates the logic, and it is easy to avoid this emulation by defining a proper '__le' function. Moreover, often this emulation was used wrongly, with a programmer assuming that an order is total when it is not (e.g., NaN in floating-point numbers).
* 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-3/+2
| | | | addresses of static variables
* added 'const' to 'Proto*' when possibleRoberto Ierusalimschy2018-06-081-2/+2
|
* no more 'luaO_nilobject' to avoid comparison of global variable addressesRoberto Ierusalimschy2018-06-011-2/+3
| | | | (now uses static variables)
* no more nil-in-tableRoberto Ierusalimschy2018-04-041-29/+1
|
* metamethods for 'removekey'/'keyin'Roberto Ierusalimschy2018-02-271-1/+30
|
* better names for macros for tags and types.Roberto Ierusalimschy2018-02-261-4/+4
| | | | | rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag; tnov -> ttype
* first version of empty entries in tablesRoberto Ierusalimschy2018-02-231-4/+4
| | | | (so that, in the future, tables can contain regular nil entries)
* new opcodes OP_GTI/OP_GEIRoberto Ierusalimschy2018-02-211-3/+2
|
* correct way to check stack space for vararg functionsRoberto Ierusalimschy2018-02-171-3/+5
|
* some simplifications/optimizations in returns from Lua functionsRoberto Ierusalimschy2018-02-151-4/+6
|
* vararg back to '...' (but with another implementation)Roberto Ierusalimschy2018-02-091-32/+23
| | | | new implementation should have zero overhead for non-vararg functions
* new opcode 'PREPVARARG'Roberto Ierusalimschy2018-02-071-2/+3
| | | | (avoids test for vararg function in all function calls)
* bug in tailcall of vararg functionsRoberto Ierusalimschy2018-01-281-9/+8
| | | | (when adjusting missing parameters)
* calling a vararg function needs to check GCRoberto Ierusalimschy2018-01-281-1/+3
| | | | (because it creates a new table)
* keep control of stack top in Lua functions concentrated in 'luaV_execute'Roberto Ierusalimschy2017-12-281-17/+5
|
* when running Lua code, there is no need to keep 'L->top' "correct";Roberto Ierusalimschy2017-12-201-7/+19
| | | | set it only when needed.
* new macro 'isLuacode' (to distinguish regular Lua code fromRoberto Ierusalimschy2017-12-191-3/+3
| | | | hooks, where C code can run inside a Lua function).
* 'Proto->numparams' does not include vararg parameterRoberto Ierusalimschy2017-12-151-2/+2
| | | | (one less subtraction when calling functions...)
* new opcodes BANDK/BORK/BXORK. (They do not use immediate operandsRoberto Ierusalimschy2017-12-131-7/+12
| | | | | because, too often, masks in bitwise operations are integers larger than one byte.)
* warnings from Visual Studio /W3Roberto Ierusalimschy2017-11-301-2/+2
|
* new opcodes 'OP_LTI' and 'OP_LEI'Roberto Ierusalimschy2017-11-271-1/+15
|
* small simplifications around 'luaT_callorderTM'Roberto Ierusalimschy2017-11-231-4/+13
|
* new function 'luaV_flttointeger' to convert floats to integers (withoutRoberto Ierusalimschy2017-11-081-3/+2
| | | | | string coercions) + string operands to bitwise operations handled by string metamethods
* back to 'CallInfo' (no gains with its removal)Roberto Ierusalimschy2017-11-071-3/+3
|
* more fields moved out of 'CallInfo'Roberto Ierusalimschy2017-11-031-3/+3
|
* avoid warning about 'const'Roberto Ierusalimschy2017-10-041-2/+2
|
* new function 'luaT_trybiniTM'Roberto Ierusalimschy2017-09-271-1/+13
| | | | to handle tag methods for instructions with immediate integer arguments
* no more reference 'memerrmsg' + new reference to "n"Roberto Ierusalimschy2017-07-271-3/+3
| | | | | | (both can be retrieved by 'luaS_newliteral' without creating anything, because they are fixed, but "n" deserves fast access while 'memerrmsg' does not)
* new type 'StackValue' for stack elementsRoberto Ierusalimschy2017-06-291-17/+29
| | | | (we may want to put extra info there in the future)
* back to old-style vararg system (with vararg table collecting extraRoberto Ierusalimschy2017-05-131-1/+39
| | | | arguments)
* detail ('luaT_callbinTM' does not need to be extern)Roberto Ierusalimschy2017-05-081-5/+5
|
* Upvalues collected like everything else (with mark-sweep) insteadRoberto Ierusalimschy2017-04-111-2/+2
| | | | of reference count (simpler and better for generational mode)
* detail (removing spaces at end of lines)Roberto Ierusalimschy2016-12-221-2/+2
|
* When available, use metafield '__name' in error messagesRoberto Ierusalimschy2016-02-261-1/+17
|
* bug: despite its name, 'luaH_getstr' did not work for strings inRoberto Ierusalimschy2015-11-031-3/+3
| | | | general, but only for short strings
* in 'luaD_call', use two functions instead of one with fixed booleanRoberto Ierusalimschy2015-11-021-5/+10
| | | | argument