Commit Graph

361 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
b1379936cf vararg back to '...' (but with another implementation)
new implementation should have zero overhead for non-vararg functions
2018-02-09 13:16:06 -02:00
Roberto Ierusalimschy
51280ef2ad call hooks for Lua functions called by 'luaV_execute' 2018-02-06 17:16:56 -02:00
Roberto Ierusalimschy
728ff94595 error handler in protected calls must be a function 2018-01-10 10:02:35 -02:00
Roberto Ierusalimschy
cf7eff45f3 keep control of stack top in Lua functions concentrated in 'luaV_execute' 2017-12-28 13:42:57 -02:00
Roberto Ierusalimschy
1d5b885437 when running Lua code, there is no need to keep 'L->top' "correct";
set it only when needed.
2017-12-20 12:58:05 -02:00
Roberto Ierusalimschy
b3f924bc69 'Proto->numparams' does not include vararg parameter
(one less subtraction when calling functions...)
2017-12-15 11:07:10 -02:00
Roberto Ierusalimschy
86431a2f1c new opcodes BANDK/BORK/BXORK. (They do not use immediate operands
because, too often, masks in bitwise operations are integers larger
than one byte.)
2017-12-13 16:32:09 -02:00
Roberto Ierusalimschy
9fa1baf6de opcodes for order and shift can use several metamethods,
so it is better to use a generic description + metamethod names
in some error messages shown without '__' prefix
2017-12-07 13:44:10 -02:00
Roberto Ierusalimschy
599f1742c6 detail (typo in comments) 2017-11-23 17:29:04 -02:00
Roberto Ierusalimschy
196c87c9ce no more 'stackless' implementation; 'luaV_execute' calls itself
recursively to execute function calls. 'unroll' continues all
executions suspended by an yield (through a long jump)
2017-11-23 14:41:16 -02:00
Roberto Ierusalimschy
5440b42f43 using 'trap' to stop 'luaV_execute' when necessary (tracing and
to update its copy of 'base' when the stack is reallocated)
2017-11-13 13:36:52 -02:00
Roberto Ierusalimschy
62f3b7c472 detail 2017-11-13 10:20:51 -02:00
Roberto Ierusalimschy
26679ea35b new function 'luaV_flttointeger' to convert floats to integers (without
string coercions) + string operands to bitwise operations handled
by string metamethods
2017-11-08 12:50:23 -02:00
Roberto Ierusalimschy
c3e5946fb2 new format for JUMP instructions (to allow larger offsets) 2017-11-07 15:20:42 -02:00
Roberto Ierusalimschy
ad0704e40c back to 'CallInfo' (no gains with its removal) 2017-11-07 11:25:26 -02:00
Roberto Ierusalimschy
6bb3e40a8d 'lua_Debug' not using 'CallInfo' 2017-11-03 18:41:05 -02:00
Roberto Ierusalimschy
7612f7735d removing uses of 'CallInfo' 2017-11-03 17:33:22 -02:00
Roberto Ierusalimschy
472c560705 no more useful fields in CallInfo 2017-11-03 15:22:54 -02:00
Roberto Ierusalimschy
54eb35a8aa more fields moved out of 'CallInfo' 2017-11-03 10:12:30 -02:00
Roberto Ierusalimschy
ba36180fd7 new API for 'lua_resume' + cleaning the uses of the 'extra' field in
'CallInfo'
2017-11-02 09:28:56 -02:00
Roberto Ierusalimschy
b9e76be8a6 using 'L->func' when possible 2017-11-01 16:20:48 -02:00
Roberto Ierusalimschy
ad5dcdcf0f detail: in 'isinstack', check against the whole stack instead
of against the stack frame
2017-10-31 15:14:02 -02:00
Roberto Ierusalimschy
a1ef58b3a5 eplicit 1-bit opcode operand 'k' 2017-10-04 18:56:32 -03:00
Roberto Ierusalimschy
8fbe9e3470 new opcodes with immediate integer operand for all arithmetic operations 2017-10-04 12:49:24 -03:00
Roberto Ierusalimschy
b1daa069ba bug: Lua does not check GC when creating error messages 2017-07-10 14:35:12 -03:00
Roberto Ierusalimschy
4dff277255 coercion string->number in arithmetic operations moved to string
library
2017-07-07 13:34:32 -03:00
Roberto Ierusalimschy
f96497397a new type 'StackValue' for stack elements
(we may want to put extra info there in the future)
2017-06-29 12:06:44 -03:00
Roberto Ierusalimschy
b42430fd3a 'lineinfo' in prototypes saved as differences instead of absolute
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.)
2017-06-27 08:35:31 -03:00
Roberto Ierusalimschy
6d95de83c6 no more field 'base' in CallInfo (base is always equal to 'func + 1',
with old/new vararg implementation)
2017-05-13 10:54:47 -03:00
Roberto Ierusalimschy
5c8770f896 back to old-style vararg system (with vararg table collecting extra
arguments)
2017-05-13 10:04:33 -03:00
Roberto Ierusalimschy
a454e884e0 details in 'findsetreg' 2017-04-29 12:28:38 -03:00
Roberto Ierusalimschy
502a1d1108 new opcodes for table access with constant keys (strings and integers) 2017-04-28 17:57:45 -03:00
Roberto Ierusalimschy
173e41b2eb new opcode OP_ADDI (for immediate integer operand) (Experimental) 2017-04-26 14:46:52 -03:00
Roberto Ierusalimschy
e2dc807c6e check whether function is finalizer when finding a name for it +
comments + some instructions can call functions in unespected ways
(e.g., finalizers)
2016-10-19 10:32:10 -02:00
Roberto Ierusalimschy
d77a7a8c26 detail (comment) 2016-03-31 16:01:21 -03:00
Roberto Ierusalimschy
7777b412de When available, use metafield '__name' in error messages 2016-02-26 16:20:15 -03:00
Roberto Ierusalimschy
a051b3323e comments (about hooks vs signals) 2015-12-16 14:40:07 -02:00
Roberto Ierusalimschy
ff1289a361 in 'luaD_call', use two functions instead of one with fixed boolean
argument
2015-11-02 16:48:07 -02:00
Roberto Ierusalimschy
ee5ef0f295 hook test in 'luaV_execute' reduced to minimum (rest done in
'luaG_traceexec'
2015-10-22 12:40:47 -02:00
Roberto Ierusalimschy
6142e663e4 reuse of 'addinfo' by lexical errors 2015-05-22 14:45:56 -03:00
Roberto Ierusalimschy
e723c75c02 details (avoid 'lint' warnings) 2015-03-28 16:14:47 -03:00
Roberto Ierusalimschy
0cf3b6495a 'ci_func' don't need to be exported 2015-03-11 13:10:41 -03:00
Roberto Ierusalimschy
a30c66f0fc macro 'luai_apicheck'/'api_check' back with a 'lua_State' parameter
(some people use it)
2015-03-06 16:49:50 -03:00
Roberto Ierusalimschy
4bdf9962bf bug: suspended function can have its 'func' field not pointing to
its function, crashing debug functions
2015-02-13 14:01:17 -02:00
Roberto Ierusalimschy
3a29087cb7 'lua_setlocal' should not pop value when failing (to be consistent
with the manual and with 'lua_setupvalue')
2015-01-02 10:52:22 -02:00
Roberto Ierusalimschy
b4633c586b error handler does not need to be a function (can be a callable
object)
2014-12-10 09:30:09 -02:00
Roberto Ierusalimschy
c6e74e41c9 handle case where function was called as a hook 2014-12-08 13:48:23 -02:00
Roberto Ierusalimschy
be87789a6c details 2014-11-11 15:08:19 -02:00
Roberto Ierusalimschy
d1d1ddec1e details 2014-11-10 16:41:19 -02:00
Roberto Ierusalimschy
9212175ffb added missing cases for debug info about tag methods +
better error message for bitwise operators
2014-11-10 12:46:46 -02:00
Roberto Ierusalimschy
e75c0148c3 comments (references to "ANSI C" changed to "ISO C", which is the
international name
2014-11-02 17:33:33 -02:00
Roberto Ierusalimschy
28fdbcf393 added include for 'lprefix.h', for stuff that must be added before
any other header file
2014-11-02 17:19:04 -02:00
Roberto Ierusalimschy
bdf566a8a3 `name' in comments changed to 'name' 2014-10-25 09:50:46 -02:00
Roberto Ierusalimschy
f97c64d7bf macros 'LUA_QL'/'LUA_QL' deprecated 2014-10-17 13:28:21 -03:00
Roberto Ierusalimschy
34ac039fb8 new macro 'cvt2str' to better control whether numbers are convertible
to strings
2014-07-30 11:00:14 -03:00
Roberto Ierusalimschy
8bb272a3e3 new conversion float->integer: conversion is valid only when
float has an exact representation as an integer
2014-07-17 09:30:53 -03:00
Roberto Ierusalimschy
5bbb4a06a6 removed unused parameter Ä'L' in macro 'api_check' and company 2014-07-15 18:26:50 -03:00
Roberto Ierusalimschy
16493b777f 'lua_sethook' returns void 2013-12-09 12:21:10 -02:00
Roberto Ierusalimschy
98d76cdcae bug: Wrong error message in some short-cut expressions 2013-07-10 17:32:36 -03:00
Roberto Ierusalimschy
f2043b7a58 correct error message for conversion errors from float to int 2013-05-06 14:21:59 -03:00
Roberto Ierusalimschy
9b9becf384 added 'const' to parameters of 'luaG_concaterror' 2013-04-29 13:58:10 -03:00
Roberto Ierusalimschy
4abe99dc34 new interface for 'tonumber' 2013-04-26 13:03:50 -03:00
Roberto Ierusalimschy
a2f5c28a80 new operation '//' (integer division) 2013-04-26 10:08:29 -03:00
Roberto Ierusalimschy
32bf6c9b27 functions 'traceexec', 'callTM', and 'call_binTM' moved to other
files to make 'lvm.c' a little smaller
2013-04-25 12:59:42 -03:00
Roberto Ierusalimschy
a3e1c40d6d remove of unecessary luaD_checkstack. (In some cases, C should
ensure stack space; in others, Lua can use the extra slots for
temporary values.)
2012-08-16 14:34:28 -03:00
Roberto Ierusalimschy
fd22ccd6d0 object tag keeps variant bits too -> no need for 'isC' field in
Closures + more strick typing for closure variants
2012-01-20 20:05:50 -02:00
Roberto Ierusalimschy
6d8b672094 more uses of 'l_noret' 2011-11-30 10:43:51 -02:00
Roberto Ierusalimschy
217e67cb22 new type 'l_noret' for function that do not return 2011-10-07 17:45:19 -03:00
Roberto Ierusalimschy
2275030b86 details (and missing 'break's) 2011-09-13 15:05:59 -03:00
Roberto Ierusalimschy
05de314701 upvalue names always can be NULL (if debug info was removed), so
always check for that case
2011-09-13 14:40:20 -03:00
Roberto Ierusalimschy
0b65cb74cd new implementation for 'getobjname': first search for relevant
instruction (new function 'findsetreg') and then try to build
a meaningful name
2011-08-12 17:01:44 -03:00
Roberto Ierusalimschy
92afcf2823 no more 'luaH_setstr (used only once) + 'luaH_setint' receives value
to be set.
2011-08-09 17:58:29 -03:00
Roberto Ierusalimschy
3b44821334 stricter control (using tag variants) over closure kinds (Lua x C) 2011-06-02 16:31:40 -03:00
Roberto Ierusalimschy
d120ec29ca bug in OP_SELF when method name goes to a register 2011-04-28 11:00:11 -03:00
Roberto Ierusalimschy
4758113043 change in opcode OP_LOADNIL: B is used as a counter instead of a
register. (Avoids an assignment to R(B), not present in any other
instruction.)
2011-04-19 13:22:13 -03:00
Roberto Ierusalimschy
a4e644add2 small bug (masked by wrong entry for OP_TEST in opcodes.c) 2011-04-18 16:49:13 -03:00
Roberto Ierusalimschy
2e9b8476ca detail ('luai_apicheck' should be used always through macro 'api_check') 2011-04-18 12:02:37 -03:00
Roberto Ierusalimschy
427ee519db new instruction OP_LOADKX (to replace OP_LOADK with extra argument) 2011-04-07 15:14:12 -03:00
Roberto Ierusalimschy
c4ea0c3b29 detail (cleaning trailing spaces) 2011-01-26 14:30:02 -02:00
Roberto Ierusalimschy
12779b2b71 getlocal/setlocal can access vararg parameters 2010-11-30 15:17:51 -02:00
Roberto Ierusalimschy
cd0ebd0a80 'proto->source' may be NULL (if dump strips debug information) 2010-10-11 17:24:42 -03:00
Roberto Ierusalimschy
0df2238063 name "_ENV" configurable through 'luaconf.h' 2010-09-07 16:21:39 -03:00
Roberto Ierusalimschy
ca3865cf1b 'getlocal' gets information about parameters of Lua functions 2010-06-21 13:30:12 -03:00
Roberto Ierusalimschy
409741e900 'what' may be NULL in 'kname' 2010-06-16 10:44:36 -03:00
Roberto Ierusalimschy
7dfa4cd655 first implementation of light C functions 2010-04-14 12:13:48 -03:00
Roberto Ierusalimschy
28aa733c15 macro 'eqstr' was being used to compare non-string entities 2010-04-08 14:06:33 -03:00
Roberto Ierusalimschy
d394d5536a new macro 'eqstr' 2010-04-05 13:26:37 -03:00
Roberto Ierusalimschy
22ef84b6c8 '_ENV' name permanently stored in global state for easier access 2010-03-13 12:55:42 -03:00
Roberto Ierusalimschy
25c557ec63 first version of _ENV; no more global variables 2010-03-12 16:14:06 -03:00
Roberto Ierusalimschy
c295147874 when finding a 'name' for a function, handle the case when the function
is a for iterator
2010-03-05 11:01:29 -03:00
Roberto Ierusalimschy
0fe2576a39 new instructions to optimize indexing on upvalues 2010-02-26 17:40:29 -03:00
Roberto Ierusalimschy
070d3743a7 "no value" added to array luaT_typenames + occurrences of "userdata"
in that array unified in a single address
2010-01-13 14:18:25 -02:00
Roberto Ierusalimschy
427e01eb63 removed useless initialization 2010-01-11 15:37:59 -02:00
Roberto Ierusalimschy
5bcfe0c700 new debug info 'isvararg' and 'nparams' 2010-01-06 12:42:35 -02:00
Roberto Ierusalimschy
513d0258d9 details 2009-12-01 14:31:04 -02:00
Roberto Ierusalimschy
19a6c38745 detail in 'currentpc' (only needs to work for Lua functions) 2009-11-26 13:34:15 -02:00
Roberto Ierusalimschy
b0f2b288a6 new scheme for debug info about tail calls: no more 'fake' stack entries,
but stack entry knows whether it was tail called
2009-11-25 13:27:51 -02:00
Roberto Ierusalimschy
b114c99a60 two small bugs: 'debug.getinfo' did not consider negative indices as out
of range + 'debug.[gs]etlocal' crash on tail calls
2009-10-13 16:07:40 -03:00
Roberto Ierusalimschy
5938212748 information about upvalues (where they come from) kept in Proto structure,
instead of sequence of pseudo-opcodes after OP_CLOSURE
2009-09-28 13:32:50 -03:00
Roberto Ierusalimschy
ab75bd23ee handle extended opcodes (with OP_EXTRAARG) when checking metamethod
calls
2009-09-28 09:37:17 -03:00