Roberto Ierusalimschy
46b84580d6
Use of 'MMBIN' opcodes extended to shift operators
Plus, this commit removes useless 'tm' parameters in 'op_*' macros.
5 years ago
Roberto Ierusalimschy
df13f25948
First version of OP_MMBIN opcodes
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.)
5 years ago
Roberto Ierusalimschy
fe040633a1
Tracebacks recognize metamethods '__close'
5 years ago
Roberto Ierusalimschy
2c68e66570
Details
Several small changes from feedback on 5.4 alhpa rc1 (warnings,
typos in the manual, and the like)
6 years ago
Roberto Ierusalimschy
5ca1075b71
Added field 'srclen' to structure 'lua_Debug'
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.
6 years ago
Roberto Ierusalimschy
6d04537ea6
A to-be-closed variable must have a closable value (or be nil)
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.)
6 years ago
Roberto Ierusalimschy
84e32ad2eb
Added opcodes for arithmetic with K operands
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').
6 years ago
Roberto Ierusalimschy
e073cbc2e5
Better error messages for invalid operands in numeric 'for'
"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)
6 years ago
Roberto Ierusalimschy
f99509581e
Removed extra information from RCS keyword strings
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
6 years ago
Roberto Ierusalimschy
6f2b8e21c4
added 'const' to 'Proto*' when possible
7 years ago
Roberto Ierusalimschy
e64e20ac81
minimizing the code ran by 'vmfetch' + no more 'vra'
(the code is simpler without 'vra' and conversion is a no-op)
7 years ago
Roberto Ierusalimschy
4907444db9
'fTransfer' -> 'ftransfer' / 'nTransfer' -> 'ntransfer'
(keep the standard of names in lower case)
7 years ago
Roberto Ierusalimschy
422318f677
two new fields 'fTransfer'/'nTransfer' in 'lua_Debug' structure
(for information about values being given and returned in function calls)
7 years ago
Roberto Ierusalimschy
b1379936cf
vararg back to '...' (but with another implementation)
new implementation should have zero overhead for non-vararg functions
7 years ago
Roberto Ierusalimschy
51280ef2ad
call hooks for Lua functions called by 'luaV_execute'
7 years ago
Roberto Ierusalimschy
728ff94595
error handler in protected calls must be a function
7 years ago
Roberto Ierusalimschy
cf7eff45f3
keep control of stack top in Lua functions concentrated in 'luaV_execute'
7 years ago
Roberto Ierusalimschy
1d5b885437
when running Lua code, there is no need to keep 'L->top' "correct";
set it only when needed.
7 years ago
Roberto Ierusalimschy
b3f924bc69
'Proto->numparams' does not include vararg parameter
(one less subtraction when calling functions...)
7 years ago
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.)
7 years ago
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
7 years ago
Roberto Ierusalimschy
599f1742c6
detail (typo in comments)
7 years ago
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)
7 years ago
Roberto Ierusalimschy
5440b42f43
using 'trap' to stop 'luaV_execute' when necessary (tracing and
to update its copy of 'base' when the stack is reallocated)
7 years ago
Roberto Ierusalimschy
62f3b7c472
detail
7 years ago
Roberto Ierusalimschy
26679ea35b
new function 'luaV_flttointeger' to convert floats to integers (without
string coercions) + string operands to bitwise operations handled
by string metamethods
7 years ago
Roberto Ierusalimschy
c3e5946fb2
new format for JUMP instructions (to allow larger offsets)
7 years ago
Roberto Ierusalimschy
ad0704e40c
back to 'CallInfo' (no gains with its removal)
7 years ago
Roberto Ierusalimschy
6bb3e40a8d
'lua_Debug' not using 'CallInfo'
7 years ago
Roberto Ierusalimschy
7612f7735d
removing uses of 'CallInfo'
7 years ago
Roberto Ierusalimschy
472c560705
no more useful fields in CallInfo
7 years ago
Roberto Ierusalimschy
54eb35a8aa
more fields moved out of 'CallInfo'
7 years ago
Roberto Ierusalimschy
ba36180fd7
new API for 'lua_resume' + cleaning the uses of the 'extra' field in
'CallInfo'
7 years ago
Roberto Ierusalimschy
b9e76be8a6
using 'L->func' when possible
7 years ago
Roberto Ierusalimschy
ad5dcdcf0f
detail: in 'isinstack', check against the whole stack instead
of against the stack frame
7 years ago
Roberto Ierusalimschy
a1ef58b3a5
eplicit 1-bit opcode operand 'k'
7 years ago
Roberto Ierusalimschy
8fbe9e3470
new opcodes with immediate integer operand for all arithmetic operations
7 years ago
Roberto Ierusalimschy
b1daa069ba
bug: Lua does not check GC when creating error messages
7 years ago
Roberto Ierusalimschy
4dff277255
coercion string->number in arithmetic operations moved to string
library
7 years ago
Roberto Ierusalimschy
f96497397a
new type 'StackValue' for stack elements
(we may want to put extra info there in the future)
7 years ago
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.)
7 years ago
Roberto Ierusalimschy
6d95de83c6
no more field 'base' in CallInfo (base is always equal to 'func + 1',
with old/new vararg implementation)
8 years ago
Roberto Ierusalimschy
5c8770f896
back to old-style vararg system (with vararg table collecting extra
arguments)
8 years ago
Roberto Ierusalimschy
a454e884e0
details in 'findsetreg'
8 years ago
Roberto Ierusalimschy
502a1d1108
new opcodes for table access with constant keys (strings and integers)
8 years ago
Roberto Ierusalimschy
173e41b2eb
new opcode OP_ADDI (for immediate integer operand) (Experimental)
8 years ago
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)
8 years ago
Roberto Ierusalimschy
d77a7a8c26
detail (comment)
9 years ago
Roberto Ierusalimschy
7777b412de
When available, use metafield '__name' in error messages
9 years ago
Roberto Ierusalimschy
a051b3323e
comments (about hooks vs signals)
9 years ago