Opcode names moved to a new header file

The array with the names of the opcodes was moved to a header file
('lopnames.h'), as it is not used by the Lua kernel. Files that need
that array ('luac.c' and 'ltests.c') include the header file to get
a private (static) copy.
This commit is contained in:
Roberto Ierusalimschy
2018-07-09 12:50:51 -03:00
parent 06e08c6d05
commit b08c9079c5
4 changed files with 100 additions and 94 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lopcodes.c,v 1.81 2018/04/04 14:23:41 roberto Exp roberto $
** $Id: lopcodes.c,v 1.83 2018/06/26 18:00:55 roberto Exp $
** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -17,92 +17,6 @@
/* ORDER OP */
#if defined(LUAI_DEFOPNAMES)
LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
"MOVE",
"LOADI",
"LOADF",
"LOADK",
"LOADKX",
"LOADBOOL",
"LOADNIL",
"GETUPVAL",
"SETUPVAL",
"GETTABUP",
"GETTABLE",
"GETI",
"GETFIELD",
"SETTABUP",
"SETTABLE",
"SETI",
"SETFIELD",
"NEWTABLE",
"SELF",
"ADDI",
"SUBI",
"MULI",
"MODI",
"POWI",
"DIVI",
"IDIVI",
"BANDK",
"BORK",
"BXORK",
"SHRI",
"SHLI",
"ADD",
"SUB",
"MUL",
"MOD",
"POW",
"DIV",
"IDIV",
"BAND",
"BOR",
"BXOR",
"SHL",
"SHR",
"UNM",
"BNOT",
"NOT",
"LEN",
"CONCAT",
"CLOSE",
"JMP",
"EQ",
"LT",
"LE",
"EQK",
"EQI",
"LTI",
"LEI",
"GTI",
"GEI",
"TEST",
"TESTSET",
"CALL",
"TAILCALL",
"RETURN",
"RETURN0",
"RETURN1",
"FORLOOP1",
"FORPREP1",
"FORLOOP",
"FORPREP",
"TFORCALL",
"TFORLOOP",
"SETLIST",
"CLOSURE",
"VARARG",
"PREPVARARG",
"EXTRAARG",
NULL
};
#endif
LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
/* OT IT T A mode opcode */
opmode(0, 0, 0, 1, iABC) /* OP_MOVE */