2018-07-11 00:40:30 +08:00
|
|
|
/*
|
2018-08-24 01:26:12 +08:00
|
|
|
** $Id: ljumptab.h $
|
2018-07-11 00:40:30 +08:00
|
|
|
** Jump Table for the Lua interpreter
|
|
|
|
** See Copyright Notice in lua.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2018-03-03 02:56:14 +08:00
|
|
|
#undef vmdispatch
|
|
|
|
#undef vmcase
|
|
|
|
#undef vmbreak
|
|
|
|
|
|
|
|
#define vmdispatch(x) goto *disptab[x];
|
|
|
|
|
|
|
|
#define vmcase(l) L_##l:
|
|
|
|
|
|
|
|
#define vmbreak vmfetch(); vmdispatch(GET_OPCODE(i));
|
|
|
|
|
|
|
|
|
2020-04-24 01:48:15 +08:00
|
|
|
static const void *const disptab[NUM_OPCODES] = {
|
2018-03-03 02:56:14 +08:00
|
|
|
|
2018-03-08 00:26:01 +08:00
|
|
|
#if 0
|
|
|
|
** you can update the following list with this command:
|
|
|
|
**
|
|
|
|
** sed -n '/^OP_/\!d; s/OP_/\&\&L_OP_/ ; s/,.*/,/ ; s/\/.*// ; p' lopcodes.h
|
|
|
|
**
|
|
|
|
#endif
|
2018-03-03 02:56:14 +08:00
|
|
|
|
|
|
|
&&L_OP_MOVE,
|
|
|
|
&&L_OP_LOADI,
|
|
|
|
&&L_OP_LOADF,
|
|
|
|
&&L_OP_LOADK,
|
|
|
|
&&L_OP_LOADKX,
|
2020-01-06 22:38:31 +08:00
|
|
|
&&L_OP_LOADFALSE,
|
2020-02-11 22:12:33 +08:00
|
|
|
&&L_OP_LFALSESKIP,
|
2020-01-06 22:38:31 +08:00
|
|
|
&&L_OP_LOADTRUE,
|
2018-03-03 02:56:14 +08:00
|
|
|
&&L_OP_LOADNIL,
|
|
|
|
&&L_OP_GETUPVAL,
|
|
|
|
&&L_OP_SETUPVAL,
|
|
|
|
&&L_OP_GETTABUP,
|
|
|
|
&&L_OP_GETTABLE,
|
|
|
|
&&L_OP_GETI,
|
|
|
|
&&L_OP_GETFI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,
|
|
|
|
&&L_OP_LE,
|
|
|
|
&&L_OP_EQK,
|
|
|
|
&&L_OP_EQI,
|
|
|
|
&&L_OP_LTI,
|
|
|
|
&&L_OP_LEI,
|
|
|
|
&&L_OP_GTI,
|
|
|
|
&&L_OP_GEI,
|
|
|
|
&&L_OP_TEST,
|
|
|
|
&&L_OP_TESTSET,
|
|
|
|
&&L_OP_CALL,
|
|
|
|
&&L_OP_TAILCALL,
|
|
|
|
&&L_OP_RETURN,
|
|
|
|
&&L_OP_RETURN0,
|
|
|
|
&&L_OP_RETURN1,
|
|
|
|
&&L_OP_FORLOOP,
|
|
|
|
&&L_OP_FORPREP,
|
2018-10-26 21:38:50 +08:00
|
|
|
&&L_OP_TFORPREP,
|
2018-03-03 02:56:14 +08:00
|
|
|
&&L_OP_TFORCALL,
|
|
|
|
&&L_OP_TFORLOOP,
|
|
|
|
&&L_OP_SETLIST,
|
|
|
|
&&L_OP_CLOSURE,
|
|
|
|
&&L_OP_VARARG,
|
2019-03-23 00:37:17 +08:00
|
|
|
&&L_OP_VARARGPREP,
|
2018-03-03 02:56:14 +08:00
|
|
|
&&L_OP_EXTRAARG
|
|
|
|
|
|
|
|
};
|