aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Wrong assertion in 'getbaseline'Roberto Ierusalimschy2021-03-051-1/+4
| | | | | The assertion cannot compute 'f->abslineinfo[i]' when the initial estimate 'i' is -1.
* Bug (kind of) in 'isinstack'Roberto Ierusalimschy2021-02-251-6/+10
| | | | | | | The function 'isinstack' tried to work around the undefined behavior of subtracting two pointers that do not point to the same object, but the compiler killed to trick. (It optimizes out the safety check, because in a correct execution it will be always true.)
* Don't use tointegerns when luaV_tointegerns will doRoberto Ierusalimschy2021-02-241-1/+1
| | | | | | | | Some places don't need the "fast path" macro tointegerns, either because speed is not essential (lcode.c) or because the value is not supposed to be an integer already (luaV_equalobj and luaG_tointerror). Moreover, luaV_equalobj should always use F2Ieq, even if Lua is compiled to "round to floor".
* Optimization/simplification of 'getbaseline'Roberto Ierusalimschy2021-02-021-20/+15
| | | | | By producing absolute line information at regular intervals, a simple division can compute the correct entry for a given instruction.
* Optimizations for line hookRoberto Ierusalimschy2021-01-281-20/+32
| | | | | The function 'changedline' tries harder to avoid calling 'luaG_getfuncline' plus small changes in the use of 'L->oldpc'.
* Better error messages for calling non-callable objectsRoberto Ierusalimschy2020-12-291-6/+17
| | | | | | | When available, use the calling code to find a suitable name for what was being called; this is particularly useful for errors of non-callable metamethods. This commit also improved the debug information for order metamethods.
* Fixed bug: line hooks in stripped functionsRoberto Ierusalimschy2020-07-271-1/+3
| | | | | Line-hook handling was accessing debug info. without checking whether it was present.
* Fixed bug: Negation overflow in getlocal/setlocalRoberto Ierusalimschy2020-07-271-3/+3
|
* Fixed bug: invalid 'oldpc' when returning to a functionRoberto Ierusalimschy2020-07-171-16/+25
| | | | | | | | | | The field 'L->oldpc' is not always updated when control returns to a function; an invalid value can seg. fault when computing 'changedline'. (One example is an error in a finalizer; control can return to 'luaV_execute' without executing 'luaD_poscall'.) Instead of trying to fix all possible corner cases, it seems safer to be resilient to invalid values for 'oldpc'. Valid but wrong values at most cause an extra call to a line hook.
* Improvements in the handling of signalsRoberto Ierusalimschy2020-05-221-9/+11
| | | | Added 'volatile' to 'l_signalT' variables plus some minor changes.
* DetailsRoberto Ierusalimschy2020-02-271-3/+3
| | | | | Several details in code (e.g., moving a variable to the most inner scope that encloses its uses), comments, parameter names, extra tests.
* 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.
* Changed internal representation of booleansRoberto Ierusalimschy2020-01-061-1/+1
| | | | | | | 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.)
* Added macro 'testMMMode'Roberto Ierusalimschy2019-09-061-5/+3
| | | | Macro 'testMMMode' checks whether opcode is an MM opcode.
* Use of 'MMBIN' opcodes extended to shift operatorsRoberto Ierusalimschy2019-08-281-8/+0
| | | | Plus, this commit removes useless 'tm' parameters in 'op_*' macros.
* First version of OP_MMBIN opcodesRoberto Ierusalimschy2019-08-271-14/+7
| | | | | | | | | | | 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.)
* Tracebacks recognize metamethods '__close'Roberto Ierusalimschy2019-07-311-0/+3
|
* DetailsRoberto Ierusalimschy2019-06-031-2/+3
| | | | | Several small changes from feedback on 5.4 alhpa rc1 (warnings, typos in the manual, and the like)
* Added field 'srclen' to structure 'lua_Debug'Roberto Ierusalimschy2019-04-041-3/+11
| | | | | | 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.
* A to-be-closed variable must have a closable value (or be nil)Roberto Ierusalimschy2018-11-291-8/+10
| | | | | | | It is an error for a to-be-closed variable to have a non-closable non-nil value when it is being closed. This situation does not seem to be useful and often hints to an error. (Particularly in the C API, it is easy to change a to-be-closed index by mistake.)
* Added opcodes for arithmetic with K operandsRoberto Ierusalimschy2018-11-231-2/+8
| | | | | | | | 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').
* Better error messages for invalid operands in numeric 'for'Roberto Ierusalimschy2018-10-301-0/+6
| | | | | | "Better" and similar to error messages for invalid function arguments. *old message: 'for' limit must be a number *new message: bad 'for' limit (number expected, got table)
* 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.
* added 'const' to 'Proto*' when possibleRoberto Ierusalimschy2018-06-081-17/+18
|
* minimizing the code ran by 'vmfetch' + no more 'vra'Roberto Ierusalimschy2018-05-021-10/+17
| | | | (the code is simpler without 'vra' and conversion is a no-op)
* 'fTransfer' -> 'ftransfer' / 'nTransfer' -> 'ntransfer'Roberto Ierusalimschy2018-03-161-4/+4
| | | | (keep the standard of names in lower case)
* two new fields 'fTransfer'/'nTransfer' in 'lua_Debug' structureRoberto Ierusalimschy2018-02-171-3/+11
| | | | (for information about values being given and returned in function calls)
* vararg back to '...' (but with another implementation)Roberto Ierusalimschy2018-02-091-5/+21
| | | | new implementation should have zero overhead for non-vararg functions
* call hooks for Lua functions called by 'luaV_execute'Roberto Ierusalimschy2018-02-061-2/+2
|
* error handler in protected calls must be a functionRoberto Ierusalimschy2018-01-101-2/+2
|
* keep control of stack top in Lua functions concentrated in 'luaV_execute'Roberto Ierusalimschy2017-12-281-6/+3
|
* when running Lua code, there is no need to keep 'L->top' "correct";Roberto Ierusalimschy2017-12-201-9/+10
| | | | set it only when needed.
* '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-2/+3
| | | | | because, too often, masks in bitwise operations are integers larger than one byte.)
* opcodes for order and shift can use several metamethods,Roberto Ierusalimschy2017-12-071-4/+8
| | | | | so it is better to use a generic description + metamethod names in some error messages shown without '__' prefix
* detail (typo in comments)Roberto Ierusalimschy2017-11-231-2/+2
|
* no more 'stackless' implementation; 'luaV_execute' calls itselfRoberto Ierusalimschy2017-11-231-1/+2
| | | | | recursively to execute function calls. 'unroll' continues all executions suspended by an yield (through a long jump)
* using 'trap' to stop 'luaV_execute' when necessary (tracing andRoberto Ierusalimschy2017-11-131-2/+21
| | | | to update its copy of 'base' when the stack is reallocated)
* detailRoberto Ierusalimschy2017-11-131-7/+8
|
* new function 'luaV_flttointeger' to convert floats to integers (withoutRoberto Ierusalimschy2017-11-081-2/+2
| | | | | string coercions) + string operands to bitwise operations handled by string metamethods
* new format for JUMP instructions (to allow larger offsets)Roberto Ierusalimschy2017-11-071-2/+2
|
* back to 'CallInfo' (no gains with its removal)Roberto Ierusalimschy2017-11-071-90/+71
|
* 'lua_Debug' not using 'CallInfo'Roberto Ierusalimschy2017-11-031-10/+14
|
* removing uses of 'CallInfo'Roberto Ierusalimschy2017-11-031-52/+64
|
* no more useful fields in CallInfoRoberto Ierusalimschy2017-11-031-8/+10
|
* more fields moved out of 'CallInfo'Roberto Ierusalimschy2017-11-031-14/+15
|
* new API for 'lua_resume' + cleaning the uses of the 'extra' field inRoberto Ierusalimschy2017-11-021-24/+1
| | | | 'CallInfo'
* using 'L->func' when possibleRoberto Ierusalimschy2017-11-011-4/+4
|
* detail: in 'isinstack', check against the whole stack insteadRoberto Ierusalimschy2017-10-311-5/+5
| | | | of against the stack frame
* eplicit 1-bit opcode operand 'k'Roberto Ierusalimschy2017-10-041-9/+8
|