Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Bytecode Descriptions

Bytecode Listing

This document is automatically generated from Opcodes.h by make_opcode_doc.py.

Statements

Jumps

JSOP_AND [-1, +1] (JUMP, DETECTING, LEFTASSOC)
Value69 (0x45)
Operandsint32_t offset
Length5
Stack Usescond
Stack Defscond

Converts the top of stack value into a boolean, if the result is false, jumps to a 32-bit offset from the current bytecode.

JSOP_GOTO [-0, +0] (JUMP)
Value6 (0x06)
Operandsint32_t offset
Length5
Stack Uses 
Stack Defs 

Jumps to a 32-bit offset from the current bytecode.

JSOP_IFEQ [-1, +0] (JUMP, DETECTING)
Value7 (0x07)
Operandsint32_t offset
Length5
Stack Usescond
Stack Defs 

Pops the top of stack value, converts it into a boolean, if the result is false, jumps to a 32-bit offset from the current bytecode.

The idea is that a sequence like JSOP_ZERO; JSOP_ZERO; JSOP_EQ; JSOP_IFEQ; JSOP_RETURN; reads like a nice linear sequence that will execute the return.

JSOP_IFNE [-1, +0] (JUMP)
Value8 (0x08)
Operandsint32_t offset
Length5
Stack Usescond
Stack Defs 

Pops the top of stack value, converts it into a boolean, if the result is true, jumps to a 32-bit offset from the current bytecode.

JSOP_LABEL [-0, +0] (JUMP)
Value106 (0x6a)
Operandsint32_t offset
Length5
Stack Uses 
Stack Defs 

This opcode precedes every labeled statement. It's a no-op.

offset is the offset to the next instruction after this statement, the one break LABEL; would jump to. IonMonkey uses this.

JSOP_LOOPENTRY [-0, +0] (UINT8)
Value227 (0xe3)
Operandsuint8_t BITFIELD
Length2
Stack Uses 
Stack Defs 

This opcode is the target of the entry jump for some loop. The uint8 argument is a bitfield. The lower 7 bits of the argument indicate the loop depth. This value starts at 1 and is just a hint: deeply nested loops all have the same value. The upper bit is set if Ion should be able to OSR at this point, which is true unless there is non-loop state on the stack.

JSOP_LOOPHEAD [-0, +0]
Value109 (0x6d)
Operands 
Length1
Stack Uses 
Stack Defs 

Another no-op.

This opcode is the target of the backwards jump for some loop.

JSOP_OR [-1, +1] (JUMP, DETECTING, LEFTASSOC)
Value68 (0x44)
Operandsint32_t offset
Length5
Stack Usescond
Stack Defscond

Converts the top of stack value into a boolean, if the result is true, jumps to a 32-bit offset from the current bytecode.

Switch Statement

JSOP_CASE [-2, +1] (JUMP)
Value121 (0x79)
Operandsint32_t offset
Length5
Stack Useslval, rval
Stack Defslval(if lval !== rval)

Pops the top two values on the stack as rval and lval, compare them with ===, if the result is true, jumps to a 32-bit offset from the current bytecode, re-pushes lval onto the stack if false.

JSOP_CONDSWITCH [-0, +0]
Value120 (0x78)
Operands 
Length1
Stack Uses 
Stack Defs 

This no-op appears after the bytecode for EXPR in switch (EXPR) {...} if the switch cannot be optimized using JSOP_TABLESWITCH. For a non-optimized switch statement like this:

   switch (EXPR) {
     case V0:
       C0;
     ...
     default:
       D;
   }

the bytecode looks like this:

   (EXPR)
   condswitch
   (V0)
   case ->C0
   ...
   default ->D
   (C0)
   ...
   (D)

Note that code for all case-labels is emitted first, then code for the body of each case clause.

JSOP_DEFAULT [-1, +0] (JUMP)
Value122 (0x7a)
Operandsint32_t offset
Length5
Stack Useslval
Stack Defs 

This appears after all cases in a JSOP_CONDSWITCH, whether there is a default: label in the switch statement or not. Pop the switch operand from the stack and jump to a 32-bit offset from the current bytecode. offset from the current bytecode.

JSOP_TABLESWITCH [-1, +0] (TABLESWITCH, DETECTING)
Value70 (0x46)
Operandsint32_t len, int32_t low, int32_t high,int32_t offset[0], ..., int32_t offset[high-low]
Lengthlen
Stack Usesi
Stack Defs 

Pops the top of stack value as i, if low <= i <= high, jumps to a 32-bit offset: offset[i - low] from the current bytecode, jumps to a 32-bit offset: len from the current bytecode if not.

This opcode has variable length.

For-In Statement

JSOP_ENDITER [-1, +0]
Value78 (0x4e)
Operands 
Length1
Stack Usesiter
Stack Defs 

Exits a for-in loop by popping the iterator object from the stack and closing it.

JSOP_ISNOITER [-1, +2]
Value77 (0x4d)
Operands 
Length1
Stack Usesval
Stack Defsval, res

Pushes a boolean indicating whether the value on top of the stack is MagicValue(JS_NO_ITER_VALUE).

JSOP_ITER [-1, +1] (UINT8)
Value75 (0x4b)
Operandsuint8_t flags
Length2
Stack Usesval
Stack Defsiter

Sets up a for-in or for-each-in loop using the JSITER_* flag bits in this op's uint8_t immediate operand. It pops the top of stack value as val and pushes iter which is an iterator for val.

JSOP_MOREITER [-1, +2]
Value76 (0x4c)
Operands 
Length1
Stack Usesiter
Stack Defsiter, val

Pushes the next iterated value onto the stack. If no value is available, MagicValue(JS_NO_ITER_VALUE) is pushed.

With Statement

JSOP_ENTERWITH [-1, +0] (SCOPE)
Value3 (0x03)
Operandsuint32_t staticWithIndex
Length5
Stack Usesval
Stack Defs 

Pops the top of stack value, converts it to an object, and adds a WithEnvironmentObject wrapping that object to the scope chain.

There is a matching JSOP_LEAVEWITH instruction later. All name lookups between the two that may need to consult the With object are deoptimized.

JSOP_LEAVEWITH [-0, +0]
Value4 (0x04)
Operands 
Length1
Stack Uses 
Stack Defs 

Pops the scope chain object pushed by JSOP_ENTERWITH.

Exception Handling

JSOP_EXCEPTION [-0, +1]
Value118 (0x76)
Operands 
Length1
Stack Uses 
Stack Defsexception

Pushes the current pending exception onto the stack and clears the pending exception. This is only emitted at the beginning of code for a catch-block, so it is known that an exception is pending. It is used to implement catch-blocks and yield*.

JSOP_FINALLY [-0, +2]
Value135 (0x87)
Operands 
Length1
Stack Uses 
Stack Defsfalse, (next bytecode's PC)

This opcode has a def count of 2, but these values are already on the stack (they're pushed by JSOP_GOSUB).

JSOP_GOSUB [-0, +0] (JUMP)
Value116 (0x74)
Operandsint32_t offset
Length5
Stack Uses 
Stack Defsfalse, (next bytecode's PC)

Pushes false and next bytecode's PC onto the stack, and jumps to a 32-bit offset from the current bytecode.

This opcode is used for entering finally block.

JSOP_RETSUB [-2, +0]
Value117 (0x75)
Operands 
Length1
Stack Useslval, rval
Stack Defs 

Pops the top two values on the stack as rval and lval, converts lval into a boolean, raises error if the result is true, jumps to a 32-bit absolute PC: rval if false.

This opcode is used for returning from finally block.

JSOP_THROW [-1, +0]
Value112 (0x70)
Operands 
Length1
Stack Usesv
Stack Defs 

Pops the top of stack value as v, sets pending exception as v, then raises error.

JSOP_THROWING [-1, +0]
Value151 (0x97)
Operands 
Length1
Stack Usesv
Stack Defs 

Pops the top of stack value as v, sets pending exception as v, to trigger rethrow.

This opcode is used in conditional catch clauses.

JSOP_THROWMSG [-0, +0] (UINT16)
Value74 (0x4a)
Operandsuint16_t msgNumber
Length3
Stack Uses 
Stack Defs 

Sometimes we know when emitting that an operation will always throw.

Throws the indicated JSMSG.

JSOP_TRY [-0, +0]
Value134 (0x86)
Operands 
Length1
Stack Uses 
Stack Defs 

This no-op appears at the top of the bytecode for a TryStatement.

Location information for catch/finally blocks is stored in a side table, script->trynotes().

Function

JSOP_CALL [-(argc+2), +1] (UINT16, INVOKE, TYPESET)
Value58 (0x3a)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1]
Stack Defsrval

Invokes callee with this and args, pushes return value onto the stack.

JSOP_CALLITER [-2, +1] (UINT16, INVOKE, TYPESET)
Value145 (0x91)
Operandsuint16_t argc (must be 0)
Length3
Stack Usescallee, this
Stack Defsrval

Like JSOP_CALL, but used as part of for-of and destructuring bytecode to provide better error messages.

JSOP_EVAL [-(argc+2), +1] (UINT16, INVOKE, TYPESET, CHECKSLOPPY)
Value123 (0x7b)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1]
Stack Defsrval

Invokes eval with args and pushes return value onto the stack.

If eval in global scope is not original one, invokes the function with this and args, and pushes return value onto the stack.

JSOP_FUNAPPLY [-(argc+2), +1] (UINT16, INVOKE, TYPESET)
Value79 (0x4f)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1]
Stack Defsrval

Invokes callee with this and args, pushes return value onto the stack.

This is for f.apply.

JSOP_FUNCALL [-(argc+2), +1] (UINT16, INVOKE, TYPESET)
Value108 (0x6c)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1]
Stack Defsrval

Invokes callee with this and args, pushes return value onto the stack.

If callee is determined to be the canonical Function.prototype.call function, then this operation is optimized to directly call callee with args[0] as this, and the remaining arguments as formal args to callee.

Like JSOP_FUNAPPLY but for f.call instead of f.apply.

JSOP_FUNWITHPROTO [-1, +1] (OBJECT)
Value52 (0x34)
Operandsuint32_t funcIndex
Length5
Stack Usesproto
Stack Defsobj

Pushes a clone of a function with a given [[Prototype]] onto the stack.

JSOP_GETRVAL [-0, +1]
Value2 (0x02)
Operands 
Length1
Stack Uses 
Stack Defsrval

Pushes stack frame's rval onto the stack.

JSOP_LAMBDA [-0, +1] (OBJECT)
Value130 (0x82)
Operandsuint32_t funcIndex
Length5
Stack Uses 
Stack Defsobj

Pushes a closure for a named or anonymous function expression onto the stack.

JSOP_LAMBDA_ARROW [-1, +1] (OBJECT)
Value131 (0x83)
Operandsuint32_t funcIndex
Length5
Stack Usesnew.target
Stack Defsobj

Pops the top of stack value as new.target, pushes an arrow function with lexical new.target onto the stack.

JSOP_NEW [-(argc+3), +1] (UINT16, INVOKE, TYPESET)
Value82 (0x52)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1], newTarget
Stack Defsrval

Invokes callee as a constructor with this and args, pushes return value onto the stack.

JSOP_OPTIMIZE_SPREADCALL [-1, +2]
Value178 (0xb2)
Operands 
Length1
Stack Usesarr
Stack Defsarr optimized

Pops the top stack value, pushes the value and a boolean value that indicates whether the spread operation for the value can be optimized in spread call.

JSOP_RETRVAL [-0, +0]
Value153 (0x99)
Operands 
Length1
Stack Uses 
Stack Defs 

Stops interpretation and returns value set by JSOP_SETRVAL. When not set, returns undefined.

Also emitted at end of script so interpreter don't need to check if opcode is still in script range.

JSOP_RETURN [-1, +0]
Value5 (0x05)
Operands 
Length1
Stack Usesrval
Stack Defs 

Pops the top of stack value as rval, stops interpretation of current script and returns rval.

JSOP_RUNONCE [-0, +0]
Value71 (0x47)
Operands 
Length1
Stack Uses 
Stack Defs 

Prologue emitted in scripts expected to run once, which deoptimizes code if it executes multiple times.

JSOP_SETRVAL [-1, +0]
Value152 (0x98)
Operands 
Length1
Stack Usesrval
Stack Defs 

Pops the top of stack value as rval, sets the return value in stack frame as rval.

JSOP_SPREADCALL [-3, +1] (INVOKE, TYPESET)
Value41 (0x29)
Operands 
Length1
Stack Usescallee, this, args
Stack Defsrval

spreadcall variant of JSOP_CALL.

Invokes callee with this and args, pushes the return value onto the stack.

args is an Array object which contains actual arguments.

JSOP_SPREADEVAL [-3, +1] (INVOKE, TYPESET, CHECKSLOPPY)
Value43 (0x2b)
Operands 
Length1
Stack Usescallee, this, args
Stack Defsrval

spreadcall variant of JSOP_EVAL

Invokes eval with args and pushes the return value onto the stack.

If eval in global scope is not original one, invokes the function with this and args, and pushes return value onto the stack.

JSOP_SPREADNEW [-4, +1] (INVOKE, TYPESET)
Value42 (0x2a)
Operands 
Length1
Stack Usescallee, this, args, newTarget
Stack Defsrval

spreadcall variant of JSOP_NEW

Invokes callee as a constructor with this and args, pushes the return value onto the stack.

JSOP_SPREADSUPERCALL [-4, +1] (INVOKE, TYPESET)
Value166 (0xa6)
Operands 
Length1
Stack Usescallee, this, args, newTarget
Stack Defsrval

spreadcall variant of JSOP_SUPERCALL.

Behaves exactly like JSOP_SPREADNEW.

JSOP_STRICTEVAL [-(argc+2), +1] (UINT16, INVOKE, TYPESET, CHECKSTRICT)
Value124 (0x7c)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1]
Stack Defsrval

Invokes eval with args and pushes return value onto the stack.

If eval in global scope is not original one, invokes the function with this and args, and pushes return value onto the stack.

JSOP_STRICTSPREADEVAL [-3, +1] (INVOKE, TYPESET, CHECKSTRICT)
Value50 (0x32)
Operands 
Length1
Stack Usescallee, this, args
Stack Defsrval

spreadcall variant of JSOP_EVAL

Invokes eval with args and pushes the return value onto the stack.

If eval in global scope is not original one, invokes the function with this and args, and pushes return value onto the stack.

JSOP_SUPERCALL [-(argc+3), +1] (UINT16, INVOKE, TYPESET)
Value165 (0xa5)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1], newTarget
Stack Defsrval

Behaves exactly like JSOP_NEW, but allows JITs to distinguish the two cases.

Generator

JSOP_CHECKISOBJ [-1, +1] (UINT8)
Value14 (0x0e)
Operandsuint8_t kind
Length2
Stack Usesresult
Stack Defsresult

Checks that the top value on the stack is an object, and throws a TypeError if not. The operand kind is used only to generate an appropriate error message.

JSOP_FINALYIELDRVAL [-1, +0]
Value204 (0xcc)
Operands 
Length1
Stack Usesgen
Stack Defs 

Pops the generator and suspends and closes it. Yields the value in the frame's return value slot.

JSOP_GENERATOR [-0, +1]
Value212 (0xd4)
Operands 
Length1
Stack Uses 
Stack Defsgenerator

Initializes generator frame, creates a generator and pushes it on the stack.

JSOP_INITIALYIELD [-1, +1] (UINT24)
Value202 (0xca)
Operandsuint24_t yieldIndex
Length4
Stack Usesgenerator
Stack Defs 

Pops the generator from the top of the stack, suspends it and stops interpretation.

JSOP_RESUME [-2, +1] (UINT8, INVOKE)
Value205 (0xcd)
Operandsresume kind (GeneratorObject::ResumeKind)
Length3
Stack Usesgen, val
Stack Defsrval

Pops the generator and argument from the stack, pushes a new generator frame and resumes execution of it. Pushes the return value after the generator yields.

JSOP_YIELD [-2, +1] (UINT24)
Value203 (0xcb)
Operandsuint24_t yieldIndex
Length4
Stack Usesrval1, gen
Stack Defsrval2

Pops the generator and the return value rval1, stops interpretation and returns rval1. Pushes sent value from send() onto the stack.

Debugger

JSOP_DEBUGGER [-0, +0]
Value115 (0x73)
Operands 
Length1
Stack Uses 
Stack Defs 

Invokes debugger.

JSOP_DEBUGLEAVELEXICALENV [-0, +0]
Value201 (0xc9)
Operands 
Length1
Stack Uses 
Stack Defs 

The opcode to assist the debugger.

Variables and Scopes

Variables

JSOP_BINDNAME [-0, +1] (ATOM, NAME, SET)
Value110 (0x6e)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsscope

Looks up name on the scope chain and pushes the scope which contains the name onto the stack. If not found, pushes global scope onto the stack.

JSOP_DEFCONST [-0, +0] (ATOM)
Value128 (0x80)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defs 
Defines the new constant binding on global lexical scope.

Throws if a binding with the same name already exists on the scope, or if a var binding with the same name exists on the global.

JSOP_DEFFUN [-1, +0]
Value127 (0x7f)
Operands 
Length1
Stack Usesfun
Stack Defs 

Defines the given function on the current scope.

This is used for global scripts and also in some cases for function scripts where use of dynamic scoping inhibits optimization.

JSOP_DEFLET [-0, +0] (ATOM)
Value162 (0xa2)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defs 
Defines the new mutable binding on global lexical scope.

Throws if a binding with the same name already exists on the scope, or if a var binding with the same name exists on the global.

JSOP_DEFVAR [-0, +0] (ATOM)
Value129 (0x81)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defs 

Defines the new binding on the frame's current variables-object (the scope object on the scope chain designated to receive new variables).

Throws if the current variables-object is the global object and a binding with the same name exists on the global lexical scope.

This is used for global scripts and also in some cases for function scripts where use of dynamic scoping inhibits optimization.

JSOP_DELNAME [-0, +1] (ATOM, NAME, CHECKSLOPPY)
Value36 (0x24)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defssucceeded

Looks up name on the scope chain and deletes it, pushes true onto the stack if succeeded (if the property was present and deleted or if the property wasn't present in the first place), false if not.

Strict mode code should never contain this opcode.

JSOP_GETIMPORT [-0, +1] (ATOM, NAME, TYPESET)
Value176 (0xb0)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsval

Gets the value of a module import by name and pushes it onto the stack.

JSOP_GETNAME [-0, +1] (ATOM, NAME, TYPESET)
Value59 (0x3b)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsval

Looks up name on the scope chain and pushes its value onto the stack.

JSOP_SETNAME [-2, +1] (ATOM, NAME, SET, DETECTING, CHECKSLOPPY)
Value111 (0x6f)
Operandsuint32_t nameIndex
Length5
Stack Usesscope, val
Stack Defsval

Pops a scope and value from the stack, assigns value to the given name, and pushes the value back on the stack

JSOP_STRICTSETNAME [-2, +1] (ATOM, NAME, SET, DETECTING, CHECKSTRICT)
Value49 (0x31)
Operandsuint32_t nameIndex
Length5
Stack Usesscope, val
Stack Defsval

Pops a scope and value from the stack, assigns value to the given name, and pushes the value back on the stack. If the set failed, then throw a TypeError, per usual strict mode semantics.

Free Variables

JSOP_BINDGNAME [-0, +1] (ATOM, NAME, SET, GNAME)
Value214 (0xd6)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsglobal

Pushes the global scope onto the stack if the script doesn't have a non-syntactic global scope. Otherwise will act like JSOP_BINDNAME.

nameIndex is only used when acting like JSOP_BINDNAME.

JSOP_BINDVAR [-0, +1]
Value213 (0xd5)
Operands 
Length1
Stack Uses 
Stack Defsscope

Pushes the nearest var environment.

JSOP_GETGNAME [-0, +1] (ATOM, NAME, TYPESET, GNAME)
Value154 (0x9a)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsval

Looks up name on global scope and pushes its value onto the stack, unless the script has a non-syntactic global scope, in which case it acts just like JSOP_NAME.

Free variable references that must either be found on the global or a ReferenceError.

JSOP_INITGLEXICAL [-1, +1] (ATOM, NAME, SET, GNAME)
Value161 (0xa1)
Operandsuint32_t nameIndex
Length5
Stack Usesval
Stack Defsval

Initializes an uninitialized global lexical binding with the top of stack value.

JSOP_SETGNAME [-2, +1] (ATOM, NAME, SET, DETECTING, GNAME, CHECKSLOPPY)
Value155 (0x9b)
Operandsuint32_t nameIndex
Length5
Stack Usesscope, val
Stack Defsval

Pops the top two values on the stack as val and scope, sets property of scope as val and pushes val back on the stack.

scope should be the global scope unless the script has a non-syntactic global scope, in which case acts like JSOP_SETNAME.

JSOP_STRICTSETGNAME [-2, +1] (ATOM, NAME, SET, DETECTING, GNAME, CHECKSTRICT)
Value156 (0x9c)
Operandsuint32_t nameIndex
Length5
Stack Usesscope, val
Stack Defsval

Pops the top two values on the stack as val and scope, sets property of scope as val and pushes val back on the stack. Throws a TypeError if the set fails, per strict mode semantics.

scope should be the global scope unless the script has a non-syntactic global scope, in which case acts like JSOP_STRICTSETNAME.

Local Variables

JSOP_CHECKLEXICAL [-0, +0] (LOCAL, NAME)
Value138 (0x8a)
Operandsuint32_t localno
Length4
Stack Uses 
Stack Defs 

Checks if the value of the local variable is the JS_UNINITIALIZED_LEXICAL magic, throwing an error if so.

JSOP_GETLOCAL [-0, +1] (LOCAL, NAME)
Value86 (0x56)
Operandsuint32_t localno
Length4
Stack Uses 
Stack Defsval

Pushes the value of local variable onto the stack.

JSOP_INITLEXICAL [-1, +1] (LOCAL, NAME, SET, DETECTING)
Value139 (0x8b)
Operandsuint32_t localno
Length4
Stack Usesv
Stack Defsv

Initializes an uninitialized local lexical binding with the top of stack value.

JSOP_SETLOCAL [-1, +1] (LOCAL, NAME, SET, DETECTING)
Value87 (0x57)
Operandsuint32_t localno
Length4
Stack Usesv
Stack Defsv

Stores the top stack value to the given local.

JSOP_THROWSETCALLEE [-1, +1] (SET)
Value179 (0xb3)
Operands 
Length1
Stack Uses 
Stack Defs 

Throws a runtime TypeError for invalid assignment to the callee in a named lambda, which is always a const binding. This is a different bytecode than JSOP_SETCONST because the named lambda callee, if not closed over, does not have a frame slot to look up the name with for the error message.

JSOP_THROWSETCONST [-1, +1] (LOCAL, NAME, SET, DETECTING)
Value169 (0xa9)
Operandsuint32_t localno
Length4
Stack Uses 
Stack Defs 

Throws a runtime TypeError for invalid assignment to const. The localno is used for better error messages.

Aliased Variables

JSOP_CHECKALIASEDLEXICAL [-0, +0] (ENVCOORD, NAME)
Value140 (0x8c)
Operandsuint8_t hops, uint24_t slot
Length5
Stack Uses 
Stack Defs 

Checks if the value of the aliased variable is the JS_UNINITIALIZED_LEXICAL magic, throwing an error if so.

JSOP_GETALIASEDVAR [-0, +1] (ENVCOORD, NAME, TYPESET)
Value136 (0x88)
Operandsuint8_t hops, uint24_t slot
Length5
Stack Uses 
Stack DefsaliasedVar

Pushes aliased variable onto the stack.

An "aliased variable" is a var, let, or formal arg that is aliased. Sources of aliasing include: nested functions accessing the vars of an enclosing function, function statements that are conditionally executed, eval, with, and arguments. All of these cases require creating a CallObject to own the aliased variable.

An ALIASEDVAR opcode contains the following immediates:

uint8 hops:  the number of scope objects to skip to find the ScopeObject
             containing the variable being accessed
uint24 slot: the slot containing the variable in the ScopeObject (this
             'slot' does not include RESERVED_SLOTS).
JSOP_INITALIASEDLEXICAL [-1, +1] (ENVCOORD, NAME, SET, DETECTING)
Value141 (0x8d)
Operandsuint8_t hops, uint24_t slot
Length5
Stack Usesv
Stack Defsv

Initializes an uninitialized aliased lexical binding with the top of stack value.

JSOP_SETALIASEDVAR [-1, +1] (ENVCOORD, NAME, SET, DETECTING)
Value137 (0x89)
Operandsuint8_t hops, uint24_t slot
Length5
Stack Usesv
Stack Defsv

Sets aliased variable as the top of stack value.

JSOP_THROWSETALIASEDCONST [-1, +1] (ENVCOORD, NAME, SET, DETECTING)
Value170 (0xaa)
Operandsuint8_t hops, uint24_t slot
Length5
Stack Uses 
Stack Defs 

Throws a runtime TypeError for invalid assignment to const. The scope coordinate is used for better error messages.

Intrinsics

JSOP_GETINTRINSIC [-0, +1] (ATOM, NAME, TYPESET)
Value143 (0x8f)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsintrinsic[name]
Pushes the value of the intrinsic onto the stack.

Intrinsic names are emitted instead of JSOP_*NAME ops when the CompileOptions flag selfHostingMode is set.

They are used in self-hosted code to access other self-hosted values and intrinsic functions the runtime doesn't give client JS code access to.

JSOP_SETINTRINSIC [-1, +1] (ATOM, NAME, SET, DETECTING)
Value144 (0x90)
Operandsuint32_t nameIndex
Length5
Stack Usesval
Stack Defsval

Stores the top stack value in the specified intrinsic.

Block-local Scope

JSOP_FRESHENLEXICALENV [-0, +0]
Value197 (0xc5)
Operands 
Length1
Stack Uses 
Stack Defs 

Replaces the current block on the env chain with a fresh block that copies all the bindings in the bock. This operation implements the behavior of inducing a fresh lexical environment for every iteration of a for(let ...; ...; ...) loop, if any declarations induced by such a loop are captured within the loop.

JSOP_POPLEXICALENV [-0, +0]
Value200 (0xc8)
Operands 
Length1
Stack Uses 
Stack Defs 

Pops lexical environment from the env chain.

JSOP_PUSHLEXICALENV [-0, +0] (SCOPE)
Value199 (0xc7)
Operandsuint32_t scopeIndex
Length5
Stack Uses 
Stack Defs 

Pushes lexical environment onto the env chain.

JSOP_RECREATELEXICALENV [-0, +0]
Value198 (0xc6)
Operands 
Length1
Stack Uses 
Stack Defs 

Recreates the current block on the env chain with a fresh block with uninitialized bindings. This operation implements the behavior of inducing a fresh lexical environment for every iteration of a for-in/of loop whose loop-head has a (captured) lexical declaration.

This

JSOP_CHECKRETURN [-1, +0]
Value190 (0xbe)
Operands 
Length1
Stack Usesthis
Stack Defs 

Check if a derived class constructor has a valid return value and this value before it returns. If the return value is not an object, stores the this value to the return value slot.

JSOP_CHECKTHIS [-1, +1]
Value189 (0xbd)
Operands 
Length1
Stack Usesthis
Stack Defsthis

Throw if the value on top of the stack is the TDZ MagicValue. Used in derived class constructors.

JSOP_CHECKTHISREINIT [-1, +1]
Value191 (0xbf)
Operands 
Length1
Stack Usesthis
Stack Defsthis

Throw an exception if the value on top of the stack is not the TDZ MagicValue. Used in derived class constructors.

JSOP_FUNCTIONTHIS [-0, +1]
Value185 (0xb9)
Operands 
Length1
Stack Uses 
Stack Defsthis

Determines the this value for current function frame and pushes it onto the stack. Emitted in the prologue of functions with a this-binding.

JSOP_GIMPLICITTHIS [-0, +1] (ATOM)
Value157 (0x9d)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsthis

Pushes the implicit this value for calls to the associated name onto the stack; only used when we know this implicit this will be our first non-syntactic scope.

JSOP_GLOBALTHIS [-0, +1]
Value186 (0xba)
Operands 
Length1
Stack Uses 
Stack Defsthis

Pushes this value for current stack frame onto the stack. Emitted when this refers to the global this.

JSOP_IMPLICITTHIS [-0, +1] (ATOM)
Value226 (0xe2)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsthis

Pushes the implicit this value for calls to the associated name onto the stack.

Super

JSOP_SUPERBASE [-0, +1]
Value103 (0x67)
Operands 
Length1
Stack Uses 
Stack DefshomeObjectProto

Pushes the prototype of the home object for current callee onto the stack.

JSOP_SUPERFUN [-0, +1]
Value164 (0xa4)
Operands 
Length1
Stack Uses 
Stack DefssuperFun

Find the function to invoke with |super()| on the scope chain.

Arguments

JSOP_ARGUMENTS [-0, +1]
Value9 (0x09)
Operands 
Length1
Stack Uses 
Stack Defsarguments

Pushes the arguments object for the current function activation.

If JSScript is not marked needsArgsObj, then a JS_OPTIMIZED_ARGUMENTS magic value is pushed. Otherwise, a proper arguments object is constructed and pushed.

This opcode requires that the function does not have rest parameter.

JSOP_CALLEE [-0, +1]
Value132 (0x84)
Operands 
Length1
Stack Uses 
Stack Defscallee

Pushes current callee onto the stack.

Used for named function expression self-naming, if lightweight.

JSOP_GETARG [-0, +1] (QARG , NAME)
Value84 (0x54)
Operandsuint16_t argno
Length3
Stack Uses 
Stack Defsarguments[argno]

Fast get op for function arguments and local variables.

Pushes arguments[argno] onto the stack.

JSOP_NEWTARGET [-0, +1]
Value148 (0x94)
Operands 
Length1
Stack Uses 
Stack Defsnew.target

Push "new.target"

JSOP_REST [-0, +1] (TYPESET)
Value224 (0xe0)
Operands 
Length1
Stack Uses 
Stack Defsrest

Creates rest parameter array for current function call, and pushes it onto the stack.

JSOP_SETARG [-1, +1] (QARG , NAME, SET)
Value85 (0x55)
Operandsuint16_t argno
Length3
Stack Usesv
Stack Defsv

Fast set op for function arguments and local variables.

Sets arguments[argno] as the top of stack value.

Var Scope

JSOP_POPVARENV [-0, +0]
Value181 (0xb5)
Operands 
Length1
Stack Uses 
Stack Defs 

Pops a var environment from the env chain.

JSOP_PUSHVARENV [-0, +0] (SCOPE)
Value180 (0xb4)
Operandsuint32_t scopeIndex
Length5
Stack Uses 
Stack Defs 

Pushes a var environment onto the env chain.

Operators

Comparison Operators

JSOP_EQ [-2, +1] (LEFTASSOC, ARITH, DETECTING)
JSOP_GE [-2, +1] (LEFTASSOC, ARITH)
JSOP_GT [-2, +1] (LEFTASSOC, ARITH)
JSOP_LE [-2, +1] (LEFTASSOC, ARITH)
JSOP_LT [-2, +1] (LEFTASSOC, ARITH)
JSOP_NE [-2, +1] (LEFTASSOC, ARITH, DETECTING)
ValueJSOP_EQ: 18 (0x12)
JSOP_GE: 23 (0x17)
JSOP_GT: 22 (0x16)
JSOP_LE: 21 (0x15)
JSOP_LT: 20 (0x14)
JSOP_NE: 19 (0x13)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval OP rval)

Pops the top two values from the stack and pushes the result of comparing them.

JSOP_STRICTEQ [-2, +1] (DETECTING, LEFTASSOC, ARITH)
JSOP_STRICTNE [-2, +1] (DETECTING, LEFTASSOC, ARITH)
ValueJSOP_STRICTEQ: 72 (0x48)
JSOP_STRICTNE: 73 (0x49)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval OP rval)

Pops the top two values from the stack, then pushes the result of applying the operator to the two values.

Arithmetic Operators

JSOP_ADD [-2, +1] (LEFTASSOC, ARITH)
Value27 (0x1b)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval + rval)

Pops the top two values lval and rval from the stack, then pushes the result of lval + rval.

JSOP_DIV [-2, +1] (LEFTASSOC, ARITH)
JSOP_MOD [-2, +1] (LEFTASSOC, ARITH)
JSOP_MUL [-2, +1] (LEFTASSOC, ARITH)
JSOP_SUB [-2, +1] (LEFTASSOC, ARITH)
ValueJSOP_DIV: 30 (0x1e)
JSOP_MOD: 31 (0x1f)
JSOP_MUL: 29 (0x1d)
JSOP_SUB: 28 (0x1c)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval OP rval)

Pops the top two values lval and rval from the stack, then pushes the result of applying the arithmetic operation to them.

JSOP_NEG [-1, +1] (ARITH)
Value34 (0x22)
Operands 
Length1
Stack Usesval
Stack Defs(-val)

Pops the value val from the stack, then pushes -val.

JSOP_POS [-1, +1] (ARITH)
Value35 (0x23)
Operands 
Length1
Stack Usesval
Stack Defs(+val)

Pops the value val from the stack, then pushes +val. (+val is the value converted to a number.)

JSOP_POW [-2, +1] (ARITH)
Value150 (0x96)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval ** rval)

Pops the top two values lval and rval from the stack, then pushes the result of Math.pow(lval, rval).

Bitwise Logical Operators

JSOP_BITAND [-2, +1] (LEFTASSOC, ARITH)
JSOP_BITOR [-2, +1] (LEFTASSOC, ARITH)
JSOP_BITXOR [-2, +1] (LEFTASSOC, ARITH)
ValueJSOP_BITAND: 17 (0x11)
JSOP_BITOR: 15 (0x0f)
JSOP_BITXOR: 16 (0x10)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval OP rval)

Pops the top two values lval and rval from the stack, then pushes the result of the operation applied to the two operands, converting both to 32-bit signed integers if necessary.

JSOP_BITNOT [-1, +1] (ARITH)
Value33 (0x21)
Operands 
Length1
Stack Usesval
Stack Defs(~val)

Pops the value val from the stack, then pushes ~val.

Bitwise Shift Operators

JSOP_LSH [-2, +1] (LEFTASSOC, ARITH)
JSOP_RSH [-2, +1] (LEFTASSOC, ARITH)
ValueJSOP_LSH: 24 (0x18)
JSOP_RSH: 25 (0x19)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval OP rval)

Pops the top two values lval and rval from the stack, then pushes the result of the operation applied to the operands.

JSOP_URSH [-2, +1] (LEFTASSOC, ARITH)
Value26 (0x1a)
Operands 
Length1
Stack Useslval, rval
Stack Defs(lval >>> rval)

Pops the top two values lval and rval from the stack, then pushes lval >>> rval.

Logical Operators

JSOP_NOT [-1, +1] (ARITH, DETECTING)
Value32 (0x20)
Operands 
Length1
Stack Usesval
Stack Defs(!val)

Pops the value val from the stack, then pushes !val.

Special Operators

JSOP_DELELEM [-2, +1] (BYTE , ELEM, CHECKSLOPPY)
Value38 (0x26)
Operands 
Length1
Stack Usesobj, propval
Stack Defssucceeded

Pops the top two values on the stack as propval and obj, deletes propval property from obj, pushes true onto the stack if succeeded, false if not.

JSOP_DELPROP [-1, +1] (ATOM, PROP, CHECKSLOPPY)
Value37 (0x25)
Operandsuint32_t nameIndex
Length5
Stack Usesobj
Stack Defssucceeded

Pops the top of stack value, deletes property from it, pushes true onto the stack if succeeded, false if not.

JSOP_IN [-2, +1] (LEFTASSOC)
Value113 (0x71)
Operands 
Length1
Stack Usesid, obj
Stack Defs(id in obj)

Pops the top two values id and obj from the stack, then pushes id in obj. This will throw a TypeError if obj is not an object.

Note that obj is the top value.

JSOP_INSTANCEOF [-2, +1] (LEFTASSOC)
Value114 (0x72)
Operands 
Length1
Stack Usesobj, ctor
Stack Defs(obj instanceof ctor)

Pops the top two values obj and ctor from the stack, then pushes obj instanceof ctor. This will throw a TypeError if obj is not an object.

JSOP_STRICTDELPROP [-1, +1] (ATOM, PROP, CHECKSTRICT)
Value46 (0x2e)
Operandsuint32_t nameIndex
Length5
Stack Usesobj
Stack Defssucceeded

Pops the top of stack value and attempts to delete the given property from it. Pushes true onto success, else throws a TypeError per strict mode property-deletion requirements.

JSOP_TYPEOF [-1, +1] (DETECTING)
Value39 (0x27)
Operands 
Length1
Stack Usesval
Stack Defs(typeof val)

Pops the value val from the stack, then pushes typeof val.

JSOP_TYPEOFEXPR [-1, +1] (DETECTING)
Value196 (0xc4)
Operands 
Length1
Stack Usesval
Stack Defs(typeof val)

Pops the top stack value as val and pushes typeof val. Note that this opcode isn't used when, in the original source code, val is a name -- see JSOP_TYPEOF for that. (This is because typeof undefinedName === "undefined".)

JSOP_VOID [-1, +1]
Value40 (0x28)
Operands 
Length1
Stack Usesval
Stack Defsundefined

Pops the top value on the stack and pushes undefined.

Stack Operations

JSOP_DUP [-1, +2]
Value12 (0x0c)
Operands 
Length1
Stack Usesv
Stack Defsv, v

Pushes a copy of the top value on the stack.

JSOP_DUP2 [-2, +4]
Value13 (0x0d)
Operands 
Length1
Stack Usesv1, v2
Stack Defsv1, v2, v1, v2

Duplicates the top two values on the stack.

JSOP_DUPAT [-0, +1] (UINT24)
Value44 (0x2c)
Operandsuint24_t n
Length4
Stack Usesv[n], v[n-1], ..., v[1], v[0]
Stack Defsv[n], v[n-1], ..., v[1], v[0], v[n]

Duplicates the Nth value from the top onto the stack.

JSOP_PICK [-0, +0] (UINT8)
Value133 (0x85)
Operandsuint8_t n
Length2
Stack Usesv[n], v[n-1], ..., v[1], v[0]
Stack Defsv[n-1], ..., v[1], v[0], v[n]

Picks the nth element from the stack and moves it to the top of the stack.

JSOP_POP [-1, +0]
Value81 (0x51)
Operands 
Length1
Stack Usesv
Stack Defs 

Pops the top value off the stack.

JSOP_POPN [-n, +0] (UINT16)
Value11 (0x0b)
Operandsuint16_t n
Length3
Stack Usesv[n-1], ..., v[1], v[0]
Stack Defs 

Pops the top n values from the stack.

JSOP_SWAP [-2, +2]
Value10 (0x0a)
Operands 
Length1
Stack Usesv1, v2
Stack Defsv2, v1

Swaps the top two values on the stack. This is useful for things like post-increment/decrement.

Debugger

JSOP_DEBUGAFTERYIELD [-0, +0]
Value208 (0xd0)
Operands 
Length1
Stack Uses 
Stack Defs 

Bytecode emitted after yield expressions to help the Debugger fix up the frame in the JITs. No-op in the interpreter.

Literals

Constants

JSOP_DOUBLE [-0, +1] (DOUBLE)
Value60 (0x3c)
Operandsuint32_t constIndex
Length5
Stack Uses 
Stack Defsval

Pushes numeric constant onto the stack.

JSOP_FALSE [-0, +1]
JSOP_TRUE [-0, +1]
ValueJSOP_FALSE: 66 (0x42)
JSOP_TRUE: 67 (0x43)
Operands 
Length1
Stack Uses 
Stack Defstrue/false

Pushes boolean value onto the stack.

JSOP_INT32 [-0, +1] (INT32)
Value216 (0xd8)
Operandsint32_t val
Length5
Stack Uses 
Stack Defsval

Pushes 32-bit int immediate integer operand onto the stack.

JSOP_INT8 [-0, +1] (INT8)
Value215 (0xd7)
Operandsint8_t val
Length2
Stack Uses 
Stack Defsval

Pushes 8-bit int immediate integer operand onto the stack.

JSOP_IS_CONSTRUCTING [-0, +1]
Value65 (0x41)
Operands 
Length1
Stack Uses 
Stack DefsJS_IS_CONSTRUCTING

Pushes JS_IS_CONSTRUCTING

JSOP_NULL [-0, +1]
Value64 (0x40)
Operands 
Length1
Stack Uses 
Stack Defsnull

Pushes null onto the stack.

JSOP_ONE [-0, +1]
Value63 (0x3f)
Operands 
Length1
Stack Uses 
Stack Defs1

Pushes 1 onto the stack.

JSOP_STRING [-0, +1] (ATOM)
Value61 (0x3d)
Operandsuint32_t atomIndex
Length5
Stack Uses 
Stack Defsstring

Pushes string constant onto the stack.

JSOP_SYMBOL [-0, +1] (UINT8)
Value45 (0x2d)
Operandsuint8_t n, the JS::SymbolCode of the symbol to use
Length2
Stack Uses 
Stack Defssymbol

Push a well-known symbol onto the operand stack.

JSOP_UINT16 [-0, +1] (UINT16)
Value88 (0x58)
Operandsuint16_t val
Length3
Stack Uses 
Stack Defsval

Pushes unsigned 16-bit int immediate integer operand onto the stack.

JSOP_UINT24 [-0, +1] (UINT24)
Value188 (0xbc)
Operandsuint24_t val
Length4
Stack Uses 
Stack Defsval

Pushes unsigned 24-bit int immediate integer operand onto the stack.

JSOP_UNDEFINED [-0, +1]
Value1 (0x01)
Operands 
Length1
Stack Uses 
Stack Defsundefined

Pushes undefined onto the stack.

JSOP_UNINITIALIZED [-0, +1]
Value142 (0x8e)
Operands 
Length1
Stack Uses 
Stack Defsuninitialized

Pushes a JS_UNINITIALIZED_LEXICAL value onto the stack, representing an uninitialized lexical binding.

This opcode is used with the JSOP_INITLET opcode.

JSOP_ZERO [-0, +1]
Value62 (0x3e)
Operands 
Length1
Stack Uses 
Stack Defs0

Pushes 0 onto the stack.

Object

JSOP_CALLELEM [-2, +1] (BYTE , ELEM, TYPESET, LEFTASSOC)
Value193 (0xc1)
Operands 
Length1
Stack Usesobj, propval
Stack Defsobj[propval]

Pops the top two values on the stack as propval and obj, pushes propval property of obj onto the stack.

Like JSOP_GETELEM but for call context.

JSOP_CALLPROP [-1, +1] (ATOM, PROP, TYPESET)
Value184 (0xb8)
Operandsuint32_t nameIndex
Length5
Stack Usesobj
Stack Defsobj[name]

Pops the top of stack value, pushes property of it onto the stack.

Like JSOP_GETPROP but for call context.

JSOP_CALLSITEOBJ [-0, +1] (OBJECT)
Value101 (0x65)
Operandsuint32_t objectIndex
Length5
Stack Uses 
Stack Defsobj

Pushes the call site object specified by objectIndex onto the stack. Defines the raw property specified by objectIndex + 1 on the call site object and freezes both the call site object as well as its raw property.

JSOP_CHECKOBJCOERCIBLE [-1, +1]
Value163 (0xa3)
Operands 
Length1
Stack Usesval
Stack Defsval

Throw if the value on the stack is not coerscible to an object (is |null| or |undefined|).

JSOP_CLASSHERITAGE [-1, +2]
Value51 (0x33)
Operands 
Length1
Stack Usesheritage
Stack DefsfuncProto, objProto

Writes the [[Prototype]] objects for both a class and its .prototype to the stack, given the result of a heritage expression.

JSOP_GETELEM [-2, +1] (BYTE , ELEM, TYPESET, LEFTASSOC)
Value55 (0x37)
Operands 
Length1
Stack Usesobj, propval
Stack Defsobj[propval]

Pops the top two values on the stack as propval and obj, pushes propval property of obj onto the stack.

JSOP_GETELEM_SUPER [-3, +1] (BYTE , ELEM, LEFTASSOC)
Value125 (0x7d)
Operands 
Length1
Stack Usesreceiver, obj, propval
Stack Defsobj[propval]

LIKE JSOP_GETELEM but takes receiver on stack, and the propval is evaluated before the obj.

JSOP_GETPROP [-1, +1] (ATOM, PROP, TYPESET)
Value53 (0x35)
Operandsuint32_t nameIndex
Length5
Stack Usesobj
Stack Defsobj[name]

Pops the top of stack value, pushes property of it onto the stack.

JSOP_GETPROP_SUPER [-2, +1] (ATOM, PROP)
Value104 (0x68)
Operandsuint32_t nameIndex
Length5
Stack Usesreceiver obj
Stack Defsobj[name]

Pops the top two values, and pushes the property of one, using the other as the receiver.

JSOP_GETXPROP [-1, +1] (ATOM, PROP, TYPESET)
Value195 (0xc3)
Operandsuint32_t nameIndex
Length5
Stack Usesobj
Stack Defsobj[name]

Pops the top of stack value, gets an extant property value of it, throwing ReferenceError if the identified property does not exist.

JSOP_INITELEM [-3, +1] (ELEM, SET, DETECTING)
Value94 (0x5e)
Operands 
Length1
Stack Usesobj, id, val
Stack Defsobj

Initialize a numeric property in an object literal, like {1: x}.

Pops the top three values on the stack as val, id and obj, defines id property of obj as val, pushes obj onto the stack.

JSOP_INITELEM_GETTER [-3, +1] (ELEM, SET, DETECTING)
Value99 (0x63)
Operands 
Length1
Stack Usesobj, id, val
Stack Defsobj

Initialize a numeric getter in an object literal like {get 2() {}}.

Pops the top three values on the stack as val, id and obj, defines id getter of obj as val, pushes obj onto the stack.

JSOP_INITELEM_SETTER [-3, +1] (ELEM, SET, DETECTING)
Value100 (0x64)
Operands 
Length1
Stack Usesobj, id, val
Stack Defsobj

Initialize a numeric setter in an object literal like {set 2(v) {}}.

Pops the top three values on the stack as val, id and obj, defines id setter of obj as val, pushes obj onto the stack.

JSOP_INITHIDDENELEM [-3, +1] (ELEM, SET, DETECTING)
Value175 (0xaf)
Operands 
Length1
Stack Usesobj, id, val
Stack Defsobj

Initialize a non-enumerable numeric property in an object literal, like {1: x}.

Pops the top three values on the stack as val, id and obj, defines id property of obj as val, pushes obj onto the stack.

JSOP_INITHIDDENELEM_GETTER [-3, +1] (ELEM, SET, DETECTING)
Value173 (0xad)
Operands 
Length1
Stack Usesobj, id, val
Stack Defsobj

Initialize a non-enumerable numeric getter in an object literal like {get 2() {}}.

Pops the top three values on the stack as val, id and obj, defines id getter of obj as val, pushes obj onto the stack.

JSOP_INITHIDDENELEM_SETTER [-3, +1] (ELEM, SET, DETECTING)
Value174 (0xae)
Operands 
Length1
Stack Usesobj, id, val
Stack Defsobj

Initialize a non-enumerable numeric setter in an object literal like {set 2(v) {}}.

Pops the top three values on the stack as val, id and obj, defines id setter of obj as val, pushes obj onto the stack.

JSOP_INITHIDDENPROP [-2, +1] (ATOM, PROP, SET, DETECTING)
Value147 (0x93)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsobj

Initialize a non-enumerable data-property on an object.

Pops the top two values on the stack as val and obj, defines nameIndex property of obj as val, pushes obj onto the stack.

JSOP_INITHIDDENPROP_GETTER [-2, +1] (ATOM, PROP, SET, DETECTING)
Value171 (0xab)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsobj

Initialize a non-enumerable getter in an object literal.

Pops the top two values on the stack as val and obj, defines getter of obj as val, pushes obj onto the stack.

JSOP_INITHIDDENPROP_SETTER [-2, +1] (ATOM, PROP, SET, DETECTING)
Value172 (0xac)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsobj

Initialize a non-enumerable setter in an object literal.

Pops the top two values on the stack as val and obj, defines setter of obj as val, pushes obj onto the stack.

JSOP_INITHOMEOBJECT [-2, +2] (UINT8)
Value92 (0x5c)
Operandsuint8_t n
Length2
Stack UseshomeObject, [...n], fun
Stack DefshomeObject, [...n], fun

Initialize the home object for functions with super bindings.

This opcode takes the function and the object to be the home object, does the set, and leaves both on the stack.

JSOP_INITLOCKEDPROP [-2, +1] (ATOM, PROP, SET, DETECTING)
Value146 (0x92)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsobj

Initialize a non-configurable, non-writable, non-enumerable data-property on an object.

Pops the top two values on the stack as val and obj, defines nameIndex property of obj as val, pushes obj onto the stack.

JSOP_INITPROP [-2, +1] (ATOM, PROP, SET, DETECTING)
Value93 (0x5d)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsobj

Initialize a named property in an object literal, like {a: x}.

Pops the top two values on the stack as val and obj, defines nameIndex property of obj as val, pushes obj onto the stack.

JSOP_INITPROP_GETTER [-2, +1] (ATOM, PROP, SET, DETECTING)
Value97 (0x61)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsobj

Initialize a getter in an object literal.

Pops the top two values on the stack as val and obj, defines getter of obj as val, pushes obj onto the stack.

JSOP_INITPROP_SETTER [-2, +1] (ATOM, PROP, SET, DETECTING)
Value98 (0x62)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsobj

Initialize a setter in an object literal.

Pops the top two values on the stack as val and obj, defines setter of obj as val, pushes obj onto the stack.

JSOP_MUTATEPROTO [-2, +1]
Value194 (0xc2)
Operands 
Length1
Stack Usesobj, newProto
Stack Defssucceeded

__proto__: v inside an object initializer.

Pops the top two values on the stack as newProto and obj, sets prototype of obj as newProto, pushes true onto the stack if succeeded, false if not.

JSOP_NEWINIT [-0, +1] (UINT8)
Value89 (0x59)
Operandsuint8_t kind (, uint24_t extra)
Length5
Stack Uses 
Stack Defsobj

Pushes newly created object onto the stack.

This opcode takes the kind of initializer (JSProto_Array or JSProto_Object).

This opcode has three extra bytes so it can be exchanged with JSOP_NEWOBJECT during emit.

JSOP_NEWOBJECT [-0, +1] (OBJECT)
Value91 (0x5b)
Operandsuint32_t baseobjIndex
Length5
Stack Uses 
Stack Defsobj

Pushes newly created object onto the stack.

This opcode takes an object with the final shape, which can be set at the start and slots then filled in directly.

JSOP_OBJECT [-0, +1] (OBJECT)
Value80 (0x50)
Operandsuint32_t objectIndex
Length5
Stack Uses 
Stack Defsobj

Pushes deep-cloned object literal or singleton onto the stack.

JSOP_OBJWITHPROTO [-1, +1]
Value83 (0x53)
Operands 
Length1
Stack Usesproto
Stack Defsobj

Pushes newly created object onto the stack with provided [[Prototype]].

JSOP_SETELEM [-3, +1] (BYTE , ELEM, SET, DETECTING, CHECKSLOPPY)
Value56 (0x38)
Operands 
Length1
Stack Usesobj, propval, val
Stack Defsval

Pops the top three values on the stack as val, propval and obj, sets propval property of obj as val, pushes obj onto the stack.

JSOP_SETELEM_SUPER [-4, +1] (BYTE , ELEM, SET, DETECTING, CHECKSLOPPY)
Value158 (0x9e)
Operands 
Length1
Stack Usespropval, receiver, obj, val
Stack Defsval

LIKE JSOP_SETELEM, but takes receiver on the stack, and the propval is evaluated before the base.

JSOP_SETPROP [-2, +1] (ATOM, PROP, SET, DETECTING, CHECKSLOPPY)
Value54 (0x36)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsval

Pops the top two values on the stack as val and obj and performs obj.prop = val, pushing val back onto the stack.

JSOP_SETPROP_SUPER [-3, +1] (ATOM, PROP, SET, DETECTING, CHECKSLOPPY)
Value107 (0x6b)
Operandsuint32_t nameIndex
Length5
Stack Usesreceiver, obj, val
Stack Defsval

Pops the top three values on the stack as val, obj and receiver, and performs obj.prop = val, pushing val back onto the stack.

JSOP_STRICTDELELEM [-2, +1] (ELEM, CHECKSTRICT)
Value47 (0x2f)
Operands 
Length1
Stack Usesobj, propval
Stack Defssucceeded

Pops the top two values on the stack as propval and obj, and attempts to delete propval property from obj. Pushes true onto the stack on success, else throws a TypeError per strict mode property deletion requirements.

JSOP_STRICTSETELEM [-3, +1] (BYTE , ELEM, SET, DETECTING, CHECKSTRICT)
Value57 (0x39)
Operands 
Length1
Stack Usesobj, propval, val
Stack Defsval

Pops the top three values on the stack as val, propval and obj, sets propval property of obj as val, pushes obj onto the stack. Throws a TypeError if the set fails, per strict mode semantics.

JSOP_STRICTSETELEM_SUPER [-4, +1] (BYTE , ELEM, SET, DETECTING, CHECKSTRICT)
Value159 (0x9f)
Operands 
Length1
Stack Usespropval, receiver, obj, val
Stack Defsval

LIKE JSOP_STRICTSETELEM, but takes receiver on the stack, and the propval is evaluated before the base.

JSOP_STRICTSETPROP [-2, +1] (ATOM, PROP, SET, DETECTING, CHECKSTRICT)
Value48 (0x30)
Operandsuint32_t nameIndex
Length5
Stack Usesobj, val
Stack Defsval

Pops the top two values on the stack as val and obj, and performs obj.prop = val, pushing val back onto the stack. Throws a TypeError if the set-operation failed (per strict mode semantics).

JSOP_STRICTSETPROP_SUPER [-3, +1] (ATOM, PROP, SET, DETECTING, CHECKSTRICT)
Value105 (0x69)
Operandsuint32_t nameIndex
Length5
Stack Usesreceiver, obj, val
Stack Defsval

Pops the top three values on the stack as val and obj, and receiver, and performs obj.prop = val, pushing val back onto the stack. Throws a TypeError if the set-operation failed (per strict mode semantics).

JSOP_TOID [-1, +1]
Value225 (0xe1)
Operands 
Length1
Stack UsespropertyNameValue
Stack DefspropertyKey

Replace the top-of-stack value propertyNameValue with ToPropertyKey(propertyNameValue).

Array

JSOP_ARRAYPUSH [-2, +0]
Value206 (0xce)
Operands 
Length1
Stack Usesv, obj
Stack Defs 

Pops the top two values on the stack as obj and v, pushes v to obj.

This opcode is used for Array Comprehension.

JSOP_HOLE [-0, +1]
Value218 (0xda)
Operands 
Length1
Stack Uses 
Stack Defshole

Pushes a JS_ELEMENTS_HOLE value onto the stack, representing an omitted property in an array literal (e.g. property 0 in the array [, 1]).

This opcode is used with the JSOP_NEWARRAY opcode.

JSOP_INITELEM_ARRAY [-2, +1] (UINT32, ELEM, SET, DETECTING)
Value96 (0x60)
Operandsuint32_t index
Length5
Stack Usesobj, val
Stack Defsobj

Initialize an array element.

Pops the top two values on the stack as val and obj, sets index property of obj as val, pushes obj onto the stack.

JSOP_INITELEM_INC [-3, +2] (ELEM, SET)
Value95 (0x5f)
Operands 
Length1
Stack Usesobj, index, val
Stack Defsobj, (index + 1)

Pops the top three values on the stack as val, index and obj, sets index property of obj as val, pushes obj and index + 1 onto the stack.

This opcode is used in Array literals with spread and spreadcall arguments.

JSOP_LENGTH [-1, +1] (ATOM, PROP, TYPESET)
Value217 (0xd9)
Operandsuint32_t nameIndex
Length5
Stack Usesobj
Stack Defsobj['length']

Pops the top of stack value, pushes the length property of it onto the stack.

JSOP_NEWARRAY [-0, +1] (UINT32)
Value90 (0x5a)
Operandsuint32_t length
Length5
Stack Uses 
Stack Defsobj

Pushes newly created array onto the stack.

This opcode takes the final length, which is preallocated.

JSOP_NEWARRAY_COPYONWRITE [-0, +1] (OBJECT)
Value102 (0x66)
Operandsuint32_t objectIndex
Length5
Stack Uses 
Stack Defsobj

Pushes a newly created array onto the stack, whose elements are the same as that of a template object's copy on write elements.

JSOP_SPREADCALLARRAY [-0, +1] (UINT32)
Value126 (0x7e)
Operandsuint32_t length
Length5
Stack Uses 
Stack Defsobj

Pushes newly created array for a spread call onto the stack. This has the same semantics as JSOP_NEWARRAY, but is distinguished to avoid using unboxed arrays in spread calls, which would make compiling spread calls in baseline more complex.

RegExp

JSOP_REGEXP [-0, +1] (REGEXP)
Value160 (0xa0)
Operandsuint32_t regexpIndex
Length5
Stack Uses 
Stack Defsregexp

Pushes a regular expression literal onto the stack. It requires special "clone on exec" handling.

Class

JSOP_CLASSCONSTRUCTOR [-0, +1] (ATOM)
Value167 (0xa7)
Operandsatom className
Length5
Stack Uses 
Stack Defsconstructor

Push a default constructor for a base class literal.

JSOP_DERIVEDCONSTRUCTOR [-1, +1] (ATOM)
Value168 (0xa8)
Operandsatom className
Length5
Stack Uses 
Stack Defsconstructor

Push a default constructor for a derived class literal.

Other

JSOP_DEBUGCHECKSELFHOSTED [-1, +1]
Value177 (0xb1)
Operands 
Length1
Stack UsescheckVal
Stack DefscheckVal

Examines the top stack value, asserting that it's either a self-hosted function or a self-hosted intrinsic. This opcode does nothing in a non-debug build.

JSOP_FORCEINTERPRETER [-0, +0]
Value207 (0xcf)
Operands 
Length1
Stack Uses 
Stack Defs 

No-op bytecode only emitted in some self-hosted functions. Not handled by the JITs so the script always runs in the interpreter.

JSOP_JUMPTARGET [-0, +0]
Value230 (0xe6)
Operands 
Length1
Stack Uses 
Stack Defs 

This opcode is a no-op and it indicates the location of a jump instruction target. Some other opcodes act as jump targets, such as LOOPENTRY, as well as all which are matched by BytecodeIsJumpTarget function.

JSOP_LINENO [-0, +0] (UINT32)
Value119 (0x77)
Operandsuint32_t lineno
Length5
Stack Uses 
Stack Defs 

Embedded lineno to speedup pc->line mapping.

JSOP_NOP [-0, +0]
Value0 (0x00)
Operands 
Length1
Stack Uses 
Stack Defs 

No operation is performed.

JSOP_NOP_DESTRUCTURING [-0, +0]
Value229 (0xe5)
Operands 
Length1
Stack Uses 
Stack Defs 

No-op used by the decompiler to produce nicer error messages about destructuring code.

JSOP_TOSTRING [-1, +1]
Value228 (0xe4)
Operands 
Length1
Stack Usesval
Stack DefsToString(val)

Converts the value on the top of the stack to a String

Document Tags and Contributors

Tags: 
 Contributors to this page: arai, teoli, h4writer, fscholz, evilpie, guptha, Waldo, cdleary
 Last updated by: arai,