1.1 --- a/jitcraft/Opcodes.tbl Fri Jun 29 19:35:17 2012 -0700
1.2 +++ b/jitcraft/Opcodes.tbl Sat Jun 30 19:38:53 2012 -0700
1.3 @@ -93,23 +93,12 @@
1.4 OPDEF(OP_SETARRAY_F, 26, "setarray.f", 1, 3, 1)
1.5 OPDEF(OP_GETARRAY_P, 27, "getarray.p", 1, 2, 1)
1.6
1.7 -// Allocate an array of N dimensions into unsafe memory. Each dimension size
1.8 -// is encoded as an immediate. For the dynamic variant, they are popped off
1.9 -// the stack instead (sp[-1] == dimension 0, etc).
1.10 +// Allocate an array, info LIFO space if possible. The ArrayMap to use is
1.11 +// specified as an index into the script's Map table.
1.12 //
1.13 // Format:
1.14 -// [u8 op] [u8 width] [u8 dims] [imm32 ...]
1.15 -//
1.16 -// if (dynamic)
1.17 -// for (i = ndims - 1; i >= 0; i--)
1.18 -// dims[ndims - i - 1] = pop()
1.19 -//
1.20 -// push(array pref)
1.21 -//
1.22 -OPDEF(OP_STACKARRAY, 28, "stackarray", -1, 0, 1)
1.23 -
1.24 -// Unwinds the stack to its position before a local slot was allocated.
1.25 -OPDEF(OP_UNWIND, 29, "unwind", 5, 0, 0)
1.26 +// [u8 op] [u32 index]
1.27 +OPDEF(OP_LIFOARRAY, 28, "lifoarray", 5, 0, 1)
1.28
1.29 // Performs a bounds check on an unsafe array.
1.30 //
1.31 @@ -117,27 +106,31 @@
1.32 // array = pop()
1.33 // push(array)
1.34 // push(index)
1.35 -OPDEF(OP_BOUNDS_STA, 30, "bounds.sta", 1, 2, 2)
1.36 +OPDEF(OP_BOUNDS_STA, 29, "bounds.sta", 1, 2, 2)
1.37
1.38 // Pushes a 32-bit IEEE-754 floating point immediate onto the stack.
1.39 -OPDEF(OP_FLOAT, 31, "float", 5, 0, 1)
1.40 +OPDEF(OP_FLOAT, 30, "float", 5, 0, 1)
1.41
1.42 // Converts an integer to a 32-bit IEEE-754 floating point immediate.
1.43 -OPDEF(OP_CVT_I2F, 32, "cvt.i2f", 1, 1, 1)
1.44 +OPDEF(OP_CVT_I2F, 31, "cvt.i2f", 1, 1, 1)
1.45
1.46 // Stack transitions for these binary operators:
1.47 // rhs = pop()
1.48 // lhs = pop()
1.49 // push(lhs OP rhs)
1.50 -OPDEF(OP_ADD_F, 33, "add.f", 1, 2, 1)
1.51 -OPDEF(OP_SUB_F, 34, "sub.f", 1, 2, 1)
1.52 -OPDEF(OP_MUL_F, 35, "mul.f", 1, 2, 1)
1.53 -OPDEF(OP_DIV_F, 36, "div.f", 1, 2, 1)
1.54 +OPDEF(OP_ADD_F, 32, "add.f", 1, 2, 1)
1.55 +OPDEF(OP_SUB_F, 33, "sub.f", 1, 2, 1)
1.56 +OPDEF(OP_MUL_F, 34, "mul.f", 1, 2, 1)
1.57 +OPDEF(OP_DIV_F, 35, "div.f", 1, 2, 1)
1.58
1.59 // Bitwise operators.
1.60 -OPDEF(OP_SHL, 37, "shl", 1, 2, 1)
1.61 -OPDEF(OP_SHR, 38, "shr", 1, 2, 1)
1.62 -OPDEF(OP_USHR, 39, "ushr", 1, 2, 1)
1.63 -OPDEF(OP_BITAND, 40, "bitand", 1, 2, 1)
1.64 -OPDEF(OP_BITOR, 41, "bitor", 1, 2, 1)
1.65 -OPDEF(OP_BITXOR, 42, "bitxor", 1, 2, 1)
1.66 +OPDEF(OP_SHL, 36, "shl", 1, 2, 1)
1.67 +OPDEF(OP_SHR, 37, "shr", 1, 2, 1)
1.68 +OPDEF(OP_USHR, 38, "ushr", 1, 2, 1)
1.69 +OPDEF(OP_BITAND, 39, "bitand", 1, 2, 1)
1.70 +OPDEF(OP_BITOR, 40, "bitor", 1, 2, 1)
1.71 +OPDEF(OP_BITXOR, 41, "bitxor", 1, 2, 1)
1.72 +
1.73 +// Saves or restores the position of the LIFO heap to/from a local slot.
1.74 +OPDEF(OP_SAVELIFO, 42, "savelifo", 5, 0, 0)
1.75 +OPDEF(OP_UNWINDLIFO, 43, "unwindlifo", 5, 0, 0)
1.76 \ No newline at end of file