Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Keep correct type for immediate operands in comparisons | Roberto Ierusalimschy | 2019-03-22 | 1 | -1/+4 |
| | | | | | | | | | | | | 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' loop | Roberto Ierusalimschy | 2019-03-19 | 1 | -4/+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.) | ||||
* | Details | Roberto Ierusalimschy | 2019-03-13 | 1 | -8/+7 |
| | | | | | | | | | | Several small improvements (code style, warnings, comments, more tests), in particular: - 'lua_topointer' extended to handle strings - raises an error in 'string.format("%10q")' ('%q' with modifiers) - in the manual for 'string.format', the term "option" replaced by "conversion specifier" (the term used by the C standard) | ||||
* | Added opcodes for arithmetic with K operands | Roberto Ierusalimschy | 2018-11-23 | 1 | -0/+10 |
| | | | | | | | | 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'). | ||||
* | To-be-closed variable in 'for' loop separated from the state | Roberto Ierusalimschy | 2018-11-07 | 1 | -3/+3 |
| | | | | | | | | | The variable to be closed in a generic 'for' loop now is the 4th value produced in the loop initialization, instead of being the loop state (the 2nd value produced). That allows a loop to use a state with a '__toclose' metamethod but do not close it. (As an example, 'f:lines()' might use the file 'f' as a state for the loop, but it should not close the file when the loop ends.) | ||||
* | Big revamp in the implmentation of labels/gotos | Roberto Ierusalimschy | 2018-10-29 | 1 | -6/+3 |
| | | | | | | | | Added restriction that, when a label is created, there cannot be another label with the same name visible. That allows backward goto's to be resolved when they are read. Backward goto's get a close if they jump out of the scope of some variable; labels get a close only if previous goto to it jumps out of the scope of some upvalue. | ||||
* | More uniformity in code generation for 'for' loops | Roberto Ierusalimschy | 2018-10-26 | 1 | -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 variables | Roberto Ierusalimschy | 2018-10-08 | 1 | -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 strings | Roberto Ierusalimschy | 2018-08-23 | 1 | -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 file | Roberto Ierusalimschy | 2018-07-09 | 1 | -4/+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. | ||||
* | change in 'LUAI_DDEC' to allow variables to be static in 'onelua' | Roberto Ierusalimschy | 2018-06-18 | 1 | -3/+3 |
| | | | | + change in 'LUAMOD_API' as opening functions do not need to be global | ||||
* | detail in comment | Roberto Ierusalimschy | 2018-06-08 | 1 | -2/+2 |
| | |||||
* | no more nil-in-table | Roberto Ierusalimschy | 2018-04-04 | 1 | -4/+1 |
| | |||||
* | new experimental syntax using reserved word 'undef' | Roberto Ierusalimschy | 2018-03-07 | 1 | -1/+4 |
| | |||||
* | new opcodes OP_GTI/OP_GEI | Roberto Ierusalimschy | 2018-02-21 | 1 | -6/+3 |
| | |||||
* | some simplifications/optimizations in returns from Lua functions | Roberto Ierusalimschy | 2018-02-15 | 1 | -10/+12 |
| | |||||
* | vararg back to '...' (but with another implementation) | Roberto Ierusalimschy | 2018-02-09 | 1 | -4/+6 |
| | | | | new implementation should have zero overhead for non-vararg functions | ||||
* | new opcode 'PREPVARARG' | Roberto Ierusalimschy | 2018-02-07 | 1 | -0/+2 |
| | | | | (avoids test for vararg function in all function calls) | ||||
* | detail | Roberto Ierusalimschy | 2018-02-07 | 1 | -6/+6 |
| | | | | (order of 'OT' and 'IT' bits corresponds with macro 'opmode') | ||||
* | janitor work on casts | Roberto Ierusalimschy | 2018-01-28 | 1 | -6/+6 |
| | |||||
* | OP_CONCAT does not move its result (to simplify its execution) | Roberto Ierusalimschy | 2018-01-27 | 1 | -2/+2 |
| | |||||
* | keep more opcode arguments byte-aligned | Roberto Ierusalimschy | 2018-01-09 | 1 | -16/+20 |
| | |||||
* | new macros 'isOT'/'isIT' | Roberto Ierusalimschy | 2017-12-22 | 1 | -5/+15 |
| | | | | | (plus exchanged parameters of OP_VARARG to make it similar to other 'isOT' instructions) | ||||
* | new opcodes 'FORLOOP1'/'FORPREP1' for "basic for" (integer variable | Roberto Ierusalimschy | 2017-12-18 | 1 | -1/+5 |
| | | | | with increment of 1) | ||||
* | some cleaning on signed opcode parameters | Roberto Ierusalimschy | 2017-12-15 | 1 | -13/+16 |
| | |||||
* | (1 << 31) with signed integer has undefined behavior in C | Roberto Ierusalimschy | 2017-12-15 | 1 | -2/+2 |
| | |||||
* | new opcodes BANDK/BORK/BXORK. (They do not use immediate operands | Roberto Ierusalimschy | 2017-12-13 | 1 | -1/+5 |
| | | | | | because, too often, masks in bitwise operations are integers larger than one byte.) | ||||
* | new opcodes OP_SHLI/OP_SHRI | Roberto Ierusalimschy | 2017-12-04 | 1 | -1/+4 |
| | |||||
* | details (comments) | Roberto Ierusalimschy | 2017-11-30 | 1 | -5/+10 |
| | |||||
* | detail (spacing) | Roberto Ierusalimschy | 2017-11-30 | 1 | -3/+3 |
| | |||||
* | new opcodes OP_RETURN0/OP_RETURN1 | Roberto Ierusalimschy | 2017-11-29 | 1 | -1/+4 |
| | |||||
* | using register 'k' for conditions in tests (we only need one bit there) | Roberto Ierusalimschy | 2017-11-28 | 1 | -12/+18 |
| | |||||
* | new opcodes 'OP_LTI' and 'OP_LEI' | Roberto Ierusalimschy | 2017-11-27 | 1 | -1/+3 |
| | |||||
* | using 'A' for register instead of 'B' in relational opcodes | Roberto Ierusalimschy | 2017-11-22 | 1 | -6/+6 |
| | | | | ('R(A)' is already created by default for all instructions.) | ||||
* | new opcode 'OP_EQI' for equality with immediate numbers | Roberto Ierusalimschy | 2017-11-22 | 1 | -1/+2 |
| | |||||
* | new instruction 'OP_EQK' (for equality with constants) | Roberto Ierusalimschy | 2017-11-16 | 1 | -1/+3 |
| | |||||
* | new format for JUMP instructions (to allow larger offsets) | Roberto Ierusalimschy | 2017-11-07 | 1 | -5/+25 |
| | |||||
* | eplicit 1-bit opcode operand 'k' | Roberto Ierusalimschy | 2017-10-04 | 1 | -42/+29 |
| | |||||
* | new opcodes with immediate integer operand for all arithmetic operations | Roberto Ierusalimschy | 2017-10-04 | 1 | -1/+8 |
| | |||||
* | opcode size increased to 7 bits | Roberto Ierusalimschy | 2017-10-02 | 1 | -8/+8 |
| | |||||
* | avoid the use of bit 'Bk' ('B' will lose this bit soon) | Roberto Ierusalimschy | 2017-10-01 | 1 | -6/+3 |
| | |||||
* | no more 'getBMode'-'getCMode' (imprecise + we will need more space | Roberto Ierusalimschy | 2017-09-28 | 1 | -30/+27 |
| | | | | for op mode) + better control of op modes | ||||
* | binary operators use R instead of RK | Roberto Ierusalimschy | 2017-09-26 | 1 | -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 Ierusalimschy | 2017-09-19 | 1 | -1/+2 |
| | |||||
* | comments (documentation about instruction formats) | Roberto Ierusalimschy | 2017-09-18 | 1 | -15/+14 |
| | |||||
* | detail (keep OP_LOADK and OP_LOADKX together) | Roberto Ierusalimschy | 2017-09-15 | 1 | -2/+2 |
| | |||||
* | jumps do not close upvalues (to be faster and simpler); | Roberto Ierusalimschy | 2017-09-13 | 1 | -2/+3 |
| | | | | | | 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 signed | Roberto Ierusalimschy | 2017-08-14 | 1 | -5/+5 |
| | |||||
* | 'OP_VARARG' has the vararg parameter as an operand | Roberto Ierusalimschy | 2017-06-29 | 1 | -3/+3 |
| | |||||
* | details (direct access to 'Ck' bit in instructions) | Roberto Ierusalimschy | 2017-05-08 | 1 | -1/+4 |
| |