jitcraft/Opcodes.tbl
changeset 21 af5d8e985502
parent 19 c685db6c98e6
child 22 765ab1b672a3
     1.1 --- a/jitcraft/Opcodes.tbl	Sun Jul 01 11:25:36 2012 -0700
     1.2 +++ b/jitcraft/Opcodes.tbl	Sun Jul 01 14:52:57 2012 -0700
     1.3 @@ -92,14 +92,16 @@
     1.4  OPDEF(OP_SETARRAY_I,    24,         "setarray.i",   1,      3,  1)
     1.5  OPDEF(OP_GETARRAY_F,    25,         "getarray.f",   1,      2,  1)
     1.6  OPDEF(OP_SETARRAY_F,    26,         "setarray.f",   1,      3,  1)
     1.7 -OPDEF(OP_GETARRAY_O,    27,         "getarray.o",   1,      2,  1)
     1.8 +OPDEF(OP_GETARRAY_C,    27,         "getarray.c",   1,      2,  1)
     1.9 +OPDEF(OP_SETARRAY_C,    28,         "setarray.c",   1,      3,  1)
    1.10 +OPDEF(OP_GETARRAY_O,    29,         "getarray.o",   1,      2,  1)
    1.11  
    1.12  // Allocate an array, info LIFO space if possible. The ArrayMap to use is
    1.13  // specified as an index into the script's Map table.
    1.14  //
    1.15  // Format:
    1.16  //  [u8 op] [u32 index]
    1.17 -OPDEF(OP_NEWARRAY_LIFO, 28,         "newarray.lifo", 5,     0,  1)
    1.18 +OPDEF(OP_NEWARRAY_LIFO, 30,         "newarray.lifo", 5,     0,  1)
    1.19  
    1.20  // Performs a bounds check on an unsafe array.
    1.21  //
    1.22 @@ -107,41 +109,51 @@
    1.23  // array = pop()
    1.24  // push(array)
    1.25  // push(index)
    1.26 -OPDEF(OP_BOUNDS,        29,         "bounds",       1,      2,  2)
    1.27 +OPDEF(OP_BOUNDS,        31,         "bounds",       1,      2,  2)
    1.28  
    1.29  // Pushes a 32-bit IEEE-754 floating point immediate onto the stack.
    1.30 -OPDEF(OP_FLOAT,         30,         "float",        5,      0,  1)
    1.31 +OPDEF(OP_FLOAT,         32,         "float",        5,      0,  1)
    1.32  
    1.33  // Converts an integer to a 32-bit IEEE-754 floating point immediate.
    1.34 -OPDEF(OP_CVT_I2F,       31,         "cvt.i2f",      1,      1,  1)
    1.35 +OPDEF(OP_CVT_I2F,       33,         "cvt.i2f",      1,      1,  1)
    1.36  
    1.37  // Stack transitions for these binary operators:
    1.38  // rhs = pop()
    1.39  // lhs = pop()
    1.40  // push(lhs OP rhs)
    1.41 -OPDEF(OP_ADD_F,         32,         "add.f",        1,      2,  1)
    1.42 -OPDEF(OP_SUB_F,         33,         "sub.f",        1,      2,  1)
    1.43 -OPDEF(OP_MUL_F,         34,         "mul.f",        1,      2,  1)
    1.44 -OPDEF(OP_DIV_F,         35,         "div.f",        1,      2,  1)
    1.45 +OPDEF(OP_ADD_F,         34,         "add.f",        1,      2,  1)
    1.46 +OPDEF(OP_SUB_F,         35,         "sub.f",        1,      2,  1)
    1.47 +OPDEF(OP_MUL_F,         36,         "mul.f",        1,      2,  1)
    1.48 +OPDEF(OP_DIV_F,         37,         "div.f",        1,      2,  1)
    1.49  
    1.50  // Bitwise operators.
    1.51 -OPDEF(OP_SHL,           36,         "shl",          1,      2,  1)
    1.52 -OPDEF(OP_SHR,           37,         "shr",          1,      2,  1)
    1.53 -OPDEF(OP_USHR,          38,         "ushr",         1,      2,  1)
    1.54 -OPDEF(OP_BITAND,        39,         "bitand",       1,      2,  1)
    1.55 -OPDEF(OP_BITOR,         40,         "bitor",        1,      2,  1)
    1.56 -OPDEF(OP_BITXOR,        41,         "bitxor",       1,      2,  1)
    1.57 +OPDEF(OP_SHL,           38,         "shl",          1,      2,  1)
    1.58 +OPDEF(OP_SHR,           39,         "shr",          1,      2,  1)
    1.59 +OPDEF(OP_USHR,          40,         "ushr",         1,      2,  1)
    1.60 +OPDEF(OP_BITAND,        41,         "bitand",       1,      2,  1)
    1.61 +OPDEF(OP_BITOR,         42,         "bitor",        1,      2,  1)
    1.62 +OPDEF(OP_BITXOR,        43,         "bitxor",       1,      2,  1)
    1.63  
    1.64  // Saves or restores the position of the LIFO heap to/from a local slot.
    1.65 -OPDEF(OP_SAVELIFO,      42,         "savelifo",     5,      0,  0)
    1.66 -OPDEF(OP_UNWINDLIFO,    43,         "unwindlifo",   5,      0,  0)
    1.67 +OPDEF(OP_SAVELIFO,      44,         "savelifo",     5,      0,  0)
    1.68 +OPDEF(OP_UNWINDLIFO,    45,         "unwindlifo",   5,      0,  0)
    1.69  
    1.70  // Composes a variable reference to a stack slot or argument.
    1.71 -OPDEF(OP_VARREF_LIFO,   44,         "varref.lifo",  5,      0,  1)
    1.72 -OPDEF(OP_ARGREF_LIFO,   45,         "argref.lifo",  5,      0,  1)
    1.73 -OPDEF(OP_SLOTREF_LIFO,  46,         "slotref.lifo", 1,      1,  1)
    1.74 -OPDEF(OP_ARRAYREF_LIFO, 47,         "arrayref.lifo",1,      2,  1)
    1.75 -OPDEF(OP_GETREF_I,      48,         "getref.i",     1,      1,  1)
    1.76 -OPDEF(OP_SETREF_I,      49,         "setref.i",     1,      2,  1)
    1.77 -OPDEF(OP_GETREF_F,      50,         "getref.f",     1,      1,  1)
    1.78 -OPDEF(OP_SETREF_F,      51,         "setref.f",     1,      2,  1)
    1.79 +OPDEF(OP_VARREF_LIFO,   46,         "varref.lifo",  5,      0,  1)
    1.80 +OPDEF(OP_ARGREF_LIFO,   47,         "argref.lifo",  5,      0,  1)
    1.81 +OPDEF(OP_SLOTREF_LIFO,  48,         "slotref.lifo", 1,      1,  1)
    1.82 +OPDEF(OP_ARRAYREF_LIFO, 49,         "arrayref.lifo",1,      2,  1)
    1.83 +OPDEF(OP_GETREF_I,      50,         "getref.i",     1,      1,  1)
    1.84 +OPDEF(OP_SETREF_I,      51,         "setref.i",     1,      2,  1)
    1.85 +OPDEF(OP_GETREF_F,      52,         "getref.f",     1,      1,  1)
    1.86 +OPDEF(OP_SETREF_F,      53,         "setref.f",     1,      2,  1)
    1.87 +
    1.88 +// Pushes an object reference onto the stack.
    1.89 +OPDEF(OP_OBJECT,        54,         "object",       5,      0,  1)
    1.90 +
    1.91 +// Performs an array-to-array assignment.
    1.92 +//   Left = pop()
    1.93 +//   Right = pop()
    1.94 +//   copy(Left, Right)
    1.95 +//   push(Left)
    1.96 +OPDEF(OP_ARRAYCOPY,     55,         "arraycopy",    1,      2,  1)