aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-09-21 10:31:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-10-12 12:29:09 -0300
commit5d8ce05b3f6fad79e37ed21c1076e47a322472c6 (patch)
tree7629a59887da63d44267e872bc8e33be6db36582 /lparser.c
parentf83de8e34e24e30acf277f60de62a33bd51d1ddd (diff)
downloadlua-5d8ce05b3f6fad79e37ed21c1076e47a322472c6.tar.gz
lua-5d8ce05b3f6fad79e37ed21c1076e47a322472c6.tar.bz2
lua-5d8ce05b3f6fad79e37ed21c1076e47a322472c6.zip
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.
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lparser.c b/lparser.c
index bc7d9a4f..502a9b2d 100644
--- a/lparser.c
+++ b/lparser.c
@@ -489,12 +489,14 @@ static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {
489} 489}
490 490
491 491
492/* 492static void enterlevel (LexState *ls) {
493** Macros to limit the maximum recursion depth while parsing 493 lua_State *L = ls->L;
494*/ 494 L->nCcalls++;
495#define enterlevel(ls) luaE_enterCcall((ls)->L) 495 checklimit(ls->fs, getCcalls(L), LUAI_MAXCCALLS, "C levels");
496}
497
496 498
497#define leavelevel(ls) luaE_exitCcall((ls)->L) 499#define leavelevel(ls) ((ls)->L->nCcalls--)
498 500
499 501
500/* 502/*