// Opcode definitions. #define OpcodeJMPT 0x01 /* branch on true */ #define OpcodeJMPF 0x02 /* branch on false */ #define OpcodeBR 0x03 /* branch unconditionally */ #define OpcodeTRUE 0x04 /* load val with true */ #define OpcodeNIL 0x05 /* load val with nil */ #define OpcodePUSH 0x06 /* push val onto stack */ #define OpcodeNOT 0x07 /* logical negate top of stack */ #define OpcodeADD 0x08 /* add two numeric expressions */ #define OpcodeSUB 0x09 /* subtract two numeric expressions */ #define OpcodeMUL 0x0a /* multiply two numeric expressions */ #define OpcodeDIV 0x0b /* divide two numeric expressions */ #define OpcodeREM 0x0c /* remainder of two numeric expressions */ #define OpcodeBAND 0x0d /* bitwise and of top two stack entries */ #define OpcodeBOR 0x0e /* bitwise or of top two stack entries */ #define OpcodeXOR 0x0f /* bitwise xor of top two stack entries */ #define OpcodeBNOT 0x10 /* bitwise not of top two stack entries */ #define OpcodeSHL 0x11 /* shift left top two stack entries */ #define OpcodeSHR 0x12 /* shift right top two stack entries */ #define OpcodeLT 0x13 /* less than */ #define OpcodeLE 0x14 /* less than or equal */ #define OpcodeEQ 0x15 /* equal */ #define OpcodeNE 0x16 /* not equal */ #define OpcodeGE 0x17 /* greater than or equal */ #define OpcodeGT 0x18 /* greater than */ #define OpcodeLIT 0x19 /* load literal */ #define OpcodeGREF 0x1a /* load a global variable value */ #define OpcodeGSET 0x1b /* set the value of a global variable */ #define OpcodeGETP 0x1c /* get the value of an object property */ #define OpcodeSETP 0x1d /* set the value of an object property and return the value */ #define OpcodeRETURN 0x1e /* return from interpreter */ #define OpcodeCALL 0x1f /* call a function */ #define OpcodeSEND 0x20 /* send a message to an object */ #define OpcodeEREF 0x21 /* load an environment value */ #define OpcodeESET 0x22 /* set an environment value */ #define OpcodeFRAME 0x23 /* push an environment frame */ #define OpcodeUNFRAME 0x24 /* pop an environment frame */ #define OpcodeVREF 0x25 /* get an element of a vector */ #define OpcodeVSET 0x26 /* set an element of a vector */ #define OpcodeNEG 0x27 /* negate top of stack */ #define OpcodeINC 0x28 /* increment */ #define OpcodeDEC 0x29 /* decrement */ #define OpcodeDUP2 0x2a /* duplicate top two elements on the stack */ #define OpcodeDROP 0x2b /* drop the top entry from the stack */ #define OpcodeDUP 0x2c /* duplicate the top entry on the stack */ #define OpcodeOVER 0x2d /* duplicate the second entry on the stack */ #define OpcodeNEWOBJECT 0x2e /* create a new object */ #define OpcodeCFRAME 0x2f /* create an environment frame */ #define OpcodeNEWVECTOR 0x30 /* create a new vector */ #define OpcodeARGFRAME 0x31 /* create an argument frame */ #define OpcodeARGFRAMER 0x32 /* create an argument frame with rest argument */ #define OpcodeCLOSE 0x33 /* create a closure */ #define OpcodeSWITCH 0x34 /* switch dispatch */ #define OpcodeARGSGE 0x35 /* argc greater than or equal to */ #define OpcodePUSHSCOP 0x36 /* push two copies of the current opcode object */ #define OpcodeTHROW 0x37 /* throw an exception */