From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../spidermonkey/internals/bytecode/index.html | 6855 ++++++++++++++++++++ 1 file changed, 6855 insertions(+) create mode 100644 files/ja/mozilla/projects/spidermonkey/internals/bytecode/index.html (limited to 'files/ja/mozilla/projects/spidermonkey/internals/bytecode/index.html') diff --git a/files/ja/mozilla/projects/spidermonkey/internals/bytecode/index.html b/files/ja/mozilla/projects/spidermonkey/internals/bytecode/index.html new file mode 100644 index 0000000000..f4e65a7748 --- /dev/null +++ b/files/ja/mozilla/projects/spidermonkey/internals/bytecode/index.html @@ -0,0 +1,6855 @@ +--- +title: バイトコードの説明 +slug: Mozilla/Projects/SpiderMonkey/Internals/Bytecode +tags: + - SpiderMonkey +translation_of: Mozilla/Projects/SpiderMonkey/Internals/Bytecode +--- +
{{SpiderMonkeySidebar("Internals")}}
+ +

バイトコード一覧

+ +

この文書は make_opcode_doc.py によって Opcodes.h から自動的に生成されます。

+ +

ステートメント

+ +

Jumps

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

スタックの先頭の値をブール値に変換し、結果が false の場合、現在のバイトコードから 32-bit のオフセットにジャンプします。

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

現在のバイトコードから 32-bit のオフセットにジャンプします。

+
+
JSOP_IFEQ [-1, +0] (JUMP, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (CODE_OFFSET)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (LOOPENTRY, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value227 (0xe3)
Operandsuint32_t icIndex, uint8_t BITFIELD
Length6
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. See JSOP_JUMPTARGET for the icIndex argument.

+
+
JSOP_LOOPHEAD [-0, +0] (ICINDEX)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value109 (0x6d)
Operandsuint32_t icIndex
Length5
Stack Uses 
Stack Defs 
+ +

Another no-op.

+ +

This opcode is the target of the backwards jump for some loop. See JSOP_JUMPTARGET for the icIndex operand.

+
+
JSOP_OR [-1, +1] (JUMP, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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 Usesval, cond
Stack Defsval(if !cond)
+ +

Pops the top two values on the stack as val and cond. If cond is true, jumps to a 32-bit offset from the current bytecode, re-pushes val 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,uint24_t firstResumeIndex
Lengthlen
Stack Usesi
Stack Defs 
+ +

Pops the top of stack value as i, if low <= i <= high, jumps to a 32-bit offset: offset is stored in the script's resumeOffsets

+ +
                         list at index 'firstResumeIndex + (i - low)'
+
+ +

jumps to a 32-bit offset: len from the current bytecode otherwise

+
+
+ +

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_ISGENCLOSING [-1, +2]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value187 (0xbb)
Operands 
Length1
Stack Usesval
Stack Defsval, res
+ +

Pushes a boolean indicating whether the top of the stack is MagicValue(JS_GENERATOR_CLOSING).

+
+
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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value75 (0x4b)
Operands 
Length1
Stack Usesval
Stack Defsiter
+ +

Sets up a for-in loop. 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 environment 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 environment 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, resumeIndex
+ +

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

+
+
JSOP_GOSUB [-2, +0] (JUMP)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value116 (0x74)
Operandsint32_t offset
Length5
Stack Usesfalse, resumeIndex
Stack Defs 
+ +

This opcode is used for entering a finally block. Jumps to a 32-bit offset from the current pc.

+ +

Note: this op doesn't actually push/pop any values, but it has a use count of 2 (for the false + resumeIndex values pushed by preceding bytecode ops) because the finally entry point does not expect these values on the stack. See also JSOP_FINALLY (it has a def count of 2).

+ +

When the execution resumes from finally block, those stack values are popped.

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

This opcode is used for returning from a finally block.

+ +

Pops the top two values on the stack as rval and lval. Then: - If lval is true, throws rval. - If lval is false, jumps to the resumeIndex stored in lval.

+
+
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_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] (ARGC, INVOKE, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ARGC, INVOKE, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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_CALL_IGNORES_RV [-(argc+2), +1] (ARGC, INVOKE, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value231 (0xe7)
Operandsuint16_t argc
Length3
Stack Usescallee, this, args[0], ..., args[argc-1]
Stack Defsrval
+ +

Like JSOP_CALL, but tells the function that the return value is ignored. stack.

+
+
JSOP_CHECKISCALLABLE [-1, +1] (UINT8)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value219 (0xdb)
Operandsuint8_t kind
Length2
Stack Usesobj
Stack Defsobj
+ +

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

+
+
JSOP_EVAL [-(argc+2), +1] (ARGC, INVOKE, TYPESET, CHECKSLOPPY, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ARGC, INVOKE, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ARGC, INVOKE, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ARGC, INVOKE, TYPESET, IC, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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_SETFUNNAME [-2, +1] (UINT8)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value182 (0xb6)
Operandsuint8_t prefixKind
Length2
Stack Usesfun, name
Stack Defsfun
+ +

Pops the top two values on the stack as name and fun, defines the name of fun to name with prefix if any, and pushes fun back onto the stack.

+
+
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ARGC, INVOKE, TYPESET, CHECKSTRICT, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ARGC, INVOKE, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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.

+
+
JSOP_TRYSKIPAWAIT [-1, +2]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value223 (0xdf)
Operands 
Length1
Stack Usesvalue
Stack Defsvalue_or_resolved, canskip
+ +

Pops the top of stack value as value, checks if the await for value can be skipped. If the await operation can be skipped and the resolution value for value can be acquired, pushes the resolution value and true onto the stack. Otherwise, pushes value and false on the stack.

+
+
+ +

Generator

+ +
+
JSOP_ASYNCAWAIT [-2, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value151 (0x97)
Operands 
Length1
Stack Usesvalue, gen
Stack Defspromise
+ +

Pops the top two values value and gen from the stack, then starts "awaiting" for value to be resolved, which will then resume the execution of gen. Pushes the async function promise on the stack, so that it'll be returned to the caller on the very first "await".

+
+
JSOP_ASYNCRESOLVE [-2, +1] (UINT8)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value192 (0xc0)
Operandsuint8_t fulfillOrReject
Length2
Stack UsesvalueOrReason, gen
Stack Defspromise
+ +

Pops the top two values valueOrReason and gen from the stack, then pushes the promise resolved with valueOrReason. `gen` must be the internal generator object created in async functions. The pushed promise is the async function's result promise, which is stored in `gen`.

+
+
JSOP_AWAIT [-2, +1] (RESUMEINDEX)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value209 (0xd1)
Operandsuint24_t resumeIndex
Length4
Stack Usespromise, gen
Stack Defsresolved
+ +

Pops the generator and the return value promise, stops interpretation and returns promise. Pushes resolved value onto the stack.

+
+
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] (RESUMEINDEX)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value202 (0xca)
Operandsuint24_t resumeIndex
Length4
Stack Usesgenerator
Stack Defsgenerator
+ +

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

+
+
JSOP_RESUME [-2, +1] (UINT8, INVOKE)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value205 (0xcd)
Operandsresume kind (AbstractGeneratorObject::ResumeKind)
Length2
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_TOASYNCITER [-2, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value210 (0xd2)
Operands 
Length1
Stack Usesiter, next
Stack Defsasynciter
+ +

Pops the iterator and its next method from the top of the stack, and create async iterator from it and push the async iterator back onto the stack.

+
+
JSOP_YIELD [-2, +1] (RESUMEINDEX)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value203 (0xcb)
Operandsuint24_t resumeIndex
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value110 (0x6e)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsenv
+ +

Looks up name on the environment chain and pushes the environment which contains the name onto the stack. If not found, pushes global lexical environment 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 environment.

+ +

Throws if a binding with the same name already exists on the environment, 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 environment.

+ +

Throws if a binding with the same name already exists on the environment, 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 environment on the environment 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 environment.

+ +

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 environment 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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value59 (0x3b)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsval
+ +

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

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

Pops an environment 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, PROPSET, DETECTING, CHECKSTRICT, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value49 (0x31)
Operandsuint32_t nameIndex
Length5
Stack Usesenv, val
Stack Defsval
+ +

Pops a environment 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, GNAME, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value214 (0xd6)
Operandsuint32_t nameIndex
Length5
Stack Uses 
Stack Defsglobal
+ +

Pushes the global environment 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 Defsenv
+ +

Pushes the nearest var environment.

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

Looks up name on global environment 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, PROPINIT, GNAME, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPSET, DETECTING, GNAME, CHECKSLOPPY, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value155 (0x9b)
Operandsuint32_t nameIndex
Length5
Stack Usesenv, val
Stack Defsval
+ +

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

+ +

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

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

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

+ +

env should be the global lexical environment 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)
Operandsuint24_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)
Operandsuint24_t localno
Length4
Stack Uses 
Stack Defsval
+ +

Pushes the value of local variable onto the stack.

+
+
JSOP_INITLEXICAL [-1, +1] (LOCAL, NAME, DETECTING)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value139 (0x8b)
Operandsuint24_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, DETECTING)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value87 (0x57)
Operandsuint24_t localno
Length4
Stack Usesv
Stack Defsv
+ +

Stores the top stack value to the given local.

+
+
JSOP_THROWSETCALLEE [-1, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value179 (0xb3)
Operands 
Length1
Stack Usesv
Stack Defsv
+ +

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, DETECTING)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value169 (0xa9)
Operandsuint24_t localno
Length4
Stack Usesv
Stack Defsv
+ +

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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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 environment objects to skip to find the
+             EnvironmentObject containing the variable being accessed
+uint24 slot: the slot containing the variable in the EnvironmentObject
+             (this 'slot' does not include RESERVED_SLOTS).
+
+
+
JSOP_INITALIASEDLEXICAL [-1, +1] (ENVCOORD, NAME, PROPINIT, 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, PROPSET, 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, DETECTING)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value170 (0xaa)
Operandsuint8_t hops, uint24_t slot
Length5
Stack Usesv
Stack Defsv
+ +

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

+
+
+ +

Intrinsics

+ +
+
JSOP_GETINTRINSIC [-0, +1] (ATOM, NAME, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, 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 block. 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 the implicit this might be derived from a non-syntactic scope (instead of the global itself).

+ +

Note that code evaluated via the Debugger API uses DebugEnvironmentProxy objects on its scope chain, which are non-syntactic environments that refer to syntactic environments. As a result, the binding we want may be held by a syntactic environments such as CallObject or VarEnvrionmentObject.

+
+
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 [-1, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value103 (0x67)
Operands 
Length1
Stack Usescallee
Stack DefshomeObjectProto
+ +

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

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

Push the function to invoke with |super()|. This is the prototype of the function passed in as |callee|.

+
+
+ +

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_ENVCALLEE [-0, +1] (UINT8)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value206 (0xce)
Operandsuint8_t numHops
Length2
Stack Uses 
Stack Defscallee
+ +

Load the callee stored in a CallObject on the environment chain. The numHops operand is the number of environment objects to skip on the environment chain.

+
+
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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.

+
+
+ +

Modules

+ +
+
JSOP_DYNAMIC_IMPORT [-1, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value233 (0xe9)
Operands 
Length1
Stack Usesarg
Stack Defsrval
+ +

Dynamic import of the module specified by the string value on the top of the stack.

+
+
JSOP_IMPORTMETA [-0, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value232 (0xe8)
Operands 
Length1
Stack Uses 
Stack Defsimport.meta
+ +

Push "import.meta"

+
+
+ +

Operators

+ +

Comparison Operators

+ +
+
JSOP_EQ [-2, +1] (DETECTING, IC)
+ JSOP_GE [-2, +1] (IC)
+ JSOP_GT [-2, +1] (IC)
+ JSOP_LE [-2, +1] (IC)
+ JSOP_LT [-2, +1] (IC)
+ JSOP_NE [-2, +1] (DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+ JSOP_STRICTNE [-2, +1] (DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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_DEC [-1, +1] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value235 (0xeb)
Operands 
Length1
Stack Usesval
Stack Defs(val - 1)
+ +

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

+
+
JSOP_INC [-1, +1] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value234 (0xea)
Operands 
Length1
Stack Usesval
Stack Defs(val + 1)
+ +

Pops the numeric value val from the stack, then pushes val + 1.

+
+
JSOP_DIV [-2, +1] (IC)
+ JSOP_MOD [-2, +1] (IC)
+ JSOP_MUL [-2, +1] (IC)
+ JSOP_SUB [-2, +1] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value34 (0x22)
Operands 
Length1
Stack Usesval
Stack Defs(-val)
+ +

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

+
+
JSOP_POS [-1, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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).

+
+
JSOP_TONUMERIC [-1, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value236 (0xec)
Operands 
Length1
Stack Usesval
Stack DefsToNumeric(val)
+ +

Pop val from the stack, then push the result of ToNumeric(val).

+
+
+ +

Bitwise Logical Operators

+ +
+
JSOP_BITAND [-2, +1] (IC)
+ JSOP_BITOR [-2, +1] (IC)
+ JSOP_BITXOR [-2, +1] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (IC)
+ JSOP_RSH [-2, +1] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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.

+
+
JSOP_UNPICK [-0, +0] (UINT8)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value183 (0xb7)
Operandsuint8_t n
Length2
Stack Usesv[n], v[n-1], ..., v[1], v[0]
Stack Defsv[0], v[n], v[n-1], ..., v[1]
+ +

Moves the top of the stack value under the nth element of the stack. Note: n must NOT be 0.

+
+
+ +

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_BIGINT [-0, +1] (BIGINT)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value237 (0xed)
Operandsuint32_t constIndex
Length5
Stack Uses 
Stack Defsval
+ +

Pushes a BigInt constant onto the stack.

+
+
JSOP_BUILTINPROTO [-0, +1] (UINT8)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value221 (0xdd)
Operandsuint8_t kind
Length2
Stack Uses 
Stack Defs%BuiltinPrototype%
+ +

Pushes the current global's builtin prototype for a given proto key.

+
+
JSOP_DOUBLE [-0, +1] (DOUBLE)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value60 (0x3c)
OperandsDoubleValue literal
Length9
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 Defsatom
+ +

Pushes string constant onto the stack.

+
+
JSOP_SYMBOL [-0, +1] (UINT8)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value45 (0x2d)
Operandsuint8_t symbol (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_INITLEXICAL opcode.

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

Pushes 0 onto the stack.

+
+
+ +

Object

+ +
+
JSOP_CALLELEM [-2, +1] (ELEM, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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. Requires the value under obj to be the receiver of the following call.

+ +

Like JSOP_GETELEM but for call context.

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

Pops the top of stack value, pushes property of it onto the stack. Requires the value under obj to be the receiver of the following call.

+ +

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_CHECKCLASSHERITAGE [-1, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value51 (0x33)
Operands 
Length1
Stack Usesheritage
Stack Defsheritage
+ +

Ensures the result of a class's heritage expression is either null or a constructor.

+
+
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_GETBOUNDNAME [-1, +1] (ATOM, NAME, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value195 (0xc3)
Operandsuint32_t nameIndex
Length5
Stack Usesenv
Stack Defsv
+ +

Pops an environment, gets the value of a bound name on it. If the name is not bound to the environment, throw a ReferenceError. Used in conjunction with BINDNAME.

+
+
JSOP_GETELEM [-2, +1] (ELEM, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ELEM, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value125 (0x7d)
Operands 
Length1
Stack Usesreceiver, propval, obj
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, TYPESET, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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_INITELEM [-3, +1] (ELEM, PROPINIT, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPINIT, 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, PROPINIT, 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, PROPINIT, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPINIT, 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, PROPINIT, 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, PROPINIT, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPINIT, 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, PROPINIT, 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, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value92 (0x5c)
Operands 
Length1
Stack Usesfun, homeObject
Stack Defsfun
+ +

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 the function on the stack.

+
+
JSOP_INITLOCKEDPROP [-2, +1] (ATOM, PROP, PROPINIT, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPINIT, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPINIT, 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, PROPINIT, 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] (UINT32, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value89 (0x59)
Operands(uint32_t extra)
Length5
Stack Uses 
Stack Defsobj
+ +

Pushes newly created object onto the stack.

+ +

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

+
+
JSOP_NEWOBJECT [-0, +1] (OBJECT, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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] (ELEM, PROPSET, DETECTING, CHECKSLOPPY, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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 val onto the stack.

+
+
JSOP_SETELEM_SUPER [-4, +1] (ELEM, PROPSET, DETECTING, CHECKSLOPPY)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value158 (0x9e)
Operands 
Length1
Stack Usesreceiver, propval, 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, PROPSET, DETECTING, CHECKSLOPPY, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPSET, 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] (ELEM, PROPSET, DETECTING, CHECKSTRICT, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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 val onto the stack. Throws a TypeError if the set fails, per strict mode semantics.

+
+
JSOP_STRICTSETELEM_SUPER [-4, +1] (ELEM, PROPSET, DETECTING, CHECKSTRICT)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value159 (0x9f)
Operands 
Length1
Stack Usesreceiver, propval, 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, PROPSET, DETECTING, CHECKSTRICT, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPSET, 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_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, PROPINIT, DETECTING, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, PROPINIT, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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, IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
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.

+
+
+ +

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 Usesproto
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_HASOWN [-2, +1] (IC)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value211 (0xd3)
Operands 
Length1
Stack Usesid, obj
Stack Defs(obj.hasOwnProperty(id))
+ +

Pops the top two values id and obj from the stack, then pushes obj.hasOwnProperty(id)

+ +

Note that obj is the top value.

+
+
JSOP_ITERNEXT [-1, +1]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value222 (0xde)
Operands 
Length1
Stack Usesval
Stack Defsval
+ +

NOP opcode to hint to IonBuilder that the value on top of the stack is the (likely string) key in a for-in loop.

+
+
JSOP_JUMPTARGET [-0, +0] (ICINDEX)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value230 (0xe6)
Operandsuint32_t icIndex
Length5
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 as well, see BytecodeIsJumpTarget. The IC index is used by the Baseline interpreter.

+
+
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_RESUMEINDEX [-0, +1] (RESUMEINDEX)
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value126 (0x7e)
Operandsuint24_t resumeIndex
Length4
Stack Uses 
Stack DefsresumeIndex
+ +

Pushes a resumeIndex (stored as 24-bit operand) on the stack.

+ +

Resume indexes are used for ops like JSOP_YIELD and JSOP_GOSUB. JSScript and BaselineScript have lists of resume entries (one for each resumeIndex); this lets the JIT resume at these ops from JIT 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.

+
+
JSOP_TRY_DESTRUCTURING [-0, +0]
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Value220 (0xdc)
Operands 
Length1
Stack Uses 
Stack Defs 
+ +

No-op used by the exception unwinder to determine the correct environment to unwind to when performing IteratorClose due to destructuring.

+
+
-- cgit v1.2.3-54-g00ecf