Roberto Ierusalimschy
55ac40f859
Cleaning of llimits.h
Several definitions that don't need to be "global" (that is, that
concerns only specific parts of the code) moved out of llimits.h,
to more appropriate places.
5 months ago
Roberto Ierusalimschy
9be74ccc21
Several functions turned 'static'
Several functions that were already being used only inside their
own file have been declared as 'static'.
1 year ago
Roberto Ierusalimschy
152b51955a
Removed GC checks from function calls
Function calls do not create new objects. (It may use memory with
stack reallocation, but now that is irrelevant to the GC.)
2 years ago
Roberto Ierusalimschy
413a393e62
Stack indices changed to union's
That will allow to change pointers to offsets while reallocating
the stack.
2 years ago
Roberto Ierusalimschy
d61b0c6028
More checks and documentation for uses of EXTRA_STACK
2 years ago
Roberto Ierusalimschy
e435aaabef
Details (identation and typos)
3 years ago
Roberto Ierusalimschy
1fce5bea81
More uniform implementation for tail calls
'luaD_pretailcall' mimics 'luaD_precall', handling call metamethods
and calling C functions directly. That makes the code in the
interpreter loop simpler.
This commit also goes back to emulating the tail call in 'luaD_precall'
with a goto, as C compilers may not do proper tail calls and the C
stack can overflow much sooner than the Lua stack (which grows as the
metamethod is added to it).
3 years ago
Roberto Ierusalimschy
91673a8ec0
'luaD_tryfuncTM' checks stack space by itself
3 years ago
Roberto Ierusalimschy
41871f1803
Undo simplification of tail calls (commit 901d760
)
Not that simpler and slower.
3 years ago
Roberto Ierusalimschy
dbdc74dc55
Simplification in the parameters of 'luaD_precall'
The parameters 'nresults' and 'delta1', in 'luaD_precall', were never
meaningful simultaneously. So, they were combined in a single parameter
'retdel'.
3 years ago
Roberto Ierusalimschy
901d760093
Simpler implementation for tail calls
Tail calls handled by 'luaD_precall', like regular calls, to avoid
code duplication.
3 years ago
Roberto Ierusalimschy
59c88f846d
Broadening the use of branch hints
More uses of macros 'likely'/'unlikely' (renamed to
'l_likely'/'l_unlikely'), both in range (extended to the
libraries) and in scope (extended to hooks, stack growth).
4 years ago
Roberto Ierusalimschy
7af27ef59d
Cleaner handling of errors in '__close' metamethods
Instead of protecting each individual metamethod call, protect the
entire call to 'luaF_close'.
4 years ago
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