Roberto Ierusalimschy
34840301b5
To-be-closed variables in the C API
6 years ago
Roberto Ierusalimschy
bd96330d03
First "complete" implementation of to-be-closed variables
Still missing:
- handling of memory errors when creating upvalue (must run closing
method all the same)
- interaction with coroutines
6 years ago
Roberto Ierusalimschy
4cd1f4aac0
Towards "to closed" local variables
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.
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
4d5de1c1fb
Fixed bug in line info. when using 'not' operator
When creating code for a jump on a 'not' condition, the code generator
was removing an instruction (the OP_NOT) without adjusting its
corresponding line information.
This fix also added tests for this case and extra functionality in
the test library to debug line info. structures.
6 years ago
Roberto Ierusalimschy
b08c9079c5
Opcode names moved to a new header file
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.
6 years ago
Roberto Ierusalimschy
6e600695f8
field 'sizearray' in struct 'Table' changed to 'alimit', which can
be used as a hint for '#t'
6 years ago
Roberto Ierusalimschy
992b6d2712
no more 'TESTGRAYBIT' (to free this bit for real uses)
7 years ago
Roberto Ierusalimschy
9e3db70482
details (casts between 'lua_Number' and 'double')
7 years ago
Roberto Ierusalimschy
9243c414d9
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
7 years ago
Roberto Ierusalimschy
ca6fe7449a
userdata can have multiple user values
7 years ago
Roberto Ierusalimschy
e2b15aa21d
janitor work on casts
7 years ago
Roberto Ierusalimschy
33e3774f44
keep more opcode arguments byte-aligned
7 years ago
Roberto Ierusalimschy
c6fedc92f8
new command 'print' (to print literal strings) in mini-language
7 years ago
Roberto Ierusalimschy
f8c1c1469a
some cleaning on signed opcode parameters
7 years ago
Roberto Ierusalimschy
3cf340f676
allows memory-allocation errors when shrinking blocks
7 years ago
Roberto Ierusalimschy
40f823ec90
new C instruction "rawcheckstack" (to test failing in 'lua_checkstack')
7 years ago
Roberto Ierusalimschy
cc01d46247
new test function 'T.allocount' to restrict number of allocations
before a memory-allocation error
7 years ago
Roberto Ierusalimschy
39f26b1480
more information from 'T.stacklevel'
7 years ago
Roberto Ierusalimschy
7c0175bc83
removed unused variable 'islocked'
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
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
a1ef58b3a5
eplicit 1-bit opcode operand 'k'
7 years ago
Roberto Ierusalimschy
7f9a32ad85
new function 'printcode'
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
5a1c8d8ef3
new constant 'LUA_GNAME' for the name of the global table "_G"
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
73ec04fcf3
no more 'DEADKEY'. Table traversals do not need to consider dead keys;
if the key is dead, it cannot be given to 'next'. Instead, we now
use a 'table' tag without the collectable bit, which makes it
a unique tag good enough to reserve space.
8 years ago
Roberto Ierusalimschy
b6f87491af
in hash nodes, keys are stored in separate pieces to avoid wasting
space with alignments
8 years ago
Roberto Ierusalimschy
8821746841
updated GC states in function 'T.gcstate'
8 years ago
Roberto Ierusalimschy
2376eb6347
barrier for prototype's cache (with new gray list 'protogray' to keep
prototypes to have their caches visited again) + constant 'MAXMISS'
8 years ago
Roberto Ierusalimschy
2caecf1b3e
type 'L_Umaxalign' replaced by macro 'LUAI_MAXALIGN', which is also added
to the auxlib buffer
8 years ago
Roberto Ierusalimschy
69371c4b84
'KGC_NORMAL' -> 'KGC_INC' + emergency GC signalled by flag (instead
of mode)
8 years ago
Roberto Ierusalimschy
7ae180f8e8
corrected some checks about colors of old objects + new test function
'gcage'
8 years ago
Roberto Ierusalimschy
4679294796
memory check adapted to generational mode
8 years ago
Roberto Ierusalimschy
f5f3df3bd1
generational collection: new attempt (still incomplete)
8 years ago
Roberto Ierusalimschy
b2aa2ba046
using constants for "_LOADED" and "PRELOAD"
8 years ago
Roberto Ierusalimschy
7b1fba69b7
using 'lastfree == NULL' to signal that table is using the dummy
node for its hash part + new macro 'allocsizenode'
8 years ago
Roberto Ierusalimschy
880f82d089
'*' as a number means stack size, so that "return *" returns
all values in the stack.
9 years ago
Roberto Ierusalimschy
53be1451a8
new definition for macro 'checkliveness'
9 years ago
Roberto Ierusalimschy
2de3361c6c
detail
9 years ago
Roberto Ierusalimschy
cbe05b48bb
using 'lua_longassert' to avoid warnings
10 years ago
Roberto Ierusalimschy
4998e852ec
new function 'log2' to test 'luaO_ceillog2' (if needed)
10 years ago
Roberto Ierusalimschy
331632e8d8
code detail ('if' -> '?:')
10 years ago
Roberto Ierusalimschy
0cf3b6495a
'ci_func' don't need to be exported
10 years ago
Roberto Ierusalimschy
7e2015a46d
size of short strings stored in a single byte, to reduce the size
of struct 'TString'
10 years ago