a number of low-level tweaks from code review

This commit is contained in:
Vern Paxson 2021-08-19 10:15:44 -07:00
parent c10737d168
commit b6daf14868
12 changed files with 79 additions and 80 deletions

View file

@ -7,10 +7,10 @@
namespace zeek::detail {
// Opcodes associated with ZAM instructions.
typedef enum {
enum ZOp {
#include "zeek/ZAM-OpsDefs.h"
OP_NOP,
} ZOp;
};
// Possible types of instruction operands in terms of which fields they use.
@ -22,7 +22,7 @@ typedef enum {
// I1/I2/I3/I4: the instruction's integer value, used directly (not as a slot)
// FRAME: a slot in the (intrepreter) Frame object
// X: no operands
typedef enum {
enum ZAMOpType {
OP_X, OP_C, OP_V, OP_V_I1, OP_VC_I1,
OP_VC,
@ -46,15 +46,15 @@ typedef enum {
OP_VVVV_I3_I4,
OP_VVVV_I2_I3_I4,
} ZAMOpType;
};
// Possible "flavors" for an operator's first slot.
typedef enum {
enum ZAMOp1Flavor {
OP1_READ, // the slot is read, not modified
OP1_WRITE, // the slot is modified, not read - the most common
OP1_READ_WRITE, // the slot is both read and then modified, e.g. "++"
OP1_INTERNAL, // we're doing some internal manipulation of the slot
} ZAMOp1Flavor;
};
// Maps an operand to its flavor.
extern ZAMOp1Flavor op1_flavor[];