diff options
-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)); |