aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* DetailsRoberto Ierusalimschy2024-09-061-2/+2
| | | | Identation + comments
* New instruction format for SETLIST/NEWTABLERoberto Ierusalimschy2024-06-281-3/+9
| | | | | | New instruction format 'ivABC' (a variant of iABC where parameter vC has 10 bits) allows constructors of up to 1024 elements to be coded without EXTRAARG.
* 'isIT'/'isOT' turned from macros to functionsRoberto Ierusalimschy2024-06-271-0/+28
|
* Several details about 5.4.0 rc1Roberto Ierusalimschy2020-04-231-2/+0
| | | | | Corrected several small details: added 'const', adjusts in tabs x spaces, removed unused #includes and #defines, misspellings, etc.
* OP_LOADFALSE broken in two instructionsRoberto Ierusalimschy2020-02-111-0/+1
|
* Changed internal representation of booleansRoberto Ierusalimschy2020-01-061-1/+2
| | | | | | | 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.)
* Removed arithmetic opcodes with immediate operandRoberto Ierusalimschy2019-09-101-6/+0
| | | | | | | The difference in performance between immediate operands and K operands does not seem to justify all those extra opcodes. We only keep OP_ADDI, due to its ubiquity and because the difference is a little more relevant. (Later, OP_SUBI will be implemented by OP_ADDI, negating the constant.)
* Added macro 'testMMMode'Roberto Ierusalimschy2019-09-061-88/+88
| | | | Macro 'testMMMode' checks whether opcode is an MM opcode.
* First version of OP_MMBIN opcodesRoberto Ierusalimschy2019-08-271-0/+3
| | | | | | | | | | | 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-1/+1
| | | | | | | 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'.)
* Keep correct type for immediate operands in comparisonsRoberto Ierusalimschy2019-03-221-1/+1
| | | | | | | | | | | | 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 semantics for the integer 'for' loopRoberto Ierusalimschy2019-03-191-2/+0
| | | | | | | | | | | The numerical 'for' loop over integers now uses a precomputed counter to control its number of iteractions. This change eliminates several weird cases caused by overflows (wrap-around) in the control variable. (It also ensures that every integer loop halts.) Also, the special opcodes for the usual case of step==1 were removed. (The new code is already somewhat complex for the usual case, but efficient.)
* Added opcodes for arithmetic with K operandsRoberto Ierusalimschy2018-11-231-0/+7
| | | | | | | | Added opcodes for all seven arithmetic operators with K operands (that is, operands that are numbers in the array of constants of the function). They cover the cases of constant float operands (e.g., 'x + .0.0', 'x^0.5') and large integer operands (e.g., 'x % 10000').
* More uniformity in code generation for 'for' loopsRoberto Ierusalimschy2018-10-261-0/+1
| | | | | | | Added new instruction 'OP_TFORPREP' to prepare a generic for loop. Currently it is equivalent to a jump (but with a format 'iABx', similar to other for-loop preparing instructions), but soon it will be the place to create upvalues for closing loop states.
* Towards "to closed" local variablesRoberto Ierusalimschy2018-10-081-0/+1
| | | | | | | | | | | | 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.
* Opcode names moved to a new header fileRoberto Ierusalimschy2018-07-091-87/+1
| | | | | | | The array with the names of the opcodes was moved to a header file ('lopnames.h'), as it is not used by the Lua kernel. Files that need that array ('luac.c' and 'ltests.c') include the header file to get a private (static) copy.
* no need to define 'luaP_opnames' in regular buildsRoberto Ierusalimschy2018-04-191-1/+5
|
* no more nil-in-tableRoberto Ierusalimschy2018-04-041-5/+1
|
* new experimental syntax using reserved word 'undef'Roberto Ierusalimschy2018-03-071-1/+5
|
* new opcodes OP_GTI/OP_GEIRoberto Ierusalimschy2018-02-211-1/+5
|
* some simplifications/optimizations in returns from Lua functionsRoberto Ierusalimschy2018-02-151-3/+1
|
* vararg back to '...' (but with another implementation)Roberto Ierusalimschy2018-02-091-1/+3
| | | | new implementation should have zero overhead for non-vararg functions
* new opcode 'PREPVARARG'Roberto Ierusalimschy2018-02-071-1/+3
| | | | (avoids test for vararg function in all function calls)
* new macros 'isOT'/'isIT'Roberto Ierusalimschy2017-12-221-76/+76
| | | | | (plus exchanged parameters of OP_VARARG to make it similar to other 'isOT' instructions)
* new opcodes 'FORLOOP1'/'FORPREP1' for "basic for" (integer variableRoberto Ierusalimschy2017-12-181-1/+5
| | | | with increment of 1)
* new opcodes BANDK/BORK/BXORK. (They do not use immediate operandsRoberto Ierusalimschy2017-12-131-1/+7
| | | | | because, too often, masks in bitwise operations are integers larger than one byte.)
* new opcodes OP_SHLI/OP_SHRIRoberto Ierusalimschy2017-12-041-1/+5
|
* new opcodes OP_RETURN0/OP_RETURN1Roberto Ierusalimschy2017-11-291-1/+5
|
* new opcodes 'OP_LTI' and 'OP_LEI'Roberto Ierusalimschy2017-11-271-1/+5
|
* new opcode 'OP_EQI' for equality with immediate numbersRoberto Ierusalimschy2017-11-221-1/+3
|
* new instruction 'OP_EQK' (for equality with constants)Roberto Ierusalimschy2017-11-161-1/+3
|
* new format for JUMP instructions (to allow larger offsets)Roberto Ierusalimschy2017-11-071-2/+2
|
* new opcodes with immediate integer operand for all arithmetic operationsRoberto Ierusalimschy2017-10-041-1/+13
|
* no more 'getBMode'-'getCMode' (imprecise + we will need more spaceRoberto Ierusalimschy2017-09-281-59/+57
| | | | for op mode) + better control of op modes
* binary operators use R instead of RKRoberto Ierusalimschy2017-09-261-16/+16
| | | | | faster + nobody uses RK(B), so B can be smaller (freeing one bit for more opcodes, soon)
* new opcode OP_LOADF (load immediate float)Roberto Ierusalimschy2017-09-191-1/+3
|
* detail (keep OP_LOADK and OP_LOADKX together)Roberto Ierusalimschy2017-09-151-3/+3
|
* jumps do not close upvalues (to be faster and simpler);Roberto Ierusalimschy2017-09-131-2/+4
| | | | | | explicit instruction to close upvalues; command 'break' not handled like a 'goto' (to optimize removal of uneeded 'close' instructions)
* jumps in 'for' loops don't need to be signedRoberto Ierusalimschy2017-08-141-4/+4
|
* 'OP_VARARG' has the vararg parameter as an operandRoberto Ierusalimschy2017-06-291-2/+2
|
* new opcodes for table access with constant keys (strings and integers)Roberto Ierusalimschy2017-04-281-5/+13
|
* new opcode OP_ADDI (for immediate integer operand) (Experimental)Roberto Ierusalimschy2017-04-261-1/+3
|
* new opcode LOADI (for loading immediate integers)Roberto Ierusalimschy2017-04-201-1/+3
|
* includes 'stddef.h' (as it uses NULL)Roberto Ierusalimschy2015-01-051-1/+3
|
* added include for 'lprefix.h', for stuff that must be added beforeRoberto Ierusalimschy2014-11-021-2/+3
| | | | any other header file
* first implementation of '<<', '>>', and '~' (bitwise not)Roberto Ierusalimschy2013-12-301-1/+7
|
* first implementation of bitwise operators '&' (band), '|' (bor),Roberto Ierusalimschy2013-12-181-1/+7
| | | | and '~' (bxor)
* new order for binary operations (grouping them by type of result)Roberto Ierusalimschy2013-12-161-5/+5
|
* new operation '//' (integer division)Roberto Ierusalimschy2013-04-261-1/+3
|