Roberto Ierusalimschy
490d42b5f8
Correct handling of 'luaV_execute' invocations
The previous stackless implementations marked all 'luaV_execute'
invocations as fresh. However, re-entering 'luaV_execute' when
resuming a coroutine should not be a fresh invocation. (It works
because 'unroll' called 'luaV_execute' for each call entry, but
it was slower than letting 'luaV_execute' finish all non-fresh
invocations.)
4 years ago
Roberto Ierusalimschy
5d8ce05b3f
Back to a stackless implementation
A "with stack" implementation gains too little in performance to be
worth all the noise from C-stack overflows.
This commit is almost a sketch, to test performance. There are several
pending stuff:
- review control of C-stack overflow and error messages;
- what to do with setcstacklimit;
- review comments;
- review unroll of Lua calls.
4 years ago
Roberto Ierusalimschy
eb41999461
Fixed bugs of stack reallocation x GC
Macro 'checkstackGC' was doing a GC step after resizing the stack;
the GC could shrink the stack and undo the resize. Moreover, macro
'checkstackp' also does a GC step, which could remove the preallocated
CallInfo when calling a function. (Its name has been changed to
'checkstackGCp' to emphasize that it calls the GC.)
4 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
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
02ed0b2c30
in 'luaD_poscall', there is no need to compute 'firstResult' when 'nres==0'
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
0682fe8169
some simplifications/optimizations in returns from Lua functions
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
ab0a851db4
'luaD_tryfuncTM' can ensure it does not change the stack
7 years ago
Roberto Ierusalimschy
bfb88e99e9
'luaD_growstack' cannot raise any errors when 'raiseerror' is
false (+ some comments)
7 years ago
Roberto Ierusalimschy
e663a24ab0
more freedom in handling memory-allocation errors (not all allocations
automatically raise an error), which allows fixing a bug when resizing
a table.
7 years ago
Roberto Ierusalimschy
194a4f9710
small simplifications in 'luaD_poscall'
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
14c3aa12b5
more direct implementation for tail calls.
7 years ago
Roberto Ierusalimschy
ad0704e40c
back to 'CallInfo' (no gains with its removal)
7 years ago
Roberto Ierusalimschy
93fd67b793
no more 'CallInfo' structure
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
5c8770f896
back to old-style vararg system (with vararg table collecting extra
arguments)
8 years ago
Roberto Ierusalimschy
c0836dda74
avoid empty macro arguments (invalid in C89)
9 years ago
Roberto Ierusalimschy
c5112f7b15
details (comments)
9 years ago
Roberto Ierusalimschy
d103312661
details (typos in comments)
9 years ago
Roberto Ierusalimschy
9a5d6aedb7
trying to optimize a little 'luaD_poscall'
9 years ago
Roberto Ierusalimschy
ff1289a361
in 'luaD_call', use two functions instead of one with fixed boolean
argument
9 years ago
Roberto Ierusalimschy
8c1fb91802
macro 'incr_top' replaced by function 'luaD_inctop'. (It is not used
in critical time pathes, can save a few bytes without the macro)
9 years ago
Roberto Ierusalimschy
5bdee4f810
small changes to allow 'precall' to spend time preserving 'func'
only when needed (that is, when stack actually changes)
9 years ago
Roberto Ierusalimschy
d39bb51faa
bug: interpreter cannot pop activation frame before calling return
hook (as it may want to access local variables active by the end
of the function)
10 years ago
Roberto Ierusalimschy
bdf566a8a3
`name' in comments changed to 'name'
10 years ago
Roberto Ierusalimschy
3617e04e97
'lua_load' has an extra argument 'mode'
13 years ago
Roberto Ierusalimschy
217e67cb22
new type 'l_noret' for function that do not return
13 years ago
Roberto Ierusalimschy
e0f9d1c8f5
removed export of function only for coco
15 years ago
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
15 years ago
Roberto Ierusalimschy
b40a38a8ac
remove declaration of removed function
15 years ago
Roberto Ierusalimschy
f76f4cb79d
new way to control stack overflow, controling only total size of the stack
16 years ago
Roberto Ierusalimschy
abb85fc059
new definition for 'luaD_checkstack' to avoid possible overflows
16 years ago
Roberto Ierusalimschy
4a67e48611
new macro 'condmovestack' instead of 'condhardstacktests'
16 years ago
Roberto Ierusalimschy
4f88418170
'CallInfo' stack implemented as double-linked list instead of an array
16 years ago
Roberto Ierusalimschy
ba484b9eb1
yielding across lua_call (first version)
16 years ago
Roberto Ierusalimschy
fdbb243ff9
first steps towards yielding through longjump
16 years ago
Roberto Ierusalimschy
2a84c29bc3
comment about exported function not used by Lua
17 years ago
Roberto Ierusalimschy
3ca9af51a4
emergency garbage collector (core forces a GC when allocation fails)
19 years ago
Roberto Ierusalimschy
98296f6b45
some bugs related to stack reallocation
19 years ago
Roberto Ierusalimschy
23b79c5945
small changes to facilitate external C coroutines
19 years ago
Roberto Ierusalimschy
6fcd334ca0
small improvements
19 years ago
Roberto Ierusalimschy
8718fda9b2
added LUAI_FUNC to functions not in the API
20 years ago
Roberto Ierusalimschy
0de2065f4e
tighter tests for stack overflow
20 years ago
Roberto Ierusalimschy
0bda88e6cd
small steps towards yields in iterators and tag methods
21 years ago
Roberto Ierusalimschy
47fc57a252
`TObject' renamed to `TValue' + other name changes and better assertions
for incremental garbage collection
21 years ago
Roberto Ierusalimschy
8332d5c8a5
parser fully reentrant(!)
22 years ago