diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-03-02 15:59:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-03-02 15:59:19 -0300 |
commit | 62a392ff465b26b39f91a4959895a8330c4eeebd (patch) | |
tree | c18e5c7fb2445ea6fab864b98cfd1be975c6fa12 /lvm.c | |
parent | 893f382e94e05578063f91830ee735f48ee95c8b (diff) | |
download | lua-62a392ff465b26b39f91a4959895a8330c4eeebd.tar.gz lua-62a392ff465b26b39f91a4959895a8330c4eeebd.tar.bz2 lua-62a392ff465b26b39f91a4959895a8330c4eeebd.zip |
using jump tables when available
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.347 2018/02/23 13:13:31 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.348 2018/02/26 14:16:05 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -31,6 +31,16 @@ | |||
31 | #include "lvm.h" | 31 | #include "lvm.h" |
32 | 32 | ||
33 | 33 | ||
34 | /* | ||
35 | ** By default, use jump tables in the main interpreter loop on gcc | ||
36 | ** and compatible compilers. | ||
37 | */ | ||
38 | #if !defined(LUA_USE_JUMPTABLE) | ||
39 | #define LUA_USE_JUMPTABLE defined(__GNUC__) | ||
40 | #endif | ||
41 | |||
42 | |||
43 | |||
34 | /* limit for table tag-method chains (to avoid infinite loops) */ | 44 | /* limit for table tag-method chains (to avoid infinite loops) */ |
35 | #define MAXTAGLOOP 2000 | 45 | #define MAXTAGLOOP 2000 |
36 | 46 | ||
@@ -871,6 +881,9 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
871 | StkId base; | 881 | StkId base; |
872 | const Instruction *pc; | 882 | const Instruction *pc; |
873 | int trap; | 883 | int trap; |
884 | #if LUA_USE_JUMPTABLE | ||
885 | #include "ljumptab.h" | ||
886 | #endif | ||
874 | tailcall: | 887 | tailcall: |
875 | trap = L->hookmask; | 888 | trap = L->hookmask; |
876 | cl = clLvalue(s2v(ci->func)); | 889 | cl = clLvalue(s2v(ci->func)); |