1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 # =======================
7 # This file defines all MIR opcodes. It is parsed by GenerateMIRFiles.py
8 # at build time to create MIROpsGenerated.h. Each opcode consists of a
9 # name and a set of attributes that are described below. A few of the
10 # attributes below allow setting the value to "custom", meaning the
11 # method will be declared for the MIR op, but will need to be implemented
12 # in C++ (typically done in MIR.cpp). Unless marked as required, attributes
19 # - opcode string: used as the name for MIR opcode.
23 # Used to decide to generate MIR boilerplate.
24 # - true (default): auto generate boilerplate for this MIR opcode
25 # - false: do not generate boilerplate for this MIR opcode
29 # A list of operands for the MIR op class constructor. Each operand is a
30 # MIR node. The operand kind is specified from the one of the kinds from
31 # the MIRType enum in IonTypes.h. The specified types for the
32 # operands will decide the type policy for the instruction.
34 # The naming of operands is how the NAMED_OPERANDS macro will define
42 # Will result in an instruction having the type policy of:
43 # MixPolicy<ObjectPolicy<0>, BoxPolicy<1>, ObjectPolicy<2>>
44 # and a named operands definition that looks like the following:
45 # NAMED_OPERANDS((0, object), (1, idValue), (2, value))
47 # - attribute not specified (default): no code generated
48 # - operand list: MIRTypes (See MIRType in jit/IonTypes.h)
52 # A list of non-MIR node arguments to the MIR op class constructor
53 # that are passed along with the operands. The arguments require
54 # both a name and a full type signature for each item in the list.
57 # templateObject: JSObject*
58 # initialHeap: gc::Heap
60 # For each argument a private variable declaration will be autogenerated
61 # in the MIR op class, as well as simple accessor for that variable. If
62 # the type of the variable is a GC pointer it will by automatically
63 # wrapped by CompilerGCPointer. The above arguments list will result in
64 # the following declarations and accessors:
66 # CompilerGCPointer<JSObject*> templateObject_;
67 # gc::Heap initialHeap_;
69 # JSObject* templateObject() const { return templateObject_; }
70 # gc::Heap initialHeap() const { return initialHeap_; }
72 # - attribute not specified (default): no code generated
73 # - operand list: argument names and their full type signature
77 # If this attribute is present, then the type policy for that opcode will be
78 # NoTypePolicy. This is used for opcode that should have no type policy.
79 # - attribute not specified (default): no code generated, type policy
80 # is based off of operands
81 # - none: defines the type policy as opcode's NoTypePolicy
85 # Defines the result type of the MIR opcode.
86 # - attribute not specified (default): no code is generated
87 # - MIRType string: Will add a call to setResultType to the opcode constructor.
88 # This will set the MIR opcodes result type to whatever the
89 # specified MIRType is (See MIRType in jit/IonTypes.h).
93 # Set if the opcode is a guard instruction and is used for checks in optimizations
94 # such as range analysis and value numbering.
95 # - attribute not specified (default): no code generated
96 # - true: adds setGuard to opcode constructor
100 # Defines the movable MIR flag for movable instructions. This is used for knowing
101 # whether we can hoist an instruction.
102 # - attribute not specified (default): no code generated
103 # - true: adds setMovable call in opcode constructor
107 # The foldsTo method is used for determining if an instruction can be folded into
108 # simpler instruction or for constant folding, depending on its operands.
109 # - attribute not specified (default): no code generated, no constants to fold
110 # - custom: custom C++ implementation
114 # Used by ValueNumbering to determine if two values are congruent.
115 # - attribute not specified (default): no code generated, congruentTo(foo) returns
117 # - if_operands_equal: congruentTo(foo) will return congruentIfOperandsEqual(foo)
118 # - custom: custom C++ implementation
122 # Defines the getAliasSet function for a MIR op. The alias set is used for alias
123 # analysis. The default alias set is Any.
124 # - attribute not specified (default): no code generated, alias set is Any
125 # - none: this is the most common case, this is will set the alias set to None.
126 # - custom: custom C++ implementation in MIR.cpp
130 # Defines if a opcode can possibly call.
131 # - attribute not specified (default): no code generated, opcode does not call
132 # - true: possiblyCalls returns true
133 # - custom: custom C++ implementation
137 # Computes and sets the range value for a MIR node, which is then used in range
139 # - attribute not specified (default): no code generated, range is not set for node
140 # - custom: custom C++ implementation in RangeAnalysis.cpp
144 # Indicates whether this instruction can be recovered on bailout.
146 # - attribute not specified (default): no code generated, canRecoverOnBailout
148 # - true: canRecoverOnBailout returns true
149 # - custom: canRecoverOnBailout has a custom C++ implementation
150 # If the value is either 'true' or 'custom', writeRecoverData has a custom C++
155 # Allows cloning for that MIR op.
156 # - attribute not specified (default): no code generated
157 # - true: allows cloning
159 # can_consume_float32
160 # ===================
161 # Indicates whether this instruction's operands can have MIRType::Float32.
163 # - attribute not specified (default): no code generated
164 # - true: canConsumeFloat32 returns true
167 # TODO(no-TI): try to remove this instruction.
170 # Instruction marking on entrypoint for on-stack replacement.
171 # OSR may occur at loop headers (at JSOp::LoopHead).
172 # There is at most one MOsrEntry per MIRGraph.
180 - name: LimitedTruncate
181 gen_boilerplate: false
184 gen_boilerplate: false
186 - name: WasmNullConstant
187 gen_boilerplate: false
189 - name: WasmFloatConstant
190 gen_boilerplate: false
193 gen_boilerplate: false
198 congruent_to: if_operands_equal
201 - name: IsConstructing
204 congruent_to: if_operands_equal
208 gen_boilerplate: false
211 gen_boilerplate: false
214 gen_boilerplate: false
217 gen_boilerplate: false
226 gen_boilerplate: false
228 - name: NewArrayDynamicLength
232 templateObject: JSObject*
233 initialHeap: gc::Heap
235 # Need to throw if length is negative.
237 # Throws if length is negative.
240 - name: NewTypedArray
241 gen_boilerplate: false
243 - name: NewTypedArrayDynamicLength
247 templateObject: JSObject*
248 initialHeap: gc::Heap
251 # Throws if length is negative.
254 # Create a new TypedArray from an Array (or Array-like object) or a TypedArray.
255 - name: NewTypedArrayFromArray
259 templateObject: JSObject*
260 initialHeap: gc::Heap
265 # Create a new TypedArray from an ArrayBuffer (or SharedArrayBuffer).
266 - name: NewTypedArrayFromArrayBuffer
272 templateObject: JSObject*
273 initialHeap: gc::Heap
279 gen_boilerplate: false
281 - name: NewPlainObject
282 gen_boilerplate: false
284 - name: NewArrayObject
285 gen_boilerplate: false
288 gen_boilerplate: false
291 gen_boilerplate: false
294 gen_boilerplate: false
297 gen_boilerplate: false
299 - name: NewBoundFunction
301 templateObj: JSObject*
305 - name: BoundFunctionNumArgs
310 congruent_to: if_operands_equal
311 # A bound function's state is immutable, so there is no
312 # implicit dependency.
315 - name: GuardBoundFunctionIsConstructor
321 congruent_to: if_operands_equal
322 # The is-constructor flag is immutable for a bound function.
325 # Setting __proto__ in an object literal.
333 - name: InitPropGetterSetter
340 - name: InitElemGetterSetter
347 gen_boilerplate: false
349 - name: CallClassHook
350 gen_boilerplate: false
353 gen_boilerplate: false
356 gen_boilerplate: false
359 gen_boilerplate: false
361 - name: ConstructArgs
362 gen_boilerplate: false
364 - name: ConstructArray
365 gen_boilerplate: false
368 gen_boilerplate: false
371 gen_boilerplate: false
373 # This op serves as a way to force the encoding of a snapshot, even if there
374 # is no resume point using it. This is useful to run MAssertRecoveredOnBailout
376 - name: EncodeSnapshot
379 - name: AssertRecoveredOnBailout
380 gen_boilerplate: false
382 - name: AssertFloat32
383 gen_boilerplate: false
386 gen_boilerplate: false
388 - name: SameValueDouble
394 congruent_to: if_operands_equal
404 congruent_to: if_operands_equal
409 gen_boilerplate: false
412 gen_boilerplate: false
415 gen_boilerplate: false
418 gen_boilerplate: false
421 gen_boilerplate: false
423 # Caller-side allocation of |this| for |new|:
424 # Constructs |this| when possible, else MagicValue(JS_IS_CONSTRUCTING).
430 # Performs a property read from |newTarget| iff |newTarget| is a JSFunction
431 # with an own |.prototype| property.
435 - name: CreateArgumentsObject
436 gen_boilerplate: false
438 - name: CreateInlinedArgumentsObject
439 gen_boilerplate: false
441 - name: GetInlinedArgument
442 gen_boilerplate: false
444 - name: GetInlinedArgumentHole
445 gen_boilerplate: false
447 - name: GetArgumentsObjectArg
456 - name: SetArgumentsObjectArg
464 # Load |arguments[index]| from a mapped or unmapped arguments object. Bails out
465 # when any elements were overridden or deleted. Also bails out if the index is
467 - name: LoadArgumentsObjectArg
473 congruent_to: if_operands_equal
476 # Load |arguments[index]| from a mapped or unmapped arguments object. Bails out
477 # when any elements were overridden or deleted. Returns undefined if the index is
479 - name: LoadArgumentsObjectArgHole
485 congruent_to: if_operands_equal
488 - name: InArgumentsObjectArg
494 congruent_to: if_operands_equal
497 # Load |arguments.length|. Bails out if the length has been overriden.
498 - name: ArgumentsObjectLength
504 congruent_to: if_operands_equal
505 # Even though the "length" property is lazily resolved, it acts similar to
506 # a normal property load, so we can treat this operation like any other
510 # Create an array from an arguments object.
511 - name: ArrayFromArgumentsObject
519 # Guard that the given flags are not set on the arguments object.
520 - name: GuardArgumentsObjectFlags
529 # The flags are packed with the length in a fixed private slot.
532 - name: LoadScriptedProxyHandler
536 congruent_to: if_operands_equal
540 - name: CheckScriptedProxyGetResult
549 - name: IdToStringOrSymbol
553 congruent_to: if_operands_equal
557 # Given a MIRType::Value A and a MIRType::Object B:
558 # If the Value may be safely unboxed to an Object, return Object(A).
559 # Otherwise, return B.
560 # Used to implement return behavior for inlined constructors.
561 - name: ReturnFromCtor
567 congruent_to: if_operands_equal
571 gen_boilerplate: false
574 gen_boilerplate: false
576 # Converts a uint32 to a double (coming from wasm).
577 - name: WasmUnsignedToDouble
584 congruent_to: if_operands_equal
587 - name: WasmUnsignedToFloat32
588 gen_boilerplate: false
590 - name: WrapInt64ToInt32
591 gen_boilerplate: false
593 - name: ExtendInt32ToInt64
594 gen_boilerplate: false
596 - name: WasmBuiltinTruncateToInt64
597 gen_boilerplate: false
599 - name: WasmTruncateToInt64
600 gen_boilerplate: false
602 - name: WasmTruncateToInt32
603 gen_boilerplate: false
605 - name: WasmAnyRefFromJSValue
608 result_type: WasmAnyRef
609 congruent_to: if_operands_equal
612 - name: WasmAnyRefFromJSObject
616 result_type: WasmAnyRef
617 congruent_to: if_operands_equal
620 - name: WasmAnyRefFromJSString
624 result_type: WasmAnyRef
625 congruent_to: if_operands_equal
628 - name: WasmNewI31Ref
632 result_type: WasmAnyRef
634 congruent_to: if_operands_equal
637 - name: WasmI31RefGet
641 wideningOp: wasm::FieldWideningOp
645 congruent_to: if_operands_equal
648 - name: Int32ToIntPtr
649 gen_boilerplate: false
651 - name: NonNegativeIntPtrToInt32
652 gen_boilerplate: false
654 - name: IntPtrToDouble
655 gen_boilerplate: false
657 - name: AdjustDataViewLength
658 gen_boilerplate: false
660 - name: Int64ToFloatingPoint
661 gen_boilerplate: false
663 - name: BuiltinInt64ToFloatingPoint
664 gen_boilerplate: false
666 - name: ToNumberInt32
667 gen_boilerplate: false
669 - name: BooleanToInt32
674 compute_range: custom
676 congruent_to: if_operands_equal
679 - name: TruncateToInt32
680 gen_boilerplate: false
682 - name: WasmBuiltinTruncateToInt32
683 gen_boilerplate: false
686 gen_boilerplate: false
689 gen_boilerplate: false
691 - name: TruncateBigIntToInt64
692 gen_boilerplate: false
694 - name: Int64ToBigInt
695 gen_boilerplate: false
698 gen_boilerplate: false
701 gen_boilerplate: false
704 gen_boilerplate: false
712 congruent_to: if_operands_equal
717 gen_boilerplate: false
725 - name: ToPropertyKeyCache
731 gen_boilerplate: false
734 gen_boilerplate: false
737 gen_boilerplate: false
740 gen_boilerplate: false
743 gen_boilerplate: false
746 gen_boilerplate: false
748 - name: SignExtendInt32
749 gen_boilerplate: false
751 - name: SignExtendInt64
752 gen_boilerplate: false
755 gen_boilerplate: false
758 gen_boilerplate: false
761 gen_boilerplate: false
764 gen_boilerplate: false
767 gen_boilerplate: false
770 gen_boilerplate: false
773 gen_boilerplate: false
776 gen_boilerplate: false
778 # Inline implementation of atan2 (arctangent of y/x).
785 congruent_to: if_operands_equal
792 gen_boilerplate: false
795 gen_boilerplate: false
798 gen_boilerplate: false
804 compute_range: custom
809 gen_boilerplate: false
812 gen_boilerplate: false
815 gen_boilerplate: false
818 gen_boilerplate: false
821 gen_boilerplate: false
824 gen_boilerplate: false
826 - name: WasmBuiltinDivI64
827 gen_boilerplate: false
830 gen_boilerplate: false
832 - name: WasmBuiltinModD
833 gen_boilerplate: false
835 - name: WasmBuiltinModI64
836 gen_boilerplate: false
839 gen_boilerplate: false
842 gen_boilerplate: false
845 gen_boilerplate: false
848 gen_boilerplate: false
851 gen_boilerplate: false
854 gen_boilerplate: false
857 gen_boilerplate: false
860 gen_boilerplate: false
863 gen_boilerplate: false
866 gen_boilerplate: false
869 gen_boilerplate: false
871 - name: BigIntIncrement
872 gen_boilerplate: false
874 - name: BigIntDecrement
875 gen_boilerplate: false
878 gen_boilerplate: false
881 gen_boilerplate: false
883 - name: Int32ToStringWithBase
889 congruent_to: if_operands_equal
892 - name: NumberParseInt
898 congruent_to: if_operands_equal
902 - name: DoubleParseInt
907 congruent_to: if_operands_equal
911 gen_boilerplate: false
913 - name: LinearizeForCharAccess
919 congruent_to: if_operands_equal
920 # Strings are immutable, so there is no implicit dependency.
930 congruent_to: if_operands_equal
931 # Strings are immutable, so there is no implicit dependency.
933 compute_range: custom
937 # Similar to CharCodeAt, but also supports out-of-bounds access.
938 - name: CharCodeAtMaybeOutOfBounds
944 congruent_to: if_operands_equal
945 # Strings are immutable, so there is no implicit dependency.
948 # Like CharCodeAtMaybeOutOfBounds, this operation also supports out-of-bounds access.
949 - name: CharAtMaybeOutOfBounds
955 congruent_to: if_operands_equal
956 # Strings are immutable, so there is no implicit dependency.
964 congruent_to: if_operands_equal
969 - name: FromCodePoint
975 congruent_to: if_operands_equal
979 - name: StringIndexOf
985 congruent_to: if_operands_equal
989 - name: StringStartsWith
995 congruent_to: if_operands_equal
999 - name: StringEndsWith
1002 searchString: String
1003 result_type: Boolean
1005 congruent_to: if_operands_equal
1007 possibly_calls: true
1009 - name: StringConvertCase
1010 gen_boilerplate: false
1017 possibly_calls: true
1018 # Although this instruction returns a new array, we don't have to mark
1019 # it as store instruction, see also MNewArray.
1023 - name: BoxNonStrictThis
1027 globalThis: JSObject*
1030 possibly_calls: true
1031 # This instruction can allocate a new object for wrapped primitives, but
1032 # has no effect on existing objects.
1035 - name: ImplicitThis
1041 possibly_calls: true
1044 gen_boilerplate: false
1047 gen_boilerplate: false
1050 gen_boilerplate: false
1053 gen_boilerplate: false
1055 - name: OsrEnvironmentChain
1056 gen_boilerplate: false
1058 - name: OsrArgumentsObject
1059 gen_boilerplate: false
1061 - name: OsrReturnValue
1062 gen_boilerplate: false
1065 gen_boilerplate: false
1072 # Checks whether we need to fire the interrupt handler.
1073 - name: CheckOverRecursed
1078 # Check whether we need to fire the interrupt handler.
1079 - name: InterruptCheck
1083 - name: WasmInterruptCheck
1084 gen_boilerplate: false
1087 gen_boilerplate: false
1089 # Trap if the given ref is null
1090 - name: WasmTrapIfNull
1095 bytecodeOffset: wasm::BytecodeOffset
1100 - name: LexicalCheck
1101 gen_boilerplate: false
1103 # Unconditionally throw an uninitialized let error.
1104 - name: ThrowRuntimeLexicalError
1106 errorNumber: unsigned
1112 gen_boilerplate: false
1114 # In the prologues of global and eval scripts, check for redeclarations and
1115 # initialize bindings.
1116 - name: GlobalDeclInstantiation
1121 source: RegExpObject*
1124 possibly_calls: true
1127 - name: RegExpMatcher
1133 possibly_calls: true
1136 # Note: this instruction writes to cx->regExpSearcherLastLimit.
1137 # See also MRegExpSearcherLastLimit.
1138 - name: RegExpSearcher
1144 possibly_calls: true
1147 # This instruction loads cx->regExpSearcherLastLimit. We don't have a
1148 # specialized alias set for this so just use the default alias set similar to
1149 # the MRegExpSearcher instruction that precedes it.
1150 - name: RegExpSearcherLastLimit
1154 - name: RegExpExecMatch
1159 possibly_calls: true
1162 - name: RegExpExecTest
1166 result_type: Boolean
1167 possibly_calls: true
1170 - name: RegExpHasCaptureGroups
1174 result_type: Boolean
1175 possibly_calls: true
1177 - name: RegExpPrototypeOptimizable
1180 result_type: Boolean
1183 - name: RegExpInstanceOptimizable
1187 result_type: Boolean
1190 - name: GetFirstDollarIndex
1191 gen_boilerplate: false
1193 - name: StringReplace
1194 gen_boilerplate: false
1202 congruent_to: if_operands_equal
1207 - name: ModuleMetadata
1212 - name: DynamicImport
1219 gen_boilerplate: false
1221 - name: FunctionWithProto
1222 gen_boilerplate: false
1231 possibly_calls: true
1233 # Returns obj->slots.
1239 congruent_to: if_operands_equal
1244 # Returns obj->elements.
1248 result_type: Elements
1250 congruent_to: if_operands_equal
1254 # Load the initialized length from an elements header.
1255 - name: InitializedLength
1261 congruent_to: if_operands_equal
1263 compute_range: custom
1266 - name: SetInitializedLength
1274 # Load the array length from an elements header.
1281 congruent_to: if_operands_equal
1283 compute_range: custom
1286 # Store to the length in an elements header. Note the input is an *index*, one
1287 # less than the desired length.
1288 - name: SetArrayLength
1294 # By default no, unless built as a recovered instruction.
1297 # Load the function length. Bails for functions with lazy scripts or a
1298 # resolved "length" property.
1299 - name: FunctionLength
1304 congruent_to: if_operands_equal
1305 # Even though the "length" property is lazily resolved, it acts similar to
1306 # a normal property load, so we can treat this operation like any other
1310 # Load the function name. Bails for bound functions when the bound function
1311 # name prefix isn't present or functions with a resolved "name" property.
1312 - name: FunctionName
1317 congruent_to: if_operands_equal
1318 # Even though the "name" property is lazily resolved, it acts similar to
1319 # a normal property load, so we can treat this operation like any other
1323 - name: GetNextEntryForIterator
1324 gen_boilerplate: false
1326 # Read the byte length of an array buffer as IntPtr.
1327 - name: ArrayBufferByteLength
1332 congruent_to: if_operands_equal
1335 # Read the length of an array buffer view.
1336 - name: ArrayBufferViewLength
1341 congruent_to: if_operands_equal
1343 compute_range: custom
1345 - name: ArrayBufferViewByteOffset
1350 congruent_to: if_operands_equal
1352 compute_range: custom
1354 # Read the length of an array buffer view.
1355 - name: ArrayBufferViewElements
1358 result_type: Elements
1360 congruent_to: if_operands_equal
1364 # Return the element size of a typed array.
1365 - name: TypedArrayElementSize
1370 congruent_to: if_operands_equal
1371 # Class is immutable. See also MHasClass.
1373 compute_range: custom
1375 # Guard an ArrayBufferView has an attached ArrayBuffer.
1376 - name: GuardHasAttachedArrayBuffer
1382 congruent_to: if_operands_equal
1385 - name: GuardNumberToIntPtrIndex
1386 gen_boilerplate: false
1388 - name: KeepAliveObject
1394 - name: DebugEnterGCUnsafeRegion
1399 - name: DebugLeaveGCUnsafeRegion
1405 gen_boilerplate: false
1408 gen_boilerplate: false
1410 - name: BoundsCheckLower
1411 gen_boilerplate: false
1413 - name: SpectreMaskIndex
1414 gen_boilerplate: false
1417 gen_boilerplate: false
1419 - name: LoadElementAndUnbox
1420 gen_boilerplate: false
1422 - name: LoadElementHole
1423 gen_boilerplate: false
1425 - name: StoreElement
1426 gen_boilerplate: false
1428 - name: StoreHoleValueElement
1429 gen_boilerplate: false
1431 - name: StoreElementHole
1432 gen_boilerplate: false
1434 - name: ArrayPopShift
1435 gen_boilerplate: false
1437 # Array.prototype.push on a dense array. Returns the new array length.
1444 compute_range: custom
1447 # Array.prototype.slice on a dense array.
1454 templateObj: JSObject*
1455 initialHeap: gc::Heap
1457 possibly_calls: true
1459 # Array.prototype.slice on an arguments object.
1460 - name: ArgumentsSlice
1466 templateObj: JSObject*
1467 initialHeap: gc::Heap
1469 possibly_calls: true
1471 # Array.prototype.slice on an arguments object.
1472 - name: FrameArgumentsSlice
1477 templateObj: JSObject*
1478 initialHeap: gc::Heap
1481 possibly_calls: true
1483 # Array.prototype.slice on an inlined arguments object.
1484 - name: InlineArgumentsSlice
1485 gen_boilerplate: false
1487 - name: NormalizeSliceTerm
1493 congruent_to: if_operands_equal
1497 # MArrayJoin doesn't override |getAliasSet()|, because Array.prototype.join
1498 # might coerce the elements of the Array to strings. This coercion might
1499 # cause the evaluation of JavaScript code.
1505 possibly_calls: true
1507 # MArrayJoin doesn't override |getAliasSet()|, because Array.prototype.join
1508 # might coerce the elements of the Array to strings. This coercion might
1509 # cause the evaluation of JavaScript code.
1511 - name: LoadUnboxedScalar
1512 gen_boilerplate: false
1514 - name: LoadDataViewElement
1515 gen_boilerplate: false
1517 - name: LoadTypedArrayElementHole
1518 gen_boilerplate: false
1520 - name: StoreUnboxedScalar
1521 gen_boilerplate: false
1523 - name: StoreDataViewElement
1524 gen_boilerplate: false
1526 - name: StoreTypedArrayElementHole
1527 gen_boilerplate: false
1529 - name: EffectiveAddress
1530 gen_boilerplate: false
1532 - name: ClampToUint8
1533 gen_boilerplate: false
1535 - name: LoadFixedSlot
1536 gen_boilerplate: false
1538 - name: LoadFixedSlotAndUnbox
1539 gen_boilerplate: false
1541 - name: LoadDynamicSlotAndUnbox
1542 gen_boilerplate: false
1544 - name: StoreFixedSlot
1545 gen_boilerplate: false
1547 - name: GetPropertyCache
1548 gen_boilerplate: false
1550 - name: HomeObjectSuperBase
1555 congruent_to: if_operands_equal
1558 - name: GetPropSuperCache
1559 gen_boilerplate: false
1561 - name: BindNameCache
1568 environmentChain: Object
1571 congruent_to: custom
1582 congruent_to: custom
1586 - name: GuardMultipleShapes
1593 congruent_to: if_operands_equal
1597 gen_boilerplate: false
1599 - name: GuardNullProto
1600 gen_boilerplate: false
1602 # Guard the object is a native object.
1603 - name: GuardIsNativeObject
1609 congruent_to: if_operands_equal
1612 - name: GuardGlobalGeneration
1615 generationAddr: const void*
1620 congruent_to: custom
1622 - name: GuardIsProxy
1628 congruent_to: if_operands_equal
1631 - name: GuardIsNotDOMProxy
1637 congruent_to: if_operands_equal
1640 - name: GuardIsNotProxy
1646 congruent_to: if_operands_equal
1656 possibly_calls: true
1658 - name: ProxyGetByValue
1663 possibly_calls: true
1665 - name: ProxyHasProp
1671 result_type: Boolean
1672 possibly_calls: true
1681 possibly_calls: true
1683 - name: ProxySetByValue
1690 possibly_calls: true
1692 - name: CallSetArrayLength
1698 possibly_calls: true
1700 - name: MegamorphicLoadSlot
1706 # Bails when non-native or accessor properties are encountered, so we can't
1707 # DCE this instruction.
1709 possibly_calls: true
1710 congruent_to: custom
1713 - name: MegamorphicLoadSlotByValue
1718 # Bails when non-native or accessor properties are encountered, so we can't
1719 # DCE this instruction.
1722 congruent_to: if_operands_equal
1724 possibly_calls: true
1726 - name: MegamorphicStoreSlot
1733 possibly_calls: true
1735 - name: MegamorphicHasProp
1741 result_type: Boolean
1742 # Bails when non-native or accessor properties are encountered, so we can't
1743 # DCE this instruction.
1745 congruent_to: custom
1747 possibly_calls: true
1749 - name: GuardIsNotArrayBufferMaybeShared
1755 congruent_to: if_operands_equal
1759 - name: GuardIsTypedArray
1765 congruent_to: if_operands_equal
1768 - name: GuardHasProxyHandler
1772 handler: const void*
1776 congruent_to: if_operands_equal
1779 # Loads a specific JSObject* that was originally nursery-allocated.
1780 # See also WarpObjectField.
1781 - name: NurseryObject
1783 # Index in the Vector of objects stored in the WarpSnapshot.
1784 nurseryIndex: uint32_t
1787 congruent_to: custom
1791 gen_boilerplate: false
1793 - name: GuardNullOrUndefined
1799 congruent_to: if_operands_equal
1803 - name: GuardIsNotObject
1809 congruent_to: if_operands_equal
1813 - name: GuardFunctionFlags
1814 gen_boilerplate: false
1816 - name: GuardFunctionIsNonBuiltinCtor
1822 congruent_to: if_operands_equal
1825 - name: GuardFunctionKind
1829 expected: FunctionFlags::FunctionKind
1830 bailOnEquality: bool
1834 congruent_to: custom
1837 - name: GuardFunctionScript
1841 expected: BaseScript*
1843 flags: FunctionFlags
1848 congruent_to: custom
1849 # A JSFunction's BaseScript pointer is immutable. Relazification of
1850 # self-hosted functions is an exception to this, but we don't use this
1851 # guard for self-hosted functions.
1854 - name: GuardObjectIdentity
1855 gen_boilerplate: false
1857 - name: GuardSpecificFunction
1858 gen_boilerplate: false
1860 - name: GuardSpecificAtom
1868 congruent_to: custom
1872 - name: GuardSpecificSymbol
1873 gen_boilerplate: false
1875 - name: GuardSpecificInt32
1886 - name: GuardStringToIndex
1890 # Mark as guard because this instruction must not be eliminated. For
1891 # example, if the string is not an index the operation could change from a
1892 # typed array load to a getter call.
1895 congruent_to: if_operands_equal
1899 - name: GuardStringToInt32
1903 # Mark as guard to prevent the issue described in MGuardStringToIndex's
1907 congruent_to: if_operands_equal
1911 - name: GuardStringToDouble
1915 # Mark as guard to prevent the issue described in MGuardStringToIndex's
1919 congruent_to: if_operands_equal
1923 - name: GuardNoDenseElements
1931 - name: GuardTagNotEqual
1932 gen_boilerplate: false
1934 - name: LoadDynamicSlot
1935 gen_boilerplate: false
1937 # Inline call to access a function's environment (scope chain).
1938 - name: FunctionEnvironment
1944 # A function's environment is fixed.
1947 # Allocate a new BlockLexicalEnvironmentObject.
1948 - name: NewLexicalEnvironmentObject
1954 # Allocate a new ClassBodyEnvironmentObject.
1955 - name: NewClassBodyEnvironmentObject
1961 - name: NewVarEnvironmentObject
1972 # A function's [[HomeObject]] is fixed.
1975 - name: AddAndStoreSlot
1976 gen_boilerplate: false
1978 - name: AllocateAndStoreSlot
1983 slotOffset: uint32_t
1985 numNewSlots: uint32_t
1986 possibly_calls: true
1989 - name: AddSlotAndCallAddPropHook
1995 possibly_calls: true
1997 - name: StoreDynamicSlot
1998 gen_boilerplate: false
2000 - name: GetNameCache
2005 - name: CallGetIntrinsicValue
2009 possibly_calls: true
2011 - name: DeleteProperty
2017 result_type: Boolean
2019 - name: DeleteElement
2025 result_type: Boolean
2027 - name: SetPropertyCache
2028 gen_boilerplate: false
2030 - name: MegamorphicSetElement
2031 gen_boilerplate: false
2033 - name: SetDOMProperty
2034 gen_boilerplate: false
2036 - name: GetDOMProperty
2037 gen_boilerplate: false
2039 - name: GetDOMMember
2040 gen_boilerplate: false
2042 - name: ObjectToIterator
2043 gen_boilerplate: false
2045 - name: ValueToIterator
2050 - name: IteratorHasIndices
2054 result_type: Boolean
2057 - name: LoadSlotByIteratorIndex
2060 iterator: Object # TODO: add MIRType::NativeIterator?
2064 - name: StoreSlotByIteratorIndex
2071 # Load the private value expando from a DOM proxy. The target is stored in the
2072 # proxy object's private slot.
2073 # This is either an UndefinedValue (no expando), ObjectValue (the expando
2074 # object), or PrivateValue(ExpandoAndGeneration*).
2075 - name: LoadDOMExpandoValue
2080 congruent_to: if_operands_equal
2083 - name: LoadDOMExpandoValueGuardGeneration
2084 gen_boilerplate: false
2086 - name: LoadDOMExpandoValueIgnoreGeneration
2091 congruent_to: if_operands_equal
2094 # Takes an expando Value as input, then guards it's either UndefinedValue or
2095 # an object with the expected shape.
2096 - name: GuardDOMExpandoMissingOrGuardShape
2104 congruent_to: custom
2107 - name: StringLength
2113 congruent_to: if_operands_equal
2114 # The string |length| property is immutable, so there is no
2115 # implicit dependency.
2117 compute_range: custom
2122 gen_boilerplate: false
2125 gen_boilerplate: false
2128 gen_boilerplate: false
2131 gen_boilerplate: false
2134 gen_boilerplate: false
2136 - name: GetIteratorCache
2137 gen_boilerplate: false
2139 - name: OptimizeSpreadCallCache
2144 - name: IteratorMore
2152 result_type: Boolean
2161 - name: CloseIterCache
2165 completionKind: uint8_t
2166 possibly_calls: true
2168 - name: OptimizeGetIteratorCache
2171 result_type: Boolean
2174 gen_boilerplate: false
2177 gen_boilerplate: false
2179 - name: GuardElementNotHole
2180 gen_boilerplate: false
2182 - name: NewPrivateName
2186 possibly_calls: true
2188 - name: CheckPrivateFieldCache
2189 gen_boilerplate: false
2192 gen_boilerplate: false
2195 gen_boilerplate: false
2197 # Implementation for instanceof operator with unknown rhs.
2198 - name: InstanceOfCache
2202 result_type: Boolean
2204 - name: ArgumentsLength
2207 congruent_to: if_operands_equal
2208 # Arguments |length| cannot be mutated by Ion Code.
2210 compute_range: custom
2213 # This MIR instruction is used to get an argument from the actual arguments.
2214 - name: GetFrameArgument
2219 congruent_to: if_operands_equal
2220 # This instruction is never aliased, because ops like JSOp::SetArg don't
2221 # write to the argument frames. We create an arguments object in that case.
2224 # This MIR instruction is used to get an argument from the actual arguments.
2225 # Returns undefined if |index| is larger-or-equals to |length|. Bails out if
2226 # |index| is negative.
2227 - name: GetFrameArgumentHole
2234 congruent_to: if_operands_equal
2235 # This instruction is never aliased, because ops like JSOp::SetArg don't
2236 # write to the argument frames. We create an arguments object in that case.
2242 congruent_to: if_operands_equal
2249 numFormals: unsigned
2252 possibly_calls: true
2256 - name: PostWriteBarrier
2257 gen_boilerplate: false
2259 - name: PostWriteElementBarrier
2260 gen_boilerplate: false
2262 - name: AssertCanElidePostWriteBarrier
2270 - name: NewNamedLambdaObject
2272 templateObj: NamedLambdaObject*
2276 - name: NewCallObject
2277 gen_boilerplate: false
2279 - name: NewStringObject
2280 gen_boilerplate: false
2283 gen_boilerplate: false
2285 - name: IsConstructor
2288 result_type: Boolean
2290 congruent_to: if_operands_equal
2293 - name: IsCrossRealmArrayConstructor
2296 result_type: Boolean
2298 congruent_to: if_operands_equal
2304 result_type: Boolean
2307 congruent_to: if_operands_equal
2310 - name: IsNullOrUndefined
2313 result_type: Boolean
2316 congruent_to: if_operands_equal
2319 can_consume_float32: true
2322 gen_boilerplate: false
2324 - name: GuardToClass
2325 gen_boilerplate: false
2327 - name: GuardToFunction
2328 gen_boilerplate: false
2331 gen_boilerplate: false
2333 - name: IsTypedArray
2334 gen_boilerplate: false
2336 - name: ObjectClassToString
2342 congruent_to: if_operands_equal
2343 possibly_calls: true
2344 # Tests @@toStringTag is neither present on this object nor on any object
2345 # of the prototype chain.
2365 - name: AsyncResolve
2368 valueOrReason: Value
2370 resolveKind: AsyncFunctionResolveKind
2373 # Returns from this function to the previous caller; this looks like a regular
2374 # Unary instruction and is used to lie to the MIR generator about suspending
2375 # ops like Yield/Await, which are emitted like returns, but MIR-Build like
2376 # regular instructions.
2377 - name: GeneratorReturn
2389 - name: CheckThisReinit
2398 gen_boilerplate: false
2400 - name: CanSkipAwait
2403 result_type: Boolean
2405 - name: MaybeExtractAwaitValue
2406 gen_boilerplate: false
2408 - name: IncrementWarmUpCounter
2413 - name: AtomicIsLockFree
2414 gen_boilerplate: false
2416 - name: CompareExchangeTypedArrayElement
2417 gen_boilerplate: false
2419 - name: AtomicExchangeTypedArrayElement
2420 gen_boilerplate: false
2422 - name: AtomicTypedArrayElementBinop
2423 gen_boilerplate: false
2426 gen_boilerplate: false
2438 - name: CheckObjCoercible
2444 # Throws on null or undefined.
2447 - name: CheckClassHeritage
2453 - name: DebugCheckSelfHosted
2459 - name: IsPackedArray
2462 result_type: Boolean
2466 - name: GuardArrayIsPacked
2472 congruent_to: if_operands_equal
2475 - name: GetPrototypeOf
2479 # May throw if target is a proxy.
2482 - name: ObjectWithProto
2486 # May throw if prototype is neither an object nor null.
2488 possibly_calls: true
2490 - name: ObjectStaticProto
2491 gen_boilerplate: false
2493 # This is basically just a limited case of Constant, for objects which are
2494 # the prototype of another object and will be used for a GuardShape. It
2495 # includes a reference to the receiver object so we can eliminate redundant
2497 - name: ConstantProto
2498 gen_boilerplate: false
2500 - name: BuiltinObject
2502 builtinObjectKind: BuiltinObjectKind
2504 possibly_calls: true
2506 - name: SuperFunction
2511 congruent_to: if_operands_equal
2514 - name: InitHomeObject
2521 # Return true if the object is definitely a TypedArray constructor, but not
2522 # necessarily from the currently active realm. Return false if the object is
2523 # not a TypedArray constructor or if it's a wrapper.
2524 - name: IsTypedArrayConstructor
2527 result_type: Boolean
2530 # Load the JSValueTag on all platforms except ARM64. See the comments in
2531 # MacroAssembler-arm64.h for the |cmpTag(Register, ImmTag)| method for why
2532 # ARM64 doesn't use the raw JSValueTag, but instead a modified tag value. That
2533 # modified tag value can't be directly compared against JSValueTag constants.
2534 - name: LoadValueTag
2539 congruent_to: if_operands_equal
2542 # Load the target object from a proxy wrapper. The target is stored in the
2543 # proxy object's private slot.
2544 - name: LoadWrapperTarget
2549 congruent_to: if_operands_equal
2550 # Can't use |AliasSet::None| because the target changes on navigation.
2551 # TODO: Investigate using a narrower or a custom alias set.
2554 # Guard the accessor shape is present on the object or its prototype chain.
2555 - name: GuardHasGetterSetter
2560 getterSetter: GetterSetter*
2564 possibly_calls: true
2565 congruent_to: custom
2568 - name: GuardIsExtensible
2574 congruent_to: if_operands_equal
2577 - name: GuardInt32IsNonNegative
2583 congruent_to: if_operands_equal
2587 - name: GuardInt32Range
2596 congruent_to: if_operands_equal
2600 # Guard the input index is either greater than the dense initialized length of
2601 # an object, or a hole element.
2602 - name: GuardIndexIsNotDenseElement
2609 congruent_to: if_operands_equal
2612 # Guard an array object's length can be updated successfully when adding an
2613 # element at the input index.
2614 - name: GuardIndexIsValidUpdateOrAdd
2621 congruent_to: if_operands_equal
2624 # Add or update a sparse element of an ArrayObject or PlainObject. It's allowed
2625 # for the sparse element to be already present on the object. It may also be an
2626 # accessor property, so this instruction is always marked as effectful.
2627 - name: CallAddOrUpdateSparseElement
2634 possibly_calls: true
2636 # Get a sparse element from an ArrayObject or PlainObject, possibly by calling
2637 # an accessor property.
2638 - name: CallGetSparseElement
2643 possibly_calls: true
2645 - name: CallNativeGetElement
2650 possibly_calls: true
2652 - name: CallNativeGetElementSuper
2658 possibly_calls: true
2660 # Test if a native object has an own element (sparse or dense) at an index.
2661 - name: CallObjectHasSparseElement
2665 result_type: Boolean
2667 congruent_to: if_operands_equal
2668 possibly_calls: true
2671 - name: BigIntAsIntN
2677 congruent_to: if_operands_equal
2678 possibly_calls: true
2683 - name: BigIntAsUintN
2689 congruent_to: if_operands_equal
2690 possibly_calls: true
2695 - name: GuardNonGCThing
2701 congruent_to: if_operands_equal
2705 - name: ToHashableNonGCThing
2710 congruent_to: if_operands_equal
2713 - name: ToHashableString
2718 congruent_to: if_operands_equal
2720 possibly_calls: true
2722 - name: ToHashableValue
2727 congruent_to: if_operands_equal
2729 possibly_calls: true
2731 - name: HashNonGCThing
2736 congruent_to: if_operands_equal
2744 congruent_to: if_operands_equal
2752 congruent_to: if_operands_equal
2760 congruent_to: if_operands_equal
2768 # In contrast to the previous hash operations, we can't move this
2769 # instruction, because the hashcode is computed from the object's address,
2770 # which can change when the object is moved by the GC.
2782 - name: SetObjectHasNonBigInt
2787 result_type: Boolean
2789 congruent_to: if_operands_equal
2792 - name: SetObjectHasBigInt
2797 result_type: Boolean
2799 congruent_to: if_operands_equal
2802 - name: SetObjectHasValue
2807 result_type: Boolean
2809 congruent_to: if_operands_equal
2812 - name: SetObjectHasValueVMCall
2816 result_type: Boolean
2818 congruent_to: if_operands_equal
2820 possibly_calls: true
2822 - name: SetObjectSize
2827 congruent_to: if_operands_equal
2830 - name: MapObjectHasNonBigInt
2835 result_type: Boolean
2837 congruent_to: if_operands_equal
2840 - name: MapObjectHasBigInt
2845 result_type: Boolean
2847 congruent_to: if_operands_equal
2850 - name: MapObjectHasValue
2855 result_type: Boolean
2857 congruent_to: if_operands_equal
2860 - name: MapObjectHasValueVMCall
2864 result_type: Boolean
2866 congruent_to: if_operands_equal
2868 possibly_calls: true
2870 - name: MapObjectGetNonBigInt
2877 congruent_to: if_operands_equal
2880 - name: MapObjectGetBigInt
2887 congruent_to: if_operands_equal
2890 - name: MapObjectGetValue
2897 congruent_to: if_operands_equal
2900 - name: MapObjectGetValueVMCall
2906 congruent_to: if_operands_equal
2908 possibly_calls: true
2910 - name: MapObjectSize
2915 congruent_to: if_operands_equal
2919 gen_boilerplate: false
2921 - name: WasmBinaryBitwise
2922 gen_boilerplate: false
2924 - name: WasmLoadInstance
2925 gen_boilerplate: false
2927 - name: WasmStoreInstance
2928 gen_boilerplate: false
2931 gen_boilerplate: false
2933 - name: WasmBoundsCheck
2934 gen_boilerplate: false
2936 - name: WasmBoundsCheckRange32
2942 bytecodeOffset: wasm::BytecodeOffset
2944 congruent_to: if_operands_equal
2947 - name: WasmExtendU32Index
2952 congruent_to: if_operands_equal
2957 - name: WasmWrapU32Index
2962 congruent_to: if_operands_equal
2967 - name: WasmAddOffset
2968 gen_boilerplate: false
2970 - name: WasmAlignmentCheck
2971 gen_boilerplate: false
2974 gen_boilerplate: false
2977 gen_boilerplate: false
2979 - name: AsmJSLoadHeap
2980 gen_boilerplate: false
2982 - name: AsmJSStoreHeap
2983 gen_boilerplate: false
2990 - name: WasmCompareExchangeHeap
2991 gen_boilerplate: false
2993 - name: WasmAtomicExchangeHeap
2994 gen_boilerplate: false
2996 - name: WasmAtomicBinopHeap
2997 gen_boilerplate: false
2999 - name: WasmLoadInstanceDataField
3000 gen_boilerplate: false
3002 - name: WasmLoadGlobalCell
3003 gen_boilerplate: false
3005 - name: WasmLoadTableElement
3006 gen_boilerplate: false
3008 - name: WasmStoreInstanceDataField
3009 gen_boilerplate: false
3011 - name: WasmStoreGlobalCell
3012 gen_boilerplate: false
3014 - name: WasmStoreStackResult
3015 gen_boilerplate: false
3017 - name: WasmDerivedPointer
3018 gen_boilerplate: false
3020 - name: WasmDerivedIndexPointer
3021 gen_boilerplate: false
3023 - name: WasmStoreRef
3024 gen_boilerplate: false
3026 - name: WasmPostWriteBarrier
3027 gen_boilerplate: false
3029 - name: WasmParameter
3030 gen_boilerplate: false
3033 gen_boilerplate: false
3035 - name: WasmReturnVoid
3036 gen_boilerplate: false
3038 - name: WasmStackArg
3039 gen_boilerplate: false
3041 - name: WasmRegisterResult
3042 gen_boilerplate: false
3044 - name: WasmFloatRegisterResult
3045 gen_boilerplate: false
3047 - name: WasmRegister64Result
3048 gen_boilerplate: false
3050 - name: WasmStackResultArea
3051 gen_boilerplate: false
3053 - name: WasmStackResult
3054 gen_boilerplate: false
3056 - name: WasmCallCatchable
3057 gen_boilerplate: false
3059 - name: WasmCallUncatchable
3060 gen_boilerplate: false
3062 - name: WasmCallLandingPrePad
3063 gen_boilerplate: false
3065 - name: WasmReturnCall
3066 gen_boilerplate: false
3069 gen_boilerplate: false
3071 - name: WasmReinterpret
3072 gen_boilerplate: false
3075 gen_boilerplate: false
3077 - name: WasmBinarySimd128
3078 gen_boilerplate: false
3080 - name: WasmBinarySimd128WithConstant
3081 gen_boilerplate: false
3083 # (v128, i32) -> v128 effect-free shift operations.
3084 - name: WasmShiftSimd128
3089 simdOp: wasm::SimdOp
3091 result_type: Simd128
3093 congruent_to: custom
3097 # (v128, v128, mask) -> v128 effect-free operation.
3098 - name: WasmShuffleSimd128
3103 shuffle: SimdShuffle
3105 result_type: Simd128
3107 congruent_to: custom
3111 - name: WasmReplaceLaneSimd128
3112 gen_boilerplate: false
3114 - name: WasmUnarySimd128
3118 simdOp: wasm::SimdOp
3120 result_type: Simd128
3122 congruent_to: custom
3126 - name: WasmTernarySimd128
3127 gen_boilerplate: false
3129 - name: WasmScalarToSimd128
3130 gen_boilerplate: false
3132 - name: WasmReduceSimd128
3133 gen_boilerplate: false
3135 - name: WasmLoadLaneSimd128
3136 gen_boilerplate: false
3138 - name: WasmStoreLaneSimd128
3139 gen_boilerplate: false
3141 - name: UnreachableResult
3142 gen_boilerplate: false
3144 - name: IonToWasmCall
3145 gen_boilerplate: false
3147 - name: WasmLoadField
3148 gen_boilerplate: false
3150 - name: WasmLoadFieldKA
3151 gen_boilerplate: false
3153 - name: WasmStoreFieldKA
3154 gen_boilerplate: false
3156 - name: WasmStoreFieldRefKA
3157 gen_boilerplate: false
3159 - name: WasmRefIsSubtypeOfConcrete
3160 gen_boilerplate: false
3162 - name: WasmRefIsSubtypeOfAbstract
3163 gen_boilerplate: false
3165 #ifdef FUZZING_JS_FUZZILLI
3166 - name: FuzzilliHash
3167 gen_boilerplate: false
3169 - name: FuzzilliHashStore
3170 gen_boilerplate: false