|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
-** $Id: lvm.c,v 2.347 2018/02/23 13:13:31 roberto Exp roberto $
|
|
|
|
|
|
+** $Id: lvm.c,v 2.348 2018/02/26 14:16:05 roberto Exp roberto $
|
|
** Lua virtual machine
|
|
** Lua virtual machine
|
|
** See Copyright Notice in lua.h
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
*/
|
|
@@ -31,6 +31,16 @@
|
|
#include "lvm.h"
|
|
#include "lvm.h"
|
|
|
|
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+** By default, use jump tables in the main interpreter loop on gcc
|
|
|
|
+** and compatible compilers.
|
|
|
|
+*/
|
|
|
|
+#if !defined(LUA_USE_JUMPTABLE)
|
|
|
|
+#define LUA_USE_JUMPTABLE defined(__GNUC__)
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
/* limit for table tag-method chains (to avoid infinite loops) */
|
|
/* limit for table tag-method chains (to avoid infinite loops) */
|
|
#define MAXTAGLOOP 2000
|
|
#define MAXTAGLOOP 2000
|
|
|
|
|
|
@@ -871,6 +881,9 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
|
|
StkId base;
|
|
StkId base;
|
|
const Instruction *pc;
|
|
const Instruction *pc;
|
|
int trap;
|
|
int trap;
|
|
|
|
+#if LUA_USE_JUMPTABLE
|
|
|
|
+#include "ljumptab.h"
|
|
|
|
+#endif
|
|
tailcall:
|
|
tailcall:
|
|
trap = L->hookmask;
|
|
trap = L->hookmask;
|
|
cl = clLvalue(s2v(ci->func));
|
|
cl = clLvalue(s2v(ci->func));
|