1.1 --- a/src/Opcodes.tbl Sun Sep 16 19:02:23 2012 -0700
1.2 +++ b/src/Opcodes.tbl Sun Sep 16 21:34:10 2012 -0700
1.3 @@ -174,23 +174,22 @@
1.4 OPDEF(OP_VARREF_LIFO, 69, "varref.lifo", 5, 0, 1)
1.5 OPDEF(OP_ARGREF_LIFO, 70, "argref.lifo", 5, 0, 1)
1.6 OPDEF(OP_SLOTREF_LIFO, 71, "slotref.lifo", 1, 1, 1)
1.7 -OPDEF(OP_ARRAYREF_LIFO, 72, "arrayref.lifo",1, 2, 1)
1.8 -OPDEF(OP_GETREF_I, 73, "getref.i", 1, 1, 1)
1.9 -OPDEF(OP_SETREF_I, 74, "setref.i", 1, 2, 1)
1.10 -OPDEF(OP_GETREF_F, 75, "getref.f", 1, 1, 1)
1.11 -OPDEF(OP_SETREF_F, 76, "setref.f", 1, 2, 1)
1.12 +OPDEF(OP_GETREF_I, 72, "getref.i", 1, 1, 1)
1.13 +OPDEF(OP_SETREF_I, 73, "setref.i", 1, 2, 1)
1.14 +OPDEF(OP_GETREF_F, 74, "getref.f", 1, 1, 1)
1.15 +OPDEF(OP_SETREF_F, 75, "setref.f", 1, 2, 1)
1.16
1.17 // Pushes an object reference onto the stack.
1.18 -OPDEF(OP_OBJECT, 77, "object", 5, 0, 1)
1.19 +OPDEF(OP_OBJECT, 76, "object", 5, 0, 1)
1.20
1.21 // Duplicates the top item on the stack.
1.22 -OPDEF(OP_DUP, 78, "dup", 1, 1, 2)
1.23 +OPDEF(OP_DUP, 77, "dup", 1, 1, 2)
1.24
1.25 // Duplicates the top two items on the stack.
1.26 -OPDEF(OP_DUP2, 79, "dup2", 1, 2, 4)
1.27 +OPDEF(OP_DUP2, 78, "dup2", 1, 2, 4)
1.28
1.29 // Swaps the two items at the top of the stack.
1.30 -OPDEF(OP_SWAP, 80, "swap", 1, 2, 2)
1.31 +OPDEF(OP_SWAP, 79, "swap", 1, 2, 2)
1.32
1.33 // Roll operation is the same as Forth. It steals a value on the stack,
1.34 // shifting all stack values down, and then places the stolen value back at
1.35 @@ -200,14 +199,14 @@
1.36 // sp[-3] = sp[-2]
1.37 // sp[-2] = sp[-1]
1.38 // sp[-1] = p
1.39 -OPDEF(OP_ROLL3, 81, "roll3", 1, 3, 3)
1.40 +OPDEF(OP_ROLL3, 80, "roll3", 1, 3, 3)
1.41
1.42 // Pick operation is the same as Forth. It pushes a copy of a slot at a
1.43 // specific depth.
1.44 //
1.45 // push(sp[-n])
1.46 -OPDEF(OP_PICK2, 82, "pick2", 1, 2, 3)
1.47 -OPDEF(OP_PICK3, 83, "pick3", 1, 3, 4)
1.48 +OPDEF(OP_PICK2, 81, "pick2", 1, 2, 3)
1.49 +OPDEF(OP_PICK3, 82, "pick3", 1, 3, 4)
1.50
1.51 // Calls a native function. During the course of calling a native, arguments
1.52 // on the stack are re-pushed to match the cell-based native calling
1.53 @@ -218,57 +217,57 @@
1.54 //
1.55 // [u8 Opcode] [u32 Index] [u32 ArgCount]
1.56 //
1.57 -OPDEF(OP_CALLNATIVE, 84, "callnative", 9, -1, 1)
1.58 +OPDEF(OP_CALLNATIVE, 83, "callnative", 9, -1, 1)
1.59
1.60 // Returns from a function that does return a value.
1.61 -OPDEF(OP_RETURNVOID, 85, "returnvoid", 1, 0, 0)
1.62 +OPDEF(OP_RETURNVOID, 84, "returnvoid", 1, 0, 0)
1.63
1.64 // Loads the module of the running function.
1.65 -OPDEF(OP_MODULE, 86, "module", 1, 0, 1)
1.66 +OPDEF(OP_MODULE, 85, "module", 1, 0, 1)
1.67
1.68 // Loads a function from a module object. The operand is the slot number
1.69 // in the module.
1.70 -OPDEF(OP_GETMODULE_FN, 87, "getmodule.fn", 5, 1, 1)
1.71 +OPDEF(OP_GETMODULE_FN, 86, "getmodule.fn", 5, 1, 1)
1.72
1.73 // Opcodes for accessing an environment slot in the global scope.
1.74 -OPDEF(OP_SETGLOBAL_I, 88, "setglobal.i", 5, 1, 1)
1.75 -OPDEF(OP_SETGLOBAL_F, 89, "setglobal.f", 5, 1, 1)
1.76 -OPDEF(OP_SETGLOBAL_O, 90, "setglobal.o", 5, 1, 1)
1.77 -OPDEF(OP_GETGLOBAL_I, 91, "getglobal.i", 5, 0, 1)
1.78 -OPDEF(OP_GETGLOBAL_F, 92, "getglobal.f", 5, 0, 1)
1.79 -OPDEF(OP_GETGLOBAL_O, 93, "getglobal.o", 5, 0, 1)
1.80 +OPDEF(OP_SETGLOBAL_I, 87, "setglobal.i", 5, 1, 1)
1.81 +OPDEF(OP_SETGLOBAL_F, 88, "setglobal.f", 5, 1, 1)
1.82 +OPDEF(OP_SETGLOBAL_O, 89, "setglobal.o", 5, 1, 1)
1.83 +OPDEF(OP_GETGLOBAL_I, 90, "getglobal.i", 5, 0, 1)
1.84 +OPDEF(OP_GETGLOBAL_F, 91, "getglobal.f", 5, 0, 1)
1.85 +OPDEF(OP_GETGLOBAL_O, 92, "getglobal.o", 5, 0, 1)
1.86
1.87 // Reinterprets a 32-bit integer as a float, or vice-versa.
1.88 -OPDEF(OP_BITS_I2F, 94, "bits.i2f", 1, 1, 1)
1.89 -OPDEF(OP_BITS_F2I, 95, "bits.f2i", 1, 1, 1)
1.90 +OPDEF(OP_BITS_I2F, 93, "bits.i2f", 1, 1, 1)
1.91 +OPDEF(OP_BITS_F2I, 94, "bits.f2i", 1, 1, 1)
1.92
1.93 // Pushes a boolean value.
1.94 -OPDEF(OP_TRUE, 96, "true", 1, 0, 1)
1.95 -OPDEF(OP_FALSE, 97, "false", 1, 0, 1)
1.96 +OPDEF(OP_TRUE, 95, "true", 1, 0, 1)
1.97 +OPDEF(OP_FALSE, 96, "false", 1, 0, 1)
1.98
1.99 // Allocate a struct. The HeapTenure is stored as a byte following pc. The
1.100 // StructMap to use is specified as an index into the script's Map table.
1.101 //
1.102 // Format:
1.103 // [u8 op] [u8 tenure] [u32 index]
1.104 -OPDEF(OP_NEWSTRUCT, 98, "newstruct", 6, 0, 1)
1.105 +OPDEF(OP_NEWSTRUCT, 97, "newstruct", 6, 0, 1)
1.106
1.107 // Performs a struct-to-struct assignment.
1.108 // Left = pop()
1.109 // Right = pop()
1.110 // copy(Left, Right)
1.111 // push(Left)
1.112 -OPDEF(OP_COPYSTRUCT, 99, "structcopy", 1, 2, 1)
1.113 +OPDEF(OP_COPYSTRUCT, 98, "structcopy", 1, 2, 1)
1.114
1.115 // Sets or gets a property in a struct. The index of the field is specified as
1.116 // a 32-bit integer. Note that these opcodes follow a new style of deriving
1.117 // their types at runtime.
1.118 -OPDEF(OP_GETFIELD, 100, "getfield", 5, 1, 1)
1.119 -OPDEF(OP_SETFIELD, 101, "setfield", 5, 2, 1)
1.120 +OPDEF(OP_GETFIELD, 99, "getfield", 5, 1, 1)
1.121 +OPDEF(OP_SETFIELD, 100, "setfield", 5, 2, 1)
1.122
1.123 -OPDEF(OP_FIELDREF_LIFO, 102, "fieldref.lifo", 5, 1, 1)
1.124 +OPDEF(OP_FIELDREF_LIFO, 101, "fieldref.lifo", 5, 1, 1)
1.125
1.126 // Table-based jump.
1.127 // [u8 op] [i32 low] [i32 high] [u32 jump] [u32 jumps...]
1.128 -OPDEF(OP_TABLESWITCH, 103, "tableswitch", 9, 1, 0)
1.129 +OPDEF(OP_TABLESWITCH, 102, "tableswitch", 9, 1, 0)
1.130