/[jscoverage]/trunk/js/jsopcode.tbl
ViewVC logotype

Diff of /trunk/js/jsopcode.tbl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 332 by siliconforks, Thu Oct 23 19:03:33 2008 UTC revision 460 by siliconforks, Sat Sep 26 23:15:22 2009 UTC
# Line 1  Line 1 
1  /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-  /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2   * vim: set ts=8 sw=4 et tw=0 ft=C:   * vim: set ts=8 sw=4 et tw=0 ft=c:
3   *   *
4   * ***** BEGIN LICENSE BLOCK *****   * ***** BEGIN LICENSE BLOCK *****
5   * Version: MPL 1.1/GPL 2.0/LGPL 2.1   * Version: MPL 1.1/GPL 2.0/LGPL 2.1
# Line 64  Line 64 
64   * format       Bytecode plus immediate operand encoding format   * format       Bytecode plus immediate operand encoding format
65   *   *
66   * Precedence   Operators               Opcodes   * Precedence   Operators               Opcodes
67   *  1           let (x = y) z, yield w  JSOP_LEAVEBLOCKEXPR, JSOP_YIELD   *  1           yield w                 JSOP_YIELD
68   *  2           ,                       JSOP_POP with SRC_PCDELTA, JSOP_RETURN   *  2           ,                       JSOP_POP with SRC_PCDELTA, JSOP_RETURN
69   *  3           =, +=, etc.             JSOP_SETNAME, etc. (all JOF_ASSIGNING)   *  3           =, +=, etc.             JSOP_SETNAME, etc. (all JOF_SET);
70     *                let (...) ...           and JSOP_LEAVEBLOCKEXPR
71   *  4           ?:                      JSOP_IFEQ, JSOP_IFEQX   *  4           ?:                      JSOP_IFEQ, JSOP_IFEQX
72   *  5           ||                      JSOP_OR, JSOP_ORX   *  5           ||                      JSOP_OR, JSOP_ORX
73   *  6           &&                      JSOP_AND, JSOP_ANDX   *  6           &&                      JSOP_AND, JSOP_ANDX
# Line 78  Line 79 
79   * 12           <<, >>, >>>             JSOP_LSH, JSOP_RSH, JSOP_URSH   * 12           <<, >>, >>>             JSOP_LSH, JSOP_RSH, JSOP_URSH
80   * 13           +, -, etc.              JSOP_ADD, JSOP_SUB, etc.   * 13           +, -, etc.              JSOP_ADD, JSOP_SUB, etc.
81   * 14           *, /, %                 JSOP_MUL, JSOP_DIV, JSOP_MOD   * 14           *, /, %                 JSOP_MUL, JSOP_DIV, JSOP_MOD
82   * 15           !, ~, etc.              JSOP_NOT, JSOP_BITNOT, etc.   * 15           !, ~, delete, etc.      JSOP_NOT, JSOP_BITNOT, JSOP_DEL*, etc.
83   * 16           3.14, 0, etc.           JSOP_DOUBLE, JSOP_ZERO, etc.   * 16           3.14, 0, etc.           JSOP_DOUBLE, JSOP_ZERO, etc.
84   * 17           delete, new             JSOP_DEL*, JSOP_NEW   * 17           new                     JSOP_NEW
85   * 18           x.y, f(), etc.          JSOP_GETPROP, JSOP_CALL, etc.   * 18           x.y, f(), etc.          JSOP_GETPROP, JSOP_CALL, etc.
86   * 19           x, null, etc.           JSOP_NAME, JSOP_NULL, etc.   * 19           x, null,                JSOP_NAME, JSOP_NULL, etc.;
87     *               function (...) ...       and JSOP_LAMBDA
88   *   *
89   * The push-numeric-constant operators, JSOP_ZERO, JSOP_DOUBLE, etc., have   * The push-numeric-constant operators, JSOP_ZERO, JSOP_DOUBLE, etc., have
90   * lower precedence than the member operators emitted for the . operator, to   * lower precedence than the member operators emitted for the . operator, to
91   * cause the decompiler to parenthesize the . left operand, e.g. (0).foo.   * cause the decompiler to parenthesize the . left operand, e.g. (0).foo.
92   * Otherwise the . could be taken as a decimal point.  We use the same level   * Otherwise the . could be taken as a decimal point.
93   * 16 for function expressions too, to force parenthesization.   *
94     * Let expressions are "primary" when viewed from the left, but they eat up ops
95     * to the right as if assignment expressions and therefore have precedence 3.
96     * This makes the decompiler retain the parentheses in (let (a=0) x) ? a : 0
97     * but omit the superfluous ones in (let (a=0) x), a.
98     *
99     * Yield expressions must be parenthesized even in comma-expressions and
100     * argument lists, so they have the lowest precedence.
101   *   *
102   * This file is best viewed with 128 columns:   * This file is best viewed with 128 columns:
103  12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678  12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
# Line 96  Line 105 
105    
106  /* legend: op         val name          image       len use def prec  format */  /* legend: op         val name          image       len use def prec  format */
107    
108  /* Longstanding JavaScript bytecodes. */  /*
109  OPDEF(JSOP_INTERRUPT, 0,  "interrupt",  NULL,         1,  0,  0,  0,  JOF_BYTE)   * Generic nop for the decompiler.
110     */
111    OPDEF(JSOP_NOP,       0,  "nop",        NULL,         1,  0,  0,  0,  JOF_BYTE)
112    
113    /* Long-standing JavaScript bytecodes. */
114  OPDEF(JSOP_PUSH,      1,  "push",       NULL,         1,  0,  1,  0,  JOF_BYTE)  OPDEF(JSOP_PUSH,      1,  "push",       NULL,         1,  0,  1,  0,  JOF_BYTE)
115  OPDEF(JSOP_POPV,      2,  "popv",       NULL,         1,  1,  0,  2,  JOF_BYTE)  OPDEF(JSOP_POPV,      2,  "popv",       NULL,         1,  1,  0,  2,  JOF_BYTE)
116  OPDEF(JSOP_ENTERWITH, 3,  "enterwith",  NULL,         1,  1,  1,  0,  JOF_BYTE|JOF_PARENHEAD)  OPDEF(JSOP_ENTERWITH, 3,  "enterwith",  NULL,         1,  1,  1,  0,  JOF_BYTE|JOF_PARENHEAD)
# Line 111  Line 124 
124  OPDEF(JSOP_ARGUMENTS, 9, js_arguments_str, js_arguments_str, 1, 0, 1, 18, JOF_BYTE)  OPDEF(JSOP_ARGUMENTS, 9, js_arguments_str, js_arguments_str, 1, 0, 1, 18, JOF_BYTE)
125    
126  /* ECMA-compliant for-in loop with argument or local loop control. */  /* ECMA-compliant for-in loop with argument or local loop control. */
127  OPDEF(JSOP_FORARG,    10, "forarg",     NULL,         3,  0,  1, 19,  JOF_QARG|JOF_NAME|JOF_FOR)  OPDEF(JSOP_FORARG,    10, "forarg",     NULL,         3,  2,  2, 19,  JOF_QARG|JOF_NAME|JOF_FOR)
128  OPDEF(JSOP_FORLOCAL,  11, "forlocal",   NULL,         3,  0,  1, 19,  JOF_LOCAL|JOF_NAME|JOF_FOR)  OPDEF(JSOP_FORLOCAL,  11, "forlocal",   NULL,         3,  2,  2, 19,  JOF_LOCAL|JOF_NAME|JOF_FOR)
129    
130  /* More longstanding bytecodes. */  /* More long-standing bytecodes. */
131  OPDEF(JSOP_DUP,       12, "dup",        NULL,         1,  1,  2,  0,  JOF_BYTE)  OPDEF(JSOP_DUP,       12, "dup",        NULL,         1,  1,  2,  0,  JOF_BYTE)
132  OPDEF(JSOP_DUP2,      13, "dup2",       NULL,         1,  2,  4,  0,  JOF_BYTE)  OPDEF(JSOP_DUP2,      13, "dup2",       NULL,         1,  2,  4,  0,  JOF_BYTE)
133  OPDEF(JSOP_SETCONST,  14, "setconst",   NULL,         3,  1,  1,  3,  JOF_ATOM|JOF_NAME|JOF_SET)  OPDEF(JSOP_SETCONST,  14, "setconst",   NULL,         3,  1,  1,  3,  JOF_ATOM|JOF_NAME|JOF_SET)
# Line 138  Line 151 
151  OPDEF(JSOP_NOT,       32, "not",        "!",          1,  1,  1, 15,  JOF_BYTE|JOF_DETECTING)  OPDEF(JSOP_NOT,       32, "not",        "!",          1,  1,  1, 15,  JOF_BYTE|JOF_DETECTING)
152  OPDEF(JSOP_BITNOT,    33, "bitnot",     "~",          1,  1,  1, 15,  JOF_BYTE)  OPDEF(JSOP_BITNOT,    33, "bitnot",     "~",          1,  1,  1, 15,  JOF_BYTE)
153  OPDEF(JSOP_NEG,       34, "neg",        "- ",         1,  1,  1, 15,  JOF_BYTE)  OPDEF(JSOP_NEG,       34, "neg",        "- ",         1,  1,  1, 15,  JOF_BYTE)
154  OPDEF(JSOP_NEW,       35, js_new_str,   NULL,         3, -1,  1, 17,  JOF_UINT16|JOF_INVOKE)  OPDEF(JSOP_POS,       35, "pos",        "+ ",         1,  1,  1, 15,  JOF_BYTE)
155  OPDEF(JSOP_DELNAME,   36, "delname",    NULL,         3,  0,  1, 17,  JOF_ATOM|JOF_NAME|JOF_DEL)  OPDEF(JSOP_DELNAME,   36, "delname",    NULL,         3,  0,  1, 15,  JOF_ATOM|JOF_NAME|JOF_DEL)
156  OPDEF(JSOP_DELPROP,   37, "delprop",    NULL,         3,  1,  1, 17,  JOF_ATOM|JOF_PROP|JOF_DEL)  OPDEF(JSOP_DELPROP,   37, "delprop",    NULL,         3,  1,  1, 15,  JOF_ATOM|JOF_PROP|JOF_DEL)
157  OPDEF(JSOP_DELELEM,   38, "delelem",    NULL,         1,  2,  1, 17,  JOF_BYTE |JOF_ELEM|JOF_DEL)  OPDEF(JSOP_DELELEM,   38, "delelem",    NULL,         1,  2,  1, 15,  JOF_BYTE |JOF_ELEM|JOF_DEL)
158  OPDEF(JSOP_TYPEOF,    39, js_typeof_str,NULL,         1,  1,  1, 15,  JOF_BYTE|JOF_DETECTING)  OPDEF(JSOP_TYPEOF,    39, js_typeof_str,NULL,         1,  1,  1, 15,  JOF_BYTE|JOF_DETECTING)
159  OPDEF(JSOP_VOID,      40, js_void_str,  NULL,         1,  1,  1, 15,  JOF_BYTE)  OPDEF(JSOP_VOID,      40, js_void_str,  NULL,         1,  1,  1, 15,  JOF_BYTE)
160    
# Line 181  Line 194 
194  OPDEF(JSOP_LOOKUPSWITCH, 71, "lookupswitch", NULL,   -1,  1,  0,  0,  JOF_LOOKUPSWITCH|JOF_DETECTING|JOF_PARENHEAD)  OPDEF(JSOP_LOOKUPSWITCH, 71, "lookupswitch", NULL,   -1,  1,  0,  0,  JOF_LOOKUPSWITCH|JOF_DETECTING|JOF_PARENHEAD)
195    
196  /* New, infallible/transitive identity ops. */  /* New, infallible/transitive identity ops. */
197  OPDEF(JSOP_STRICTEQ,  72, "stricteq",   NULL,         1,  2,  1,  10,  JOF_BYTE|JOF_DETECTING)  OPDEF(JSOP_STRICTEQ,  72, "stricteq",   "===",        1,  2,  1, 10,  JOF_BYTE|JOF_DETECTING|JOF_LEFTASSOC)
198  OPDEF(JSOP_STRICTNE,  73, "strictne",   NULL,         1,  2,  1,  10,  JOF_BYTE|JOF_DETECTING)  OPDEF(JSOP_STRICTNE,  73, "strictne",   "!==",        1,  2,  1, 10,  JOF_BYTE|JOF_DETECTING|JOF_LEFTASSOC)
199    
200  /* Resume instruction (emitted for the JIT for instructions that can't be restarted). */  /*
201  OPDEF(JSOP_RESUME,    74, "resume",     NULL,         1,  0,  0,  0,  JOF_BYTE)   * Host object extension: given 'o.item(i) = j', the left-hand side compiles
202     * JSOP_SETCALL, rather than JSOP_CALL.
203     */
204    OPDEF(JSOP_SETCALL,   74, "setcall",    NULL,         3, -1,  2, 18,  JOF_UINT16|JOF_SET)
205    
206  /* Variant of JSOP_NULL for default (global) |this| parameter pushing. */  /*
207  OPDEF(JSOP_NULLTHIS,  75, js_null_str,  js_null_str,  1,  0,  1, 19,  JOF_BYTE)   * JSOP_ITER sets up a for-in or for-each-in loop using the JSITER_* flag bits
208     * in this op's uint8 immediate operand. It replaces the top of stack object
209     * with an iterator for that object, and pushes a slot used by JSOP_NEXTITER.
210     *
211     * JSOP_NEXTITER stores the next iterated value in the top of stack slot which
212     * was allocated by JSOP_ITER and pushes true, or stores JSVAL_HOLE and pushes
213     * false. It is followed immediately by JSOP_IFNE{,X}.
214     *
215     * JSOP_ENDITER cleans up after the loop. It uses the slot above the iterator
216     * for temporary GC rooting.
217     */
218    OPDEF(JSOP_ITER,      75, "iter",       NULL,         2,  1,  2,  0,  JOF_UINT8)
219    OPDEF(JSOP_NEXTITER,  76, "nextiter",   NULL,         1,  2,  3,  0,  JOF_BYTE)
220    OPDEF(JSOP_ENDITER,   77, "enditer",    NULL,         1,  2,  0,  0,  JOF_BYTE)
221    
222  OPDEF(JSOP_UNUSED76,  76, "unused76",   NULL,         1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_APPLY,     78, "apply",      NULL,         3, -1,  1, 18,  JOF_UINT16|JOF_INVOKE)
223  OPDEF(JSOP_UNUSED77,  77, "unused77",   NULL,         1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_SWAP,      79, "swap",       NULL,         1,  2,  2,  0,  JOF_BYTE)
 OPDEF(JSOP_UNUSED78,  78, "unused78",   NULL,         1,  0,  0,  0,  JOF_BYTE)  
 OPDEF(JSOP_UNUSED79,  79, "unused79",   NULL,         1,  0,  0,  0,  JOF_BYTE)  
224    
225  /* Push object literal. */  /* Push object literal. */
226  OPDEF(JSOP_OBJECT,    80, "object",     NULL,         3,  0,  1, 19,  JOF_OBJECT)  OPDEF(JSOP_OBJECT,    80, "object",     NULL,         3,  0,  1, 19,  JOF_OBJECT)
# Line 202  Line 229 
229  OPDEF(JSOP_POP,       81, "pop",        NULL,         1,  1,  0,  2,  JOF_BYTE)  OPDEF(JSOP_POP,       81, "pop",        NULL,         1,  1,  0,  2,  JOF_BYTE)
230    
231  /* Convert value to number, for unary +. */  /* Convert value to number, for unary +. */
232  OPDEF(JSOP_POS,       82, "pos",        "+ ",         1,  1,  1, 15,  JOF_BYTE)  OPDEF(JSOP_NEW,       82, js_new_str,   NULL,         3, -1,  1, 17,  JOF_UINT16|JOF_INVOKE)
233    
234  /* Trap into debugger for breakpoint, etc. */  /* Trap into debugger for breakpoint, etc. */
235  OPDEF(JSOP_TRAP,      83, "trap",       NULL,         1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_TRAP,      83, "trap",       NULL,         1,  0,  0,  0,  JOF_BYTE)
# Line 235  Line 262 
262  OPDEF(JSOP_LOCALINC,  101,"localinc",   NULL,         3,  0,  1, 15,  JOF_LOCAL|JOF_NAME|JOF_INC|JOF_POST)  OPDEF(JSOP_LOCALINC,  101,"localinc",   NULL,         3,  0,  1, 15,  JOF_LOCAL|JOF_NAME|JOF_INC|JOF_POST)
263  OPDEF(JSOP_LOCALDEC,  102,"localdec",   NULL,         3,  0,  1, 15,  JOF_LOCAL|JOF_NAME|JOF_DEC|JOF_POST)  OPDEF(JSOP_LOCALDEC,  102,"localdec",   NULL,         3,  0,  1, 15,  JOF_LOCAL|JOF_NAME|JOF_DEC|JOF_POST)
264    
265  /*  OPDEF(JSOP_IMACOP,    103,"imacop",     NULL,         1,  0,  0,  0,  JOF_BYTE)
  * Initialize for-in iterator using the JSITER_* flag bits in this op's uint8  
  * immediate operand. See also JSOP_ENDITER.  
  */  
 OPDEF(JSOP_ITER,      103,"iter",       NULL,         2,  1,  1,  0,  JOF_UINT8)  
266    
267  /* ECMA-compliant for/in ops. */  /* ECMA-compliant for/in ops. */
268  OPDEF(JSOP_FORNAME,   104,"forname",    NULL,         3,  0,  1, 19,  JOF_ATOM|JOF_NAME|JOF_FOR)  OPDEF(JSOP_FORNAME,   104,"forname",    NULL,         3,  2,  2, 19,  JOF_ATOM|JOF_NAME|JOF_FOR)
269  OPDEF(JSOP_FORPROP,   105,"forprop",    NULL,         3,  1,  1, 18,  JOF_ATOM|JOF_PROP|JOF_FOR)  OPDEF(JSOP_FORPROP,   105,"forprop",    NULL,         3,  3,  2, 18,  JOF_ATOM|JOF_PROP|JOF_FOR)
270  OPDEF(JSOP_FORELEM,   106,"forelem",    NULL,         1,  1,  3, 18,  JOF_BYTE |JOF_ELEM|JOF_FOR)  OPDEF(JSOP_FORELEM,   106,"forelem",    NULL,         1,  2,  3, 18,  JOF_BYTE |JOF_ELEM|JOF_FOR)
271  OPDEF(JSOP_POPN,      107,"popn",       NULL,         3, -1,  0,  0,  JOF_UINT16)  OPDEF(JSOP_POPN,      107,"popn",       NULL,         3, -1,  0,  0,  JOF_UINT16)
272    
273  /* ECMA-compliant assignment ops. */  /* ECMA-compliant assignment ops. */
# Line 305  Line 328 
328  OPDEF(JSOP_DEFCONST,  126,"defconst",   NULL,         3,  0,  0,  0,  JOF_ATOM|JOF_DECLARING)  OPDEF(JSOP_DEFCONST,  126,"defconst",   NULL,         3,  0,  0,  0,  JOF_ATOM|JOF_DECLARING)
329  OPDEF(JSOP_DEFVAR,    127,"defvar",     NULL,         3,  0,  0,  0,  JOF_ATOM|JOF_DECLARING)  OPDEF(JSOP_DEFVAR,    127,"defvar",     NULL,         3,  0,  0,  0,  JOF_ATOM|JOF_DECLARING)
330    
331  /* Auto-clone (if needed due to re-parenting) and push an anonymous function. */  /* Push a closure for a named or anonymous function expression. */
332  OPDEF(JSOP_ANONFUNOBJ,  128, "anonfunobj",  NULL,     3,  0,  1, 19,  JOF_OBJECT)  OPDEF(JSOP_LAMBDA,    128, "lambda",    NULL,         3,  0,  1, 19,  JOF_OBJECT)
333    
334  /* ECMA ed. 3 named function expression. */  /* Used for named function expression self-naming, if lightweight. */
335  OPDEF(JSOP_NAMEDFUNOBJ, 129, "namedfunobj", NULL,     3,  0,  1, 19,  JOF_OBJECT)  OPDEF(JSOP_CALLEE,    129, "callee",    NULL,         1,  0,  1, 19,  JOF_BYTE)
336    
337  /*  /*
338   * Like JSOP_SETLOCAL, but specialized to avoid requiring JSOP_POP immediately   * Like JSOP_SETLOCAL, but specialized to avoid requiring JSOP_POP immediately
# Line 317  Line 340 
340   */   */
341  OPDEF(JSOP_SETLOCALPOP, 130, "setlocalpop", NULL,     3,  1,  0,  3,  JOF_LOCAL|JOF_NAME|JOF_SET)  OPDEF(JSOP_SETLOCALPOP, 130, "setlocalpop", NULL,     3,  1,  0,  3,  JOF_LOCAL|JOF_NAME|JOF_SET)
342    
343  /* Parenthesization opcode to help the decompiler. */  /* Pick an element from the stack. */
344  OPDEF(JSOP_GROUP,       131, "group",       NULL,     1,  0,  0, 19,  JOF_BYTE)  OPDEF(JSOP_PICK,        131, "pick",      NULL,       2,  0,  0,  0,  JOF_UINT8)
   
 /*  
  * Host object extension: given 'o.item(i) = j', the left-hand side compiles  
  * JSOP_SETCALL, rather than JSOP_CALL.  
  */  
 OPDEF(JSOP_SETCALL,     132, "setcall",     NULL,     3, -1,  2, 18,  JOF_UINT16|JOF_SET)  
345    
346  /*  /*
347   * Exception handling no-op, for more economical byte-coding than SRC_TRYFIN   * Exception handling no-op, for more economical byte-coding than SRC_TRYFIN
348   * srcnote-annotated JSOP_NOPs and to simply stack balance handling.   * srcnote-annotated JSOP_NOPs and to simply stack balance handling.
349   */   */
350  OPDEF(JSOP_TRY,         133,"try",        NULL,       1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_TRY,         132,"try",        NULL,       1,  0,  0,  0,  JOF_BYTE)
351  OPDEF(JSOP_FINALLY,     134,"finally",    NULL,       1,  0,  2,  0,  JOF_BYTE)  OPDEF(JSOP_FINALLY,     133,"finally",    NULL,       1,  0,  2,  0,  JOF_BYTE)
352    
353  /*  /*
354   * Generic nop for the decompiler.   * Get a dynamic slot from an object known to have at least one greater than
355     * the slot index number of values at obj->dslots. The CALL variant computes
356     * the callee and this-object in preparation for a JSOP_CALL.
357   */   */
358  OPDEF(JSOP_NOP,         135,"nop",        NULL,       1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_GETDSLOT,    134,"getdslot",   NULL,       3,  0,  1, 19,  JOF_UINT16|JOF_NAME)
359    OPDEF(JSOP_CALLDSLOT,   135,"calldslot",  NULL,       3,  0,  2, 19,  JOF_UINT16|JOF_NAME|JOF_CALLOP)
360    
361  /*  /*
362   * Bytecodes that avoid making an arguments object in most cases:   * Bytecodes that avoid making an arguments object in most cases:
# Line 412  Line 432 
432  OPDEF(JSOP_XMLCOMMENT,    182,"xmlcomment", NULL,     3,  0,  1, 19,  JOF_ATOM)  OPDEF(JSOP_XMLCOMMENT,    182,"xmlcomment", NULL,     3,  0,  1, 19,  JOF_ATOM)
433  OPDEF(JSOP_XMLPI,         183,"xmlpi",      NULL,     3,  1,  1, 19,  JOF_ATOM)  OPDEF(JSOP_XMLPI,         183,"xmlpi",      NULL,     3,  1,  1, 19,  JOF_ATOM)
434  OPDEF(JSOP_CALLPROP,      184,"callprop",   NULL,     3,  1,  2, 18,  JOF_ATOM|JOF_PROP|JOF_CALLOP)  OPDEF(JSOP_CALLPROP,      184,"callprop",   NULL,     3,  1,  2, 18,  JOF_ATOM|JOF_PROP|JOF_CALLOP)
 OPDEF(JSOP_GETFUNNS,      185,"getfunns",   NULL,     1,  0,  1, 19,  JOF_BYTE)  
435    
436  /*  /*
437   * Get a display (free) variable from the closure's reserved slots.   * Get a display (free) variable from the closure's reserved slots.
438   */   */
439  OPDEF(JSOP_GETUPVAR,      186,"getupvar",   NULL,     3,  0,  1, 19,  JOF_UINT16|JOF_NAME)  OPDEF(JSOP_GETUPVAR,      185,"getupvar",   NULL,     3,  0,  1, 19,  JOF_UINT16|JOF_NAME)
440    OPDEF(JSOP_CALLUPVAR,     186,"callupvar",  NULL,     3,  0,  2, 19,  JOF_UINT16|JOF_NAME|JOF_CALLOP)
441    
442  OPDEF(JSOP_DELDESC,       187,"deldesc",    NULL,     1,  2,  1, 17,  JOF_BYTE |JOF_ELEM|JOF_DEL)  OPDEF(JSOP_DELDESC,       187,"deldesc",    NULL,     1,  2,  1, 15,  JOF_BYTE|JOF_ELEM|JOF_DEL)
443    
444  /*  /*
445   * Opcode to hold 24-bit immediate integer operands.   * Opcode to hold 24-bit immediate integer operands.
# Line 468  Line 488 
488   */   */
489  OPDEF(JSOP_ENTERBLOCK,    199,"enterblock",  NULL,    3,  0, -1,  0,  JOF_OBJECT)  OPDEF(JSOP_ENTERBLOCK,    199,"enterblock",  NULL,    3,  0, -1,  0,  JOF_OBJECT)
490  OPDEF(JSOP_LEAVEBLOCK,    200,"leaveblock",  NULL,    3, -1,  0,  0,  JOF_UINT16)  OPDEF(JSOP_LEAVEBLOCK,    200,"leaveblock",  NULL,    3, -1,  0,  0,  JOF_UINT16)
491  OPDEF(JSOP_UNUSED201,     201,"unused201",   NULL,    1,  0,  0,  0,  JOF_BYTE)  
492  OPDEF(JSOP_UNUSED202,     202,"unused202",   NULL,    1,  0,  0,  0,  JOF_BYTE)  /* Jump to target if top of stack value is of primitive type. */
493  OPDEF(JSOP_UNUSED203,     203,"unused203",   NULL,    1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_IFPRIMTOP,     201,"ifprimtop",   NULL,    3,  1,  1,  0,  JOF_JUMP|JOF_DETECTING)
494  OPDEF(JSOP_UNUSED204,     204,"unused204",   NULL,    1,  0,  0,  0,  JOF_BYTE)  
495  OPDEF(JSOP_UNUSED205,     205,"unused205",   NULL,    1,  0,  0,  0,  JOF_BYTE)  /* Throws a TypeError if the value at the top of the stack is not primitive. */
496  OPDEF(JSOP_UNUSED206,     206,"unused206",   NULL,    1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_PRIMTOP,       202,"primtop",     NULL,    2,  1,  1,  0,  JOF_INT8)
 OPDEF(JSOP_UNUSED207,     207,"unused207",   NULL,    1,  0,  0,  0,  JOF_BYTE)  
497    
498  /*  /*
499   * Iterator, generator, and array comprehension support.   * Generator and array comprehension support.
500   */   */
501  OPDEF(JSOP_FORCONST,      208,"forconst",    NULL,    3,  0,  1, 19,  JOF_LOCAL|JOF_NAME|JOF_FOR)  OPDEF(JSOP_GENERATOR,     203,"generator",   NULL,    1,  0,  0,  0,  JOF_BYTE)
502  OPDEF(JSOP_ENDITER,       209,"enditer",     NULL,    1,  1,  0,  0,  JOF_BYTE|JOF_TMPSLOT)  OPDEF(JSOP_YIELD,         204,"yield",       NULL,    1,  1,  1,  1,  JOF_BYTE)
503  OPDEF(JSOP_GENERATOR,     210,"generator",   NULL,    1,  0,  0,  0,  JOF_BYTE)  OPDEF(JSOP_ARRAYPUSH,     205,"arraypush",   NULL,    3,  1,  0,  3,  JOF_LOCAL)
 OPDEF(JSOP_YIELD,         211,"yield",       NULL,    1,  1,  1,  1,  JOF_BYTE)  
 OPDEF(JSOP_ARRAYPUSH,     212,"arraypush",   NULL,    3,  1,  0,  3,  JOF_LOCAL)  
504    
505  /*  /*
506   * In the forthcoming great opcode reorg, this should go next to JSOP_GETUPVAR.   * Get the built-in function::foo namespace and push it.
507   */   */
508  OPDEF(JSOP_CALLUPVAR,     213, "callupvar",  NULL,    3,  0,  2, 19,  JOF_UINT16|JOF_NAME|JOF_CALLOP)  OPDEF(JSOP_GETFUNNS,      206,"getfunns",   NULL,     1,  0,  1, 19,  JOF_BYTE)
509    
510  /*  /*
511   * Variant of JSOP_ENUMELEM for destructuring const (const [a, b] = ...).   * Variant of JSOP_ENUMELEM for destructuring const (const [a, b] = ...).
512   */   */
513  OPDEF(JSOP_ENUMCONSTELEM, 214,"enumconstelem",NULL,   1,  3,  0,  3,  JOF_BYTE|JOF_SET)  OPDEF(JSOP_ENUMCONSTELEM, 207,"enumconstelem",NULL,   1,  3,  0,  3,  JOF_BYTE|JOF_SET)
514    
515  /*  /*
516   * Variant of JSOP_LEAVEBLOCK has a result on the stack above the locals,   * Variant of JSOP_LEAVEBLOCK has a result on the stack above the locals,
517   * which must be moved down when the block pops.   * which must be moved down when the block pops.
518   */   */
519  OPDEF(JSOP_LEAVEBLOCKEXPR,215,"leaveblockexpr",NULL,  3, -1,  1,  1,  JOF_UINT16)  OPDEF(JSOP_LEAVEBLOCKEXPR,208,"leaveblockexpr",NULL,  3, -1,  1,  3,  JOF_UINT16)
520    
521  /*  /*
522   * Optimize common JSOP_{THIS,GET{ARG,LOCAL}} -> JSOP_GETPROP cliches.   * Optimize common JSOP_{THIS,GET{ARG,LOCAL}} -> JSOP_GETPROP cliches.
523   */   */
524  OPDEF(JSOP_GETTHISPROP,   216,"getthisprop",   NULL,  3,  0,  1, 18,  JOF_ATOM|JOF_VARPROP)  OPDEF(JSOP_GETTHISPROP,   209,"getthisprop",   NULL,  3,  0,  1, 18,  JOF_ATOM|JOF_VARPROP)
525  OPDEF(JSOP_GETARGPROP,    217,"getargprop",    NULL,  5,  0,  1, 18,  JOF_SLOTATOM|JOF_VARPROP)  OPDEF(JSOP_GETARGPROP,    210,"getargprop",    NULL,  5,  0,  1, 18,  JOF_SLOTATOM|JOF_VARPROP)
526  OPDEF(JSOP_GETLOCALPROP,  218,"getlocalprop",  NULL,  5,  0,  1, 18,  JOF_SLOTATOM|JOF_VARPROP)  OPDEF(JSOP_GETLOCALPROP,  211,"getlocalprop",  NULL,  5,  0,  1, 18,  JOF_SLOTATOM|JOF_VARPROP)
 OPDEF(JSOP_UNUSED219,     219,"unused219",     NULL,  1,  0,  0,  0,  JOF_BYTE)  
527    
528  /*  /*
529   * Optimize atom segments 1-3.  These must be followed by JSOP_RESETBASE0 after   * Optimize atom segments 1-3.  These must be followed by JSOP_RESETBASE0 after
530   * the opcode that they prefix.   * the opcode that they prefix.
531   */   */
532  OPDEF(JSOP_INDEXBASE1,    220,"atombase1",     NULL,  1,  0,  0,  0,  JOF_BYTE |JOF_INDEXBASE)  OPDEF(JSOP_INDEXBASE1,    212,"atombase1",     NULL,  1,  0,  0,  0,  JOF_BYTE |JOF_INDEXBASE)
533  OPDEF(JSOP_INDEXBASE2,    221,"atombase2",     NULL,  1,  0,  0,  0,  JOF_BYTE |JOF_INDEXBASE)  OPDEF(JSOP_INDEXBASE2,    213,"atombase2",     NULL,  1,  0,  0,  0,  JOF_BYTE |JOF_INDEXBASE)
534  OPDEF(JSOP_INDEXBASE3,    222,"atombase3",     NULL,  1,  0,  0,  0,  JOF_BYTE |JOF_INDEXBASE)  OPDEF(JSOP_INDEXBASE3,    214,"atombase3",     NULL,  1,  0,  0,  0,  JOF_BYTE |JOF_INDEXBASE)
535    
536  OPDEF(JSOP_CALLGVAR,      223, "callgvar",     NULL,  3,  0,  2, 19,  JOF_ATOM|JOF_NAME|JOF_CALLOP)  OPDEF(JSOP_CALLGVAR,      215, "callgvar",     NULL,  3,  0,  2, 19,  JOF_ATOM|JOF_NAME|JOF_CALLOP)
537  OPDEF(JSOP_CALLLOCAL,     224, "calllocal",    NULL,  3,  0,  2, 19,  JOF_LOCAL|JOF_NAME|JOF_CALLOP)  OPDEF(JSOP_CALLLOCAL,     216, "calllocal",    NULL,  3,  0,  2, 19,  JOF_LOCAL|JOF_NAME|JOF_CALLOP)
538  OPDEF(JSOP_CALLARG,       225, "callarg",      NULL,  3,  0,  2, 19,  JOF_QARG |JOF_NAME|JOF_CALLOP)  OPDEF(JSOP_CALLARG,       217, "callarg",      NULL,  3,  0,  2, 19,  JOF_QARG |JOF_NAME|JOF_CALLOP)
539  OPDEF(JSOP_UNUSED226,     226, "unused226",    NULL,  1,  0,  1,  1,  JOF_BYTE)  OPDEF(JSOP_CALLBUILTIN,   218, "callbuiltin",  NULL,  3,  1,  2,  0,  JOF_UINT16)
540    
541  /*  /*
542   * Opcodes to hold 8-bit and 32-bit immediate integer operands.   * Opcodes to hold 8-bit and 32-bit immediate integer operands.
543   */   */
544  OPDEF(JSOP_INT8,          227, "int8",         NULL,  2,  0,  1, 16,  JOF_INT8)  OPDEF(JSOP_INT8,          219, "int8",         NULL,  2,  0,  1, 16,  JOF_INT8)
545  OPDEF(JSOP_INT32,         228, "int32",        NULL,  5,  0,  1, 16,  JOF_INT32)  OPDEF(JSOP_INT32,         220, "int32",        NULL,  5,  0,  1, 16,  JOF_INT32)
546    
547  /*  /*
548   * Get the value of the 'length' property from a stacked object.   * Get the value of the 'length' property from a stacked object.
549   */   */
550  OPDEF(JSOP_LENGTH,        229, "length",       NULL,  1,  1,  1, 18,  JOF_BYTE|JOF_PROP)  OPDEF(JSOP_LENGTH,        221, "length",       NULL,  1,  1,  1, 18,  JOF_BYTE|JOF_PROP)
551    
552    /*
553     * Construct a new dense array whose contents are the values provided on the
554     * stack, consuming those values and replacing them with the newly-constructed
555     * array.  The topmost value is the last value in the new array, and the
556     * bottommost value is the first value in the array; the array length is a
557     * 16-bit immediate operand to the instruction.
558     */
559    OPDEF(JSOP_NEWARRAY,      222, "newarray",     NULL,  3, -1,  1, 19,  JOF_UINT16)
560    
561    /*
562     * Push a JSVAL_HOLE value onto the stack, representing an omitted property in
563     * an array literal (e.g. property 0 in the array [, 1]).  This opcode is used
564     * with the JSOP_NEWARRAY and JSOP_NEWINIT opcodes.
565     */
566    OPDEF(JSOP_HOLE,          223, "hole",         NULL,  1,  0,  1,  0,  JOF_BYTE)
567    
568    /*
569     * Variants of JSOP_{DEF{,LOCAL}FUN,LAMBDA} optimized for the flat closure case.
570     */
571    OPDEF(JSOP_DEFFUN_FC,     224,"deffun_fc",     NULL,  3,  0,  0,  0,  JOF_OBJECT|JOF_DECLARING)
572    OPDEF(JSOP_DEFLOCALFUN_FC,225,"deflocalfun_fc",NULL,  5,  0,  0,  0,  JOF_SLOTOBJECT|JOF_DECLARING)
573    OPDEF(JSOP_LAMBDA_FC,     226,"lambda_fc",     NULL,  3,  0,  1, 19,  JOF_OBJECT)
574    
575    /*
576     * Ensure that the value on the top of the stack is an object. The one
577     * argument is an error message, defined in js.msg, that takes one parameter
578     * (the decompilation of the primitive value).
579     */
580    OPDEF(JSOP_OBJTOP,        227,"objtop",        NULL,  3,  0,  0,  0,  JOF_UINT16)
581    
582    OPDEF(JSOP_LOOP,          228, "loop",         NULL,  1,  0,  0,  0,  JOF_BYTE)
583    
584  /*  /*
585   * JSOP_NEWARRAY optimizes array literal evaluation using the interpreter stack.   * Debugger versions of JSOP_{GET,CALL}UPVAR.
  * JSOP_HOLE pushes a JSVAL_HOLE (used with JSOP_NEWINIT and JSOP_NEWARRAY).  
586   */   */
587  OPDEF(JSOP_NEWARRAY,      230, "newarray",     NULL,  4, -1,  1, 19,  JOF_UINT24)  OPDEF(JSOP_GETUPVAR_DBG,  229,"getupvar_dbg",  NULL,  3,  0,  1, 19,  JOF_UINT16|JOF_NAME)
588  OPDEF(JSOP_HOLE,          231, "hole",         NULL,  1,  0,  1,  0,  JOF_BYTE)  OPDEF(JSOP_CALLUPVAR_DBG, 230,"callupvar_dbg", NULL,  3,  0,  2, 19,  JOF_UINT16|JOF_NAME|JOF_CALLOP)
589    OPDEF(JSOP_DEFFUN_DBGFC,     231,"deffun_dbgfc",     NULL,  3,  0,  0,  0,  JOF_OBJECT|JOF_DECLARING)
590    OPDEF(JSOP_DEFLOCALFUN_DBGFC,232,"deflocalfun_dbgfc",NULL,  5,  0,  0,  0,  JOF_SLOTOBJECT|JOF_DECLARING)
591    OPDEF(JSOP_LAMBDA_DBGFC,     233,"lambda_dbgfc",     NULL,  3,  0,  1, 19,  JOF_OBJECT)

Legend:
Removed from v.332  
changed lines
  Added in v.460

  ViewVC Help
Powered by ViewVC 1.1.24