1/*
2** $Id: ljumptab.h $
3** Jump Table for the Lua interpreter
4** See Copyright Notice in lua.h
5*/
6
7
8#undef vmdispatch
9#undef vmcase
10#undef vmbreak
11
12#define vmdispatch(x) goto *disptab[x];
13
14#define vmcase(l) L_##l:
15
16#define vmbreak vmfetch(); vmdispatch(GET_OPCODE(i));
17
18
19static const void *const disptab[NUM_OPCODES] = {
20
21#if 0
22** you can update the following list with this command:
23**
24** sed -n '/^OP_/\!d; s/OP_/\&\&L_OP_/ ; s/,.*/,/ ; s/\/.*// ; p' lopcodes.h
25**
26#endif
27
28&&L_OP_MOVE,
29&&L_OP_LOADI,
30&&L_OP_LOADF,
31&&L_OP_LOADK,
32&&L_OP_LOADKX,
33&&L_OP_LOADFALSE,
34&&L_OP_LFALSESKIP,
35&&L_OP_LOADTRUE,
36&&L_OP_LOADNIL,
37&&L_OP_GETUPVAL,
38&&L_OP_SETUPVAL,
39&&L_OP_GETTABUP,
40&&L_OP_GETTABLE,
41&&L_OP_GETI,
42&&L_OP_GETFIELD,
43&&L_OP_SETTABUP,
44&&L_OP_SETTABLE,
45&&L_OP_SETI,
46&&L_OP_SETFIELD,
47&&L_OP_NEWTABLE,
48&&L_OP_SELF,
49&&L_OP_ADDI,
50&&L_OP_ADDK,
51&&L_OP_SUBK,
52&&L_OP_MULK,
53&&L_OP_MODK,
54&&L_OP_POWK,
55&&L_OP_DIVK,
56&&L_OP_IDIVK,
57&&L_OP_BANDK,
58&&L_OP_BORK,
59&&L_OP_BXORK,
60&&L_OP_SHRI,
61&&L_OP_SHLI,
62&&L_OP_ADD,
63&&L_OP_SUB,
64&&L_OP_MUL,
65&&L_OP_MOD,
66&&L_OP_POW,
67&&L_OP_DIV,
68&&L_OP_IDIV,
69&&L_OP_BAND,
70&&L_OP_BOR,
71&&L_OP_BXOR,
72&&L_OP_SHL,
73&&L_OP_SHR,
74&&L_OP_MMBIN,
75&&L_OP_MMBINI,
76&&L_OP_MMBINK,
77&&L_OP_UNM,
78&&L_OP_BNOT,
79&&L_OP_NOT,
80&&L_OP_LEN,
81&&L_OP_CONCAT,
82&&L_OP_CLOSE,
83&&L_OP_TBC,
84&&L_OP_JMP,
85&&L_OP_EQ,
86&&L_OP_LT,
87&&L_OP_LE,
88&&L_OP_EQK,
89&&L_OP_EQI,
90&&L_OP_LTI,
91&&L_OP_LEI,
92&&L_OP_GTI,
93&&L_OP_GEI,
94&&L_OP_TEST,
95&&L_OP_TESTSET,
96&&L_OP_CALL,
97&&L_OP_TAILCALL,
98&&L_OP_RETURN,
99&&L_OP_RETURN0,
100&&L_OP_RETURN1,
101&&L_OP_FORLOOP,
102&&L_OP_FORPREP,
103&&L_OP_TFORPREP,
104&&L_OP_TFORCALL,
105&&L_OP_TFORLOOP,
106&&L_OP_SETLIST,
107&&L_OP_CLOSURE,
108&&L_OP_VARARG,
109&&L_OP_VARARGPREP,
110&&L_OP_EXTRAARG
111
112};
113