MIROps.yaml (94968B)
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/. 4 5 # [SMDOC] MIR Opcodes 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 13 # are optional. 14 # 15 # name [required] 16 # ==== 17 # Opcode name. 18 # Possible values: 19 # - opcode string: used as the name for MIR opcode. 20 # 21 # gen_boilerplate 22 # =============== 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 26 # 27 # operands 28 # ======== 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. 33 # 34 # The naming of operands is how the NAMED_OPERANDS macro will define 35 # its operands. 36 # 37 # For example: 38 # object: Object 39 # id: Value 40 # value: Object 41 # 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)) 46 # 47 # - attribute not specified (default): no code generated 48 # - operand list: MIRTypes (See MIRType in jit/IonTypes.h) 49 # 50 # arguments 51 # ========= 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. 55 # 56 # For example: 57 # templateObject: JSObject* 58 # initialHeap: gc::Heap 59 # 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: 65 # 66 # CompilerGCPointer<JSObject*> templateObject_; 67 # gc::Heap initialHeap_; 68 # 69 # JSObject* templateObject() const { return templateObject_; } 70 # gc::Heap initialHeap() const { return initialHeap_; } 71 # 72 # - attribute not specified (default): no code generated 73 # - operand list: argument names and their full type signature 74 # 75 # type_policy 76 # ============ 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 82 # 83 # result_type 84 # =========== 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). 90 # 91 # guard 92 # ===== 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 97 # 98 # movable 99 # ======= 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 104 # 105 # folds_to 106 # ======== 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 111 # 112 # value_hash 113 # ========== 114 # Used by ValueNumbering to determine the hash number for the instruction. 115 # - attribute not specified (default): no code generated, inherit valueHash from 116 # the base class 117 # - custom: custom C++ implementation 118 # 119 # congruent_to 120 # ============ 121 # Used by ValueNumbering to determine if two values are congruent. 122 # - attribute not specified (default): no code generated, congruentTo(foo) returns 123 # false 124 # - if_operands_equal: congruentTo(foo) will return congruentIfOperandsEqual(foo) 125 # - custom: custom C++ implementation 126 # 127 # alias_set 128 # ========= 129 # Defines the getAliasSet function for a MIR op. The alias set is used for alias 130 # analysis. The default alias set is Any. 131 # - attribute not specified (default): no code generated, alias set is Any 132 # - none: this is the most common case, this is will set the alias set to None. 133 # - custom: custom C++ implementation in MIR.cpp 134 # 135 # possibly_calls 136 # ============== 137 # Defines if a opcode can possibly call. 138 # - attribute not specified (default): no code generated, opcode does not call 139 # - true: possiblyCalls returns true 140 # - custom: custom C++ implementation 141 # 142 # compute_range 143 # ============= 144 # Computes and sets the range value for a MIR node, which is then used in range 145 # analysis. 146 # - attribute not specified (default): no code generated, range is not set for node 147 # - custom: custom C++ implementation in RangeAnalysis.cpp 148 # 149 # can_recover 150 # =========== 151 # Indicates whether this instruction can be recovered on bailout. 152 # Possible values: 153 # - attribute not specified (default): no code generated, canRecoverOnBailout 154 # returns false 155 # - true: canRecoverOnBailout returns true 156 # - custom: canRecoverOnBailout has a custom C++ implementation 157 # If the value is either 'true' or 'custom', writeRecoverData has a custom C++ 158 # implementation. 159 # 160 # clone 161 # ===== 162 # Allows cloning for that MIR op. 163 # - attribute not specified (default): no code generated 164 # - true: allows cloning 165 # 166 # can_consume_float32 167 # =================== 168 # Indicates whether this instruction's operands can have MIRType::Float32. 169 # Possible values: 170 # - attribute not specified (default): no code generated 171 # - true: canConsumeFloat32 returns true 172 # 173 # generate_lir 174 # =================== 175 # Controls whether to generate direct 1-1 mapping LIR instruction for the MIR op 176 # Possible values: 177 # - attribute not specified (default): no code generated 178 # - true: generates corresponding LIR classes in LIROpsGenerated.h 179 # 180 # lir_temps 181 # =================== 182 # Specifies the number of temporary virtual registers, LDefinitions, used by 183 # the corresponding LIR op in case generate_lir is true. 184 # Possible values: 185 # - attribute not specified (default): number of temps is set to 0 186 # - number: sets number of temps max 15 187 # 188 # lir_result_type 189 # =============== 190 # Specifies the result_type of the corresponding LIR op in case generate_lir is 191 # true. 192 # Possible values: 193 # - attribute not specified (default): the LIR result type is based on the MIR 194 # op's result_type 195 # - none: the LIR instruction does not produce a result 196 # - result type: the LIR op's result type 197 198 # TODO(no-TI): try to remove this instruction. 199 - name: Start 200 201 # Instruction marking on entrypoint for on-stack replacement. 202 # OSR may occur at loop headers (at JSOp::LoopHead). 203 # There is at most one MOsrEntry per MIRGraph. 204 - name: OsrEntry 205 result_type: Pointer 206 207 - name: Nop 208 alias_set: none 209 clone: true 210 211 - name: LimitedTruncate 212 gen_boilerplate: false 213 214 - name: IntPtrLimitedTruncate 215 gen_boilerplate: false 216 217 - name: Int64LimitedTruncate 218 gen_boilerplate: false 219 220 - name: Constant 221 gen_boilerplate: false 222 223 - name: WasmNullConstant 224 gen_boilerplate: false 225 226 - name: WasmFloatConstant 227 gen_boilerplate: false 228 229 - name: Parameter 230 gen_boilerplate: false 231 232 - name: Callee 233 result_type: Object 234 movable: true 235 congruent_to: if_operands_equal 236 alias_set: none 237 can_recover: true 238 generate_lir: true 239 240 - name: IsConstructing 241 result_type: Boolean 242 movable: true 243 congruent_to: if_operands_equal 244 alias_set: none 245 generate_lir: true 246 247 - name: TableSwitch 248 gen_boilerplate: false 249 250 - name: Goto 251 gen_boilerplate: false 252 253 - name: Test 254 gen_boilerplate: false 255 256 - name: Return 257 gen_boilerplate: false 258 259 - name: Throw 260 operands: 261 value: Value 262 alias_set: custom 263 possibly_calls: true 264 generate_lir: true 265 266 - name: ThrowWithStack 267 operands: 268 value: Value 269 stack: Value 270 alias_set: custom 271 possibly_calls: true 272 generate_lir: true 273 274 - name: NewArray 275 gen_boilerplate: false 276 277 - name: NewArrayDynamicLength 278 operands: 279 length: Int32 280 arguments: 281 templateObject: JSObject* 282 initialHeap: gc::Heap 283 result_type: Object 284 # Need to throw if length is negative. 285 guard: true 286 # Throws if length is negative. 287 alias_set: custom 288 generate_lir: true 289 lir_temps: 1 290 291 - name: NewTypedArray 292 gen_boilerplate: false 293 294 - name: NewTypedArrayDynamicLength 295 operands: 296 length: Int32 297 arguments: 298 templateObject: JSObject* 299 initialHeap: gc::Heap 300 result_type: Object 301 guard: true 302 # Throws if length is negative. 303 alias_set: custom 304 possibly_calls: true 305 generate_lir: true 306 lir_temps: 3 307 308 # Create a new TypedArray from an Array (or Array-like object) or a TypedArray. 309 - name: NewTypedArrayFromArray 310 operands: 311 array: Object 312 arguments: 313 templateObject: JSObject* 314 initialHeap: gc::Heap 315 result_type: Object 316 guard: true 317 possibly_calls: true 318 generate_lir: true 319 320 # Create a new TypedArray from an ArrayBuffer (or SharedArrayBuffer). 321 - name: NewTypedArrayFromArrayBuffer 322 operands: 323 arrayBuffer: Object 324 byteOffset: Value 325 length: Value 326 arguments: 327 templateObject: JSObject* 328 initialHeap: gc::Heap 329 result_type: Object 330 guard: true 331 possibly_calls: true 332 generate_lir: true 333 334 - name: NewMapObject 335 arguments: 336 templateObject: JSObject* 337 result_type: Object 338 possibly_calls: true 339 340 - name: NewSetObject 341 arguments: 342 templateObject: JSObject* 343 result_type: Object 344 possibly_calls: true 345 346 - name: NewMapObjectFromIterable 347 operands: 348 iterable: Value 349 arguments: 350 templateObject: JSObject* 351 result_type: Object 352 possibly_calls: true 353 generate_lir: true 354 lir_temps: 2 355 356 - name: NewSetObjectFromIterable 357 operands: 358 iterable: Value 359 arguments: 360 templateObject: JSObject* 361 result_type: Object 362 possibly_calls: true 363 generate_lir: true 364 lir_temps: 2 365 366 - name: NewObject 367 gen_boilerplate: false 368 369 - name: NewPlainObject 370 gen_boilerplate: false 371 372 - name: NewArrayObject 373 gen_boilerplate: false 374 375 - name: NewIterator 376 gen_boilerplate: false 377 378 - name: ObjectState 379 gen_boilerplate: false 380 381 - name: ArrayState 382 gen_boilerplate: false 383 384 - name: BindFunction 385 gen_boilerplate: false 386 387 - name: NewBoundFunction 388 arguments: 389 templateObj: JSObject* 390 result_type: Object 391 alias_set: none 392 generate_lir: true 393 lir_temps: 1 394 395 - name: BoundFunctionNumArgs 396 operands: 397 object: Object 398 result_type: Int32 399 movable: true 400 congruent_to: if_operands_equal 401 # A bound function's state is immutable, so there is no 402 # implicit dependency. 403 alias_set: none 404 generate_lir: true 405 406 - name: GuardBoundFunctionIsConstructor 407 operands: 408 object: Object 409 result_type: Object 410 guard: true 411 movable: true 412 congruent_to: if_operands_equal 413 # The is-constructor flag is immutable for a bound function. 414 alias_set: none 415 generate_lir: true 416 lir_result_type: none 417 418 # Setting __proto__ in an object literal. 419 - name: MutateProto 420 operands: 421 object: Object 422 value: Value 423 result_type: None 424 possibly_calls: true 425 generate_lir: true 426 427 - name: InitPropGetterSetter 428 operands: 429 object: Object 430 value: Object 431 arguments: 432 name: PropertyName* 433 possibly_calls: true 434 generate_lir: true 435 436 - name: InitElemGetterSetter 437 operands: 438 object: Object 439 id: Value 440 value: Object 441 possibly_calls: true 442 generate_lir: true 443 444 - name: Call 445 gen_boilerplate: false 446 447 - name: CallClassHook 448 gen_boilerplate: false 449 450 - name: ApplyArgs 451 gen_boilerplate: false 452 453 - name: ApplyArgsObj 454 gen_boilerplate: false 455 456 - name: ApplyArray 457 gen_boilerplate: false 458 459 - name: ConstructArgs 460 gen_boilerplate: false 461 462 - name: ConstructArray 463 gen_boilerplate: false 464 465 - name: Bail 466 gen_boilerplate: false 467 generate_lir: true 468 469 - name: Unreachable 470 gen_boilerplate: false 471 472 # This op serves as a way to force the encoding of a snapshot, even if there 473 # is no resume point using it. This is useful to run MAssertRecoveredOnBailout 474 # assertions. 475 - name: EncodeSnapshot 476 guard: true 477 generate_lir: true 478 479 - name: AssertRecoveredOnBailout 480 gen_boilerplate: false 481 482 - name: AssertFloat32 483 gen_boilerplate: false 484 485 - name: Compare 486 gen_boilerplate: false 487 488 - name: StrictConstantCompareInt32 489 operands: 490 value: Value 491 arguments: 492 constant: int32_t 493 jsop: JSOp 494 can_recover: true 495 movable: true 496 alias_set: none 497 folds_to: custom 498 result_type: Boolean 499 generate_lir: true 500 lir_temps: 1 501 502 - name: StrictConstantCompareBoolean 503 operands: 504 value: Value 505 arguments: 506 constant: bool 507 jsop: JSOp 508 can_recover: true 509 movable: true 510 alias_set: none 511 folds_to: custom 512 result_type: Boolean 513 generate_lir: true 514 515 - name: SameValueDouble 516 operands: 517 left: Double 518 right: Double 519 result_type: Boolean 520 movable: true 521 congruent_to: if_operands_equal 522 alias_set: none 523 folds_to: custom 524 clone: true 525 generate_lir: true 526 lir_temps: 1 527 528 - name: SameValue 529 operands: 530 left: Value 531 right: Value 532 result_type: Boolean 533 movable: true 534 congruent_to: if_operands_equal 535 alias_set: none 536 folds_to: custom 537 clone: true 538 generate_lir: true 539 540 - name: Box 541 gen_boilerplate: false 542 543 - name: Unbox 544 gen_boilerplate: false 545 546 - name: AssertRange 547 gen_boilerplate: false 548 549 - name: AssertClass 550 gen_boilerplate: false 551 552 - name: AssertShape 553 gen_boilerplate: false 554 555 # Caller-side allocation of |this| for |new|: 556 # Constructs |this| when possible, else MagicValue(JS_IS_CONSTRUCTING). 557 - name: CreateThis 558 operands: 559 callee: Object 560 newTarget: Object 561 result_type: Value 562 # Performs a property read from |newTarget| iff |newTarget| is a JSFunction 563 # with an own |.prototype| property. 564 alias_set: custom 565 possibly_calls: true 566 generate_lir: true 567 568 - name: CreateArgumentsObject 569 gen_boilerplate: false 570 571 - name: CreateInlinedArgumentsObject 572 gen_boilerplate: false 573 574 - name: GetInlinedArgument 575 gen_boilerplate: false 576 577 - name: GetInlinedArgumentHole 578 gen_boilerplate: false 579 580 # Get argument from arguments object. 581 - name: GetArgumentsObjectArg 582 operands: 583 argsObject: Object 584 arguments: 585 argno: size_t 586 result_type: Value 587 congruent_to: custom 588 alias_set: custom 589 generate_lir: true 590 lir_temps: 1 591 592 # Set argument on arguments object. 593 - name: SetArgumentsObjectArg 594 operands: 595 argsObject: Object 596 value: Value 597 arguments: 598 argno: size_t 599 alias_set: custom 600 generate_lir: true 601 lir_temps: 1 602 603 # Load |arguments[index]| from a mapped or unmapped arguments object. Bails out 604 # when any elements were overridden or deleted. Also bails out if the index is 605 # out of bounds. 606 - name: LoadArgumentsObjectArg 607 operands: 608 argsObject: Object 609 index: Int32 610 result_type: Value 611 guard: true 612 congruent_to: if_operands_equal 613 alias_set: custom 614 generate_lir: true 615 lir_temps: 1 616 617 # Load |arguments[index]| from a mapped or unmapped arguments object. Bails out 618 # when any elements were overridden or deleted. Returns undefined if the index is 619 # out of bounds. 620 - name: LoadArgumentsObjectArgHole 621 operands: 622 argsObject: Object 623 index: Int32 624 result_type: Value 625 guard: true 626 congruent_to: if_operands_equal 627 alias_set: custom 628 generate_lir: true 629 lir_temps: 1 630 631 - name: InArgumentsObjectArg 632 operands: 633 argsObject: Object 634 index: Int32 635 result_type: Boolean 636 guard: true 637 congruent_to: if_operands_equal 638 alias_set: custom 639 generate_lir: true 640 lir_temps: 1 641 642 # Load |arguments.length|. Bails out if the length has been overriden. 643 - name: ArgumentsObjectLength 644 operands: 645 argsObject: Object 646 result_type: Int32 647 guard: true 648 movable: true 649 congruent_to: if_operands_equal 650 # Even though the "length" property is lazily resolved, it acts similar to 651 # a normal property load, so we can treat this operation like any other 652 # property read. 653 alias_set: custom 654 generate_lir: true 655 656 # Create an array from an arguments object. 657 - name: ArrayFromArgumentsObject 658 operands: 659 argsObject: Object 660 arguments: 661 shape: Shape* 662 result_type: Object 663 possibly_calls: true 664 generate_lir: true 665 666 # Guard that the given flags are not set on the arguments object. 667 - name: GuardArgumentsObjectFlags 668 operands: 669 argsObject: Object 670 arguments: 671 flags: uint32_t 672 result_type: Object 673 movable: true 674 guard: true 675 congruent_to: custom 676 # The flags are packed with the length in a fixed private slot. 677 alias_set: custom 678 generate_lir: true 679 lir_result_type: none 680 lir_temps: 1 681 682 # Guard cx->realm() == obj->realm(). 683 - name: GuardObjectHasSameRealm 684 operands: 685 object: Object 686 result_type: Object 687 guard: true 688 movable: true 689 congruent_to: if_operands_equal 690 # The object's realm is immutable. The context's realm must always be the same 691 # realm for this compilation. 692 alias_set: none 693 generate_lir: true 694 lir_result_type: none 695 lir_temps: 1 696 697 - name: LoadScriptedProxyHandler 698 operands: 699 object: Object 700 result_type: Object 701 guard: true 702 congruent_to: if_operands_equal 703 alias_set: none 704 generate_lir: true 705 706 #ifdef JS_PUNBOX64 707 - name: CheckScriptedProxyGetResult 708 operands: 709 target: Value 710 id: Value 711 value: Value 712 guard: true 713 alias_set: custom 714 generate_lir: true 715 lir_temps: 2 716 #endif 717 718 - name: IdToStringOrSymbol 719 operands: 720 idVal: Value 721 result_type: Value 722 congruent_to: if_operands_equal 723 alias_set: none 724 folds_to: custom 725 generate_lir: true 726 lir_temps: 1 727 728 # Given a MIRType::Value A and a MIRType::Object B: 729 # If the Value may be safely unboxed to an Object, return Object(A). 730 # Otherwise, return B. 731 # Used to implement return behavior for inlined constructors. 732 - name: ReturnFromCtor 733 operands: 734 value: Value 735 object: Object 736 result_type: Object 737 folds_to: custom 738 congruent_to: if_operands_equal 739 alias_set: none 740 generate_lir: true 741 742 - name: ToDouble 743 gen_boilerplate: false 744 745 - name: ToFloat32 746 gen_boilerplate: false 747 748 - name: ToFloat16 749 gen_boilerplate: false 750 751 # Converts a uint32 to a double (coming from wasm). 752 - name: WasmUnsignedToDouble 753 operands: 754 def: Int32 755 type_policy: none 756 result_type: Double 757 movable: true 758 folds_to: custom 759 congruent_to: if_operands_equal 760 alias_set: none 761 clone: true 762 763 - name: WasmUnsignedToFloat32 764 gen_boilerplate: false 765 766 - name: WrapInt64ToInt32 767 gen_boilerplate: false 768 769 - name: ExtendInt32ToInt64 770 gen_boilerplate: false 771 772 - name: WasmBuiltinTruncateToInt64 773 gen_boilerplate: false 774 775 - name: WasmTruncateToInt64 776 gen_boilerplate: false 777 778 - name: WasmTruncateToInt32 779 gen_boilerplate: false 780 781 - name: WasmAnyRefFromJSValue 782 operands: 783 def: Value 784 result_type: WasmAnyRef 785 congruent_to: if_operands_equal 786 alias_set: none 787 generate_lir: true 788 lir_temps: 1 789 790 - name: WasmAnyRefFromJSObject 791 operands: 792 def: Object 793 type_policy: none 794 result_type: WasmAnyRef 795 congruent_to: if_operands_equal 796 alias_set: none 797 generate_lir: true 798 generate_lir: true 799 800 - name: WasmAnyRefFromJSString 801 operands: 802 def: String 803 type_policy: none 804 result_type: WasmAnyRef 805 congruent_to: if_operands_equal 806 alias_set: none 807 generate_lir: true 808 809 - name: WasmAnyRefIsJSString 810 operands: 811 input: WasmAnyRef 812 type_policy: none 813 result_type: Int32 814 congruent_to: if_operands_equal 815 alias_set: none 816 movable: true 817 clone: true 818 generate_lir: true 819 lir_temps: 1 820 821 - name: WasmTrapIfAnyRefIsNotJSString 822 operands: 823 input: WasmAnyRef 824 arguments: 825 trap: wasm::Trap 826 trapSiteDesc: wasm::TrapSiteDesc 827 type_policy: none 828 congruent_to: if_operands_equal 829 alias_set: none 830 guard: true 831 clone: true 832 generate_lir: true 833 lir_temps: 1 834 835 - name: WasmAnyRefJSStringLength 836 operands: 837 input: WasmAnyRef 838 arguments: 839 trap: wasm::Trap 840 trapSiteDesc: wasm::TrapSiteDesc 841 type_policy: none 842 result_type: Int32 843 congruent_to: if_operands_equal 844 alias_set: none 845 guard: true 846 clone: true 847 generate_lir: true 848 lir_temps: 1 849 850 - name: WasmNewI31Ref 851 gen_boilerplate: false 852 853 - name: WasmI31RefGet 854 operands: 855 input: WasmAnyRef 856 arguments: 857 wideningOp: wasm::FieldWideningOp 858 type_policy: none 859 result_type: Int32 860 congruent_to: if_operands_equal 861 alias_set: none 862 generate_lir: true 863 864 - name: Int32ToIntPtr 865 gen_boilerplate: false 866 867 - name: NonNegativeIntPtrToInt32 868 gen_boilerplate: false 869 870 - name: IntPtrToDouble 871 gen_boilerplate: false 872 873 - name: AdjustDataViewLength 874 gen_boilerplate: false 875 876 - name: Int64ToFloatingPoint 877 gen_boilerplate: false 878 879 - name: BuiltinInt64ToFloatingPoint 880 gen_boilerplate: false 881 882 - name: ToNumberInt32 883 gen_boilerplate: false 884 885 - name: BooleanToInt32 886 operands: 887 input: Boolean 888 result_type: Int32 889 movable: true 890 compute_range: custom 891 folds_to: custom 892 congruent_to: if_operands_equal 893 alias_set: none 894 895 - name: TruncateToInt32 896 gen_boilerplate: false 897 898 - name: WasmBuiltinTruncateToInt32 899 gen_boilerplate: false 900 901 - name: ToBigInt 902 gen_boilerplate: false 903 904 - name: ToInt64 905 gen_boilerplate: false 906 907 - name: TruncateBigIntToInt64 908 gen_boilerplate: false 909 910 - name: Int64ToBigInt 911 gen_boilerplate: false 912 913 - name: Int64ToIntPtr 914 gen_boilerplate: false 915 916 - name: IntPtrToInt64 917 gen_boilerplate: false 918 919 - name: ToString 920 gen_boilerplate: false 921 922 - name: BitNot 923 gen_boilerplate: false 924 925 - name: TypeOf 926 gen_boilerplate: false 927 928 - name: TypeOfName 929 operands: 930 input: Int32 931 result_type: String 932 movable: true 933 folds_to: custom 934 congruent_to: if_operands_equal 935 alias_set: none 936 can_recover: true 937 generate_lir: true 938 939 - name: TypeOfIs 940 gen_boilerplate: false 941 942 - name: ToAsyncIter 943 operands: 944 iterator: Object 945 nextMethod: Value 946 result_type: Object 947 possibly_calls: true 948 generate_lir: true 949 950 - name: ToPropertyKeyCache 951 operands: 952 input: Value 953 result_type: Value 954 generate_lir: true 955 956 - name: BitAnd 957 gen_boilerplate: false 958 959 - name: BitOr 960 gen_boilerplate: false 961 962 - name: BitXor 963 gen_boilerplate: false 964 965 - name: Lsh 966 gen_boilerplate: false 967 968 - name: Rsh 969 gen_boilerplate: false 970 971 - name: Ursh 972 gen_boilerplate: false 973 974 - name: SignExtendInt32 975 gen_boilerplate: false 976 977 - name: SignExtendInt64 978 gen_boilerplate: false 979 980 - name: SignExtendIntPtr 981 gen_boilerplate: false 982 983 - name: MinMax 984 gen_boilerplate: false 985 986 - name: MinMaxArray 987 gen_boilerplate: false 988 989 - name: Abs 990 gen_boilerplate: false 991 992 - name: Clz 993 gen_boilerplate: false 994 995 - name: Ctz 996 gen_boilerplate: false 997 998 - name: Popcnt 999 gen_boilerplate: false 1000 1001 - name: Sqrt 1002 gen_boilerplate: false 1003 1004 - name: CopySign 1005 gen_boilerplate: false 1006 1007 # Inline implementation of atan2 (arctangent of y/x). 1008 - name: Atan2 1009 operands: 1010 y: Double 1011 x: Double 1012 result_type: Double 1013 movable: true 1014 congruent_to: if_operands_equal 1015 alias_set: none 1016 possibly_calls: true 1017 can_recover: true 1018 clone: true 1019 1020 - name: Hypot 1021 gen_boilerplate: false 1022 1023 - name: Pow 1024 gen_boilerplate: false 1025 1026 - name: PowHalf 1027 gen_boilerplate: false 1028 1029 - name: Random 1030 result_type: Double 1031 alias_set: custom 1032 compute_range: custom 1033 can_recover: custom 1034 clone: true 1035 generate_lir: true 1036 lir_temps: 1 1037 lir_temps64: 2 1038 1039 - name: Sign 1040 gen_boilerplate: false 1041 1042 - name: MathFunction 1043 gen_boilerplate: false 1044 1045 - name: Add 1046 gen_boilerplate: false 1047 1048 - name: Sub 1049 gen_boilerplate: false 1050 1051 - name: Mul 1052 gen_boilerplate: false 1053 1054 - name: Div 1055 gen_boilerplate: false 1056 1057 - name: WasmBuiltinDivI64 1058 gen_boilerplate: false 1059 1060 - name: Mod 1061 gen_boilerplate: false 1062 1063 - name: WasmBuiltinModD 1064 gen_boilerplate: false 1065 1066 - name: WasmBuiltinModI64 1067 gen_boilerplate: false 1068 1069 - name: BigIntAdd 1070 gen_boilerplate: false 1071 1072 - name: BigIntSub 1073 gen_boilerplate: false 1074 1075 - name: BigIntMul 1076 gen_boilerplate: false 1077 1078 - name: BigIntDiv 1079 gen_boilerplate: false 1080 1081 - name: BigIntMod 1082 gen_boilerplate: false 1083 1084 - name: BigIntPow 1085 gen_boilerplate: false 1086 1087 - name: BigIntBitAnd 1088 gen_boilerplate: false 1089 1090 - name: BigIntBitOr 1091 gen_boilerplate: false 1092 1093 - name: BigIntBitXor 1094 gen_boilerplate: false 1095 1096 - name: BigIntLsh 1097 gen_boilerplate: false 1098 1099 - name: BigIntRsh 1100 gen_boilerplate: false 1101 1102 - name: BigIntIncrement 1103 gen_boilerplate: false 1104 1105 - name: BigIntDecrement 1106 gen_boilerplate: false 1107 1108 - name: BigIntNegate 1109 gen_boilerplate: false 1110 1111 - name: BigIntBitNot 1112 gen_boilerplate: false 1113 1114 - name: BigIntToIntPtr 1115 operands: 1116 input: BigInt 1117 result_type: IntPtr 1118 movable: true 1119 congruent_to: if_operands_equal 1120 alias_set: none 1121 folds_to: custom 1122 can_recover: true 1123 clone: true 1124 generate_lir: true 1125 1126 - name: IntPtrToBigInt 1127 operands: 1128 input: IntPtr 1129 result_type: BigInt 1130 movable: true 1131 congruent_to: if_operands_equal 1132 alias_set: none 1133 folds_to: custom 1134 can_recover: true 1135 clone: true 1136 generate_lir: true 1137 lir_temps: 1 1138 1139 - name: BigIntPtrAdd 1140 gen_boilerplate: false 1141 1142 - name: BigIntPtrSub 1143 gen_boilerplate: false 1144 1145 - name: BigIntPtrMul 1146 gen_boilerplate: false 1147 1148 - name: BigIntPtrDiv 1149 gen_boilerplate: false 1150 1151 - name: BigIntPtrMod 1152 gen_boilerplate: false 1153 1154 - name: BigIntPtrPow 1155 gen_boilerplate: false 1156 1157 - name: BigIntPtrBitAnd 1158 gen_boilerplate: false 1159 1160 - name: BigIntPtrBitOr 1161 gen_boilerplate: false 1162 1163 - name: BigIntPtrBitXor 1164 gen_boilerplate: false 1165 1166 - name: BigIntPtrLsh 1167 gen_boilerplate: false 1168 1169 - name: BigIntPtrRsh 1170 gen_boilerplate: false 1171 1172 - name: BigIntPtrBitNot 1173 gen_boilerplate: false 1174 1175 - name: Int32ToStringWithBase 1176 operands: 1177 input: Int32 1178 base: Int32 1179 arguments: 1180 lowerCase: bool 1181 result_type: String 1182 movable: true 1183 congruent_to: custom 1184 alias_set: none 1185 generate_lir: true 1186 lir_temps: 2 1187 1188 - name: NumberParseInt 1189 operands: 1190 string: String 1191 radix: Int32 1192 result_type: Value 1193 movable: true 1194 congruent_to: if_operands_equal 1195 alias_set: none 1196 possibly_calls: true 1197 generate_lir: true 1198 lir_temps: 1 1199 1200 - name: DoubleParseInt 1201 operands: 1202 number: Double 1203 result_type: Int32 1204 movable: true 1205 congruent_to: if_operands_equal 1206 alias_set: none 1207 generate_lir: true 1208 lir_temps: 1 1209 1210 - name: Concat 1211 gen_boilerplate: false 1212 1213 - name: LinearizeString 1214 operands: 1215 string: String 1216 result_type: String 1217 movable: true 1218 congruent_to: if_operands_equal 1219 # Strings are immutable, so there is no implicit dependency. 1220 alias_set: none 1221 generate_lir: true 1222 1223 - name: LinearizeForCharAccess 1224 operands: 1225 string: String 1226 index: Int32 1227 result_type: String 1228 movable: true 1229 congruent_to: if_operands_equal 1230 # Strings are immutable, so there is no implicit dependency. 1231 alias_set: none 1232 generate_lir: true 1233 1234 - name: LinearizeForCodePointAccess 1235 operands: 1236 string: String 1237 index: Int32 1238 result_type: String 1239 movable: true 1240 congruent_to: if_operands_equal 1241 # Strings are immutable, so there is no implicit dependency. 1242 alias_set: none 1243 generate_lir: true 1244 lir_temps: 1 1245 1246 - name: ToRelativeStringIndex 1247 operands: 1248 index: Int32 1249 length: Int32 1250 result_type: Int32 1251 movable: true 1252 folds_to: custom 1253 congruent_to: if_operands_equal 1254 alias_set: none 1255 generate_lir: true 1256 1257 - name: CharCodeAt 1258 operands: 1259 string: String 1260 index: Int32 1261 result_type: Int32 1262 movable: true 1263 folds_to: custom 1264 congruent_to: if_operands_equal 1265 # Strings are immutable, so there is no implicit dependency. 1266 alias_set: none 1267 compute_range: custom 1268 can_recover: true 1269 clone: true 1270 generate_lir: true 1271 lir_temps: 2 1272 1273 # Similar to CharCodeAt, but returns a negative value on out-of-bounds access. 1274 - name: CharCodeAtOrNegative 1275 operands: 1276 string: String 1277 index: Int32 1278 result_type: Int32 1279 movable: true 1280 congruent_to: if_operands_equal 1281 # Strings are immutable, so there is no implicit dependency. 1282 alias_set: none 1283 generate_lir: true 1284 lir_temps: 2 1285 1286 - name: CodePointAt 1287 operands: 1288 string: String 1289 index: Int32 1290 result_type: Int32 1291 movable: true 1292 folds_to: custom 1293 congruent_to: if_operands_equal 1294 # Strings are immutable, so there is no implicit dependency. 1295 alias_set: none 1296 compute_range: custom 1297 clone: true 1298 generate_lir: true 1299 lir_temps: 2 1300 1301 # Similar to CodePointAt, but returns a negative value on out-of-bounds access. 1302 - name: CodePointAtOrNegative 1303 operands: 1304 string: String 1305 index: Int32 1306 result_type: Int32 1307 movable: true 1308 congruent_to: if_operands_equal 1309 # Strings are immutable, so there is no implicit dependency. 1310 alias_set: none 1311 generate_lir: true 1312 lir_temps: 2 1313 1314 # Return the input if non-negative, otherwise return NaN. 1315 - name: NegativeToNaN 1316 operands: 1317 input: Int32 1318 result_type: Value 1319 movable: true 1320 congruent_to: if_operands_equal 1321 alias_set: none 1322 generate_lir: true 1323 1324 # Return the input if non-negative, otherwise return undefined. 1325 - name: NegativeToUndefined 1326 operands: 1327 input: Int32 1328 result_type: Value 1329 movable: true 1330 congruent_to: if_operands_equal 1331 alias_set: none 1332 generate_lir: true 1333 1334 # Convert uint16 character code to a string. 1335 - name: FromCharCode 1336 operands: 1337 code: Int32 1338 result_type: String 1339 movable: true 1340 congruent_to: if_operands_equal 1341 alias_set: none 1342 can_recover: true 1343 clone: true 1344 generate_lir: true 1345 1346 # Similar to FromCharCode, but returns the empty string if the input is negative. 1347 - name: FromCharCodeEmptyIfNegative 1348 operands: 1349 code: Int32 1350 result_type: String 1351 movable: true 1352 congruent_to: if_operands_equal 1353 alias_set: none 1354 can_recover: true 1355 clone: true 1356 generate_lir: true 1357 1358 # Similar to FromCharCode, but returns the |undefined| if the input is negative. 1359 - name: FromCharCodeUndefinedIfNegative 1360 operands: 1361 code: Int32 1362 result_type: Value 1363 movable: true 1364 congruent_to: if_operands_equal 1365 alias_set: none 1366 generate_lir: true 1367 1368 # Convert uint32 code point to a string. 1369 - name: FromCodePoint 1370 operands: 1371 codePoint: Int32 1372 result_type: String 1373 guard: true 1374 movable: true 1375 congruent_to: if_operands_equal 1376 alias_set: none 1377 clone: true 1378 generate_lir: true 1379 lir_temps: 2 1380 1381 # Test if a string includes the search string. 1382 - name: StringIncludes 1383 operands: 1384 string: String 1385 searchString: String 1386 result_type: Boolean 1387 movable: true 1388 congruent_to: if_operands_equal 1389 alias_set: none 1390 possibly_calls: true 1391 generate_lir: true 1392 1393 # Search for the first index of the search string. 1394 - name: StringIndexOf 1395 operands: 1396 string: String 1397 searchString: String 1398 result_type: Int32 1399 movable: true 1400 congruent_to: if_operands_equal 1401 alias_set: none 1402 possibly_calls: true 1403 generate_lir: true 1404 1405 # Search for the last index of the search string. 1406 - name: StringLastIndexOf 1407 operands: 1408 string: String 1409 searchString: String 1410 result_type: Int32 1411 movable: true 1412 congruent_to: if_operands_equal 1413 alias_set: none 1414 possibly_calls: true 1415 generate_lir: true 1416 1417 # Test if a string starts with the search string. 1418 - name: StringStartsWith 1419 operands: 1420 string: String 1421 searchString: String 1422 result_type: Boolean 1423 movable: true 1424 congruent_to: if_operands_equal 1425 alias_set: none 1426 possibly_calls: true 1427 generate_lir: true 1428 1429 # Test if a string ends with the search string. 1430 - name: StringEndsWith 1431 operands: 1432 string: String 1433 searchString: String 1434 result_type: Boolean 1435 movable: true 1436 congruent_to: if_operands_equal 1437 alias_set: none 1438 possibly_calls: true 1439 generate_lir: true 1440 1441 - name: StringConvertCase 1442 gen_boilerplate: false 1443 1444 - name: CharCodeConvertCase 1445 gen_boilerplate: false 1446 1447 # Index of first non-whitespace character. 1448 - name: StringTrimStartIndex 1449 operands: 1450 string: String 1451 result_type: Int32 1452 movable: true 1453 congruent_to: if_operands_equal 1454 alias_set: none 1455 generate_lir: true 1456 1457 # Index of last non-whitespace character. 1458 - name: StringTrimEndIndex 1459 operands: 1460 string: String 1461 start: Int32 1462 result_type: Int32 1463 movable: true 1464 congruent_to: if_operands_equal 1465 alias_set: none 1466 generate_lir: true 1467 1468 - name: StringSplit 1469 operands: 1470 string: String 1471 separator: String 1472 result_type: Object 1473 possibly_calls: true 1474 # Although this instruction returns a new array, we don't have to mark 1475 # it as store instruction, see also MNewArray. 1476 alias_set: none 1477 can_recover: true 1478 generate_lir: true 1479 1480 - name: BoxNonStrictThis 1481 operands: 1482 def: Value 1483 arguments: 1484 globalThis: JSObject* 1485 result_type: Object 1486 folds_to: custom 1487 possibly_calls: true 1488 # This instruction can allocate a new object for wrapped primitives, but 1489 # has no effect on existing objects. 1490 alias_set: none 1491 1492 - name: ImplicitThis 1493 operands: 1494 env: Object 1495 result_type: Value 1496 generate_lir: true 1497 1498 - name: Phi 1499 gen_boilerplate: false 1500 1501 - name: Beta 1502 gen_boilerplate: false 1503 1504 - name: NaNToZero 1505 gen_boilerplate: false 1506 1507 - name: OsrValue 1508 gen_boilerplate: false 1509 1510 - name: OsrEnvironmentChain 1511 gen_boilerplate: false 1512 1513 - name: OsrArgumentsObject 1514 gen_boilerplate: false 1515 1516 - name: OsrReturnValue 1517 gen_boilerplate: false 1518 1519 - name: BinaryCache 1520 gen_boilerplate: false 1521 1522 - name: UnaryCache 1523 operands: 1524 input: Value 1525 result_type: Value 1526 generate_lir: true 1527 1528 # Checks whether we need to fire the interrupt handler. 1529 - name: CheckOverRecursed 1530 guard: true 1531 alias_set: none 1532 generate_lir: true 1533 1534 # Check whether we need to fire the interrupt handler. 1535 - name: InterruptCheck 1536 guard: true 1537 alias_set: none 1538 generate_lir: true 1539 1540 - name: WasmInterruptCheck 1541 gen_boilerplate: false 1542 1543 - name: WasmTrap 1544 gen_boilerplate: false 1545 generate_lir: true 1546 1547 - name: LexicalCheck 1548 gen_boilerplate: false 1549 1550 # Unconditionally throw an uninitialized let error. 1551 - name: ThrowRuntimeLexicalError 1552 arguments: 1553 errorNumber: unsigned 1554 result_type: None 1555 guard: true 1556 alias_set: custom 1557 possibly_calls: true 1558 generate_lir: true 1559 1560 - name: ThrowMsg 1561 gen_boilerplate: false 1562 1563 # In the prologues of global and eval scripts, check for redeclarations and 1564 # initialize bindings. 1565 - name: GlobalDeclInstantiation 1566 guard: true 1567 generate_lir: true 1568 1569 - name: RegExp 1570 arguments: 1571 source: RegExpObject* 1572 hasShared: bool 1573 result_type: Object 1574 possibly_calls: true 1575 alias_set: none 1576 1577 - name: RegExpMatcher 1578 operands: 1579 regexp: Object 1580 string: String 1581 lastIndex: Int32 1582 result_type: Value 1583 possibly_calls: true 1584 generate_lir: true 1585 1586 # Note: this instruction writes to cx->regExpSearcherLastLimit. 1587 # See also MRegExpSearcherLastLimit. 1588 - name: RegExpSearcher 1589 operands: 1590 regexp: Object 1591 string: String 1592 lastIndex: Int32 1593 result_type: Int32 1594 possibly_calls: true 1595 generate_lir: true 1596 1597 # This instruction loads cx->regExpSearcherLastLimit. We don't have a 1598 # specialized alias set for this so just use the default alias set similar to 1599 # the MRegExpSearcher instruction that precedes it. 1600 - name: RegExpSearcherLastLimit 1601 result_type: Int32 1602 generate_lir: true 1603 lir_temps: 1 1604 1605 - name: RegExpExecMatch 1606 operands: 1607 regexp: Object 1608 string: String 1609 result_type: Value 1610 possibly_calls: true 1611 generate_lir: true 1612 1613 - name: RegExpExecTest 1614 operands: 1615 regexp: Object 1616 string: String 1617 result_type: Boolean 1618 possibly_calls: true 1619 generate_lir: true 1620 1621 - name: RegExpHasCaptureGroups 1622 operands: 1623 regexp: Object 1624 input: String 1625 result_type: Boolean 1626 possibly_calls: true 1627 1628 - name: GetFirstDollarIndex 1629 gen_boilerplate: false 1630 1631 - name: StringReplace 1632 gen_boilerplate: false 1633 1634 - name: Substr 1635 operands: 1636 string: String 1637 begin: Int32 1638 length: Int32 1639 result_type: String 1640 folds_to: custom 1641 congruent_to: if_operands_equal 1642 alias_set: none 1643 can_recover: true 1644 generate_lir: true 1645 lir_temps: 3 1646 1647 - name: ModuleMetadata 1648 arguments: 1649 module: JSObject* 1650 result_type: Object 1651 possibly_calls: true 1652 generate_lir: true 1653 1654 - name: DynamicImport 1655 operands: 1656 specifier: Value 1657 options: Value 1658 result_type: Object 1659 possibly_calls: true 1660 generate_lir: true 1661 1662 - name: Lambda 1663 gen_boilerplate: false 1664 1665 - name: FunctionWithProto 1666 gen_boilerplate: false 1667 1668 - name: SetFunName 1669 operands: 1670 fun: Object 1671 name: Value 1672 arguments: 1673 prefixKind: uint8_t 1674 result_type: None 1675 possibly_calls: true 1676 generate_lir: true 1677 1678 # Returns obj->slots. 1679 - name: Slots 1680 operands: 1681 object: Object 1682 result_type: Slots 1683 movable: true 1684 congruent_to: if_operands_equal 1685 alias_set: custom 1686 might_alias: custom 1687 clone: true 1688 generate_lir: true 1689 1690 # Returns obj->elements. 1691 - name: Elements 1692 operands: 1693 object: Object 1694 result_type: Elements 1695 movable: true 1696 congruent_to: if_operands_equal 1697 alias_set: custom 1698 clone: true 1699 generate_lir: true 1700 1701 # Load the initialized length from an elements header. 1702 - name: InitializedLength 1703 operands: 1704 elements: Elements 1705 type_policy: none 1706 result_type: Int32 1707 movable: true 1708 congruent_to: if_operands_equal 1709 alias_set: custom 1710 compute_range: custom 1711 clone: true 1712 generate_lir: true 1713 1714 # Store to the initialized length in an elements header. Note the input is an 1715 # *index*, one less than the desired initialized length. 1716 - name: SetInitializedLength 1717 operands: 1718 elements: Elements 1719 index: Int32 1720 type_policy: none 1721 alias_set: custom 1722 clone: true 1723 generate_lir: true 1724 1725 # Load the array length from an elements header. 1726 - name: ArrayLength 1727 operands: 1728 elements: Elements 1729 type_policy: none 1730 result_type: Int32 1731 movable: true 1732 congruent_to: if_operands_equal 1733 folds_to: custom 1734 alias_set: custom 1735 compute_range: custom 1736 clone: true 1737 generate_lir: true 1738 1739 # Store to the length in an elements header. Note the input is an *index*, one 1740 # less than the desired length. 1741 - name: SetArrayLength 1742 operands: 1743 elements: Elements 1744 index: Int32 1745 type_policy: none 1746 alias_set: custom 1747 generate_lir: true 1748 1749 # Load the function length. Bails for functions with lazy scripts or a 1750 # resolved "length" property. 1751 - name: FunctionLength 1752 operands: 1753 function: Object 1754 result_type: Int32 1755 guard: true 1756 congruent_to: if_operands_equal 1757 # Even though the "length" property is lazily resolved, it acts similar to 1758 # a normal property load, so we can treat this operation like any other 1759 # property read. 1760 alias_set: custom 1761 generate_lir: true 1762 1763 # Load the function name. Bails for bound functions when the bound function 1764 # name prefix isn't present or functions with a resolved "name" property. 1765 - name: FunctionName 1766 operands: 1767 function: Object 1768 result_type: String 1769 guard: true 1770 congruent_to: if_operands_equal 1771 # Even though the "name" property is lazily resolved, it acts similar to 1772 # a normal property load, so we can treat this operation like any other 1773 # property read. 1774 alias_set: custom 1775 generate_lir: true 1776 1777 - name: GetNextEntryForIterator 1778 gen_boilerplate: false 1779 1780 # Read the byte length of an array buffer as IntPtr. 1781 - name: ArrayBufferByteLength 1782 operands: 1783 object: Object 1784 result_type: IntPtr 1785 movable: true 1786 congruent_to: if_operands_equal 1787 alias_set: custom 1788 generate_lir: true 1789 1790 # Read the length of an array buffer view. 1791 - name: ArrayBufferViewLength 1792 operands: 1793 object: Object 1794 result_type: IntPtr 1795 movable: true 1796 congruent_to: if_operands_equal 1797 alias_set: custom 1798 compute_range: custom 1799 generate_lir: true 1800 1801 # Read the byteOffset of an array buffer view. 1802 - name: ArrayBufferViewByteOffset 1803 operands: 1804 object: Object 1805 result_type: IntPtr 1806 movable: true 1807 congruent_to: if_operands_equal 1808 alias_set: custom 1809 compute_range: custom 1810 generate_lir: true 1811 1812 # Read the elements of an array buffer view. 1813 - name: ArrayBufferViewElements 1814 operands: 1815 object: Object 1816 result_type: Elements 1817 movable: true 1818 congruent_to: if_operands_equal 1819 alias_set: custom 1820 clone: true 1821 generate_lir: true 1822 1823 # Read the elements of an array buffer view and adjust it with the given offset. 1824 - name: ArrayBufferViewElementsWithOffset 1825 operands: 1826 object: Object 1827 offset: IntPtr 1828 arguments: 1829 elementType: Scalar::Type 1830 result_type: Elements 1831 alias_set: custom 1832 generate_lir: true 1833 1834 # Read the length of a resizable typed array. 1835 - name: ResizableTypedArrayLength 1836 operands: 1837 object: Object 1838 arguments: 1839 requiresMemoryBarrier: MemoryBarrierRequirement 1840 result_type: IntPtr 1841 # Not removable or movable when a barrier is needed. 1842 guard: true 1843 movable: false 1844 congruent_to: custom 1845 alias_set: custom 1846 compute_range: custom 1847 generate_lir: true 1848 lir_temps: 1 1849 1850 # Read the byteLength of a resizable dataview. 1851 - name: ResizableDataViewByteLength 1852 operands: 1853 object: Object 1854 arguments: 1855 requiresMemoryBarrier: MemoryBarrierRequirement 1856 result_type: IntPtr 1857 # Not removable or movable when a barrier is needed. 1858 guard: true 1859 movable: false 1860 congruent_to: custom 1861 alias_set: custom 1862 compute_range: custom 1863 generate_lir: true 1864 lir_temps: 1 1865 1866 # Read the byte length of a growable shared array buffer as IntPtr. 1867 - name: GrowableSharedArrayBufferByteLength 1868 operands: 1869 object: Object 1870 result_type: IntPtr 1871 guard: true 1872 movable: false 1873 alias_set: custom 1874 generate_lir: true 1875 1876 # Return the element size of a typed array. 1877 - name: TypedArrayElementSize 1878 operands: 1879 object: Object 1880 result_type: Int32 1881 movable: true 1882 congruent_to: if_operands_equal 1883 # Class is immutable. See also MHasClass. 1884 alias_set: none 1885 compute_range: custom 1886 generate_lir: true 1887 1888 # Guard an ArrayBufferView has an attached ArrayBuffer. 1889 - name: GuardHasAttachedArrayBuffer 1890 operands: 1891 object: Object 1892 result_type: Object 1893 guard: true 1894 movable: true 1895 congruent_to: if_operands_equal 1896 alias_set: custom 1897 generate_lir: true 1898 lir_result_type: none 1899 lir_temps: 1 1900 1901 # Guard a resizable typed array is in-bounds. 1902 - name: GuardResizableArrayBufferViewInBounds 1903 operands: 1904 object: Object 1905 result_type: Object 1906 guard: true 1907 movable: true 1908 congruent_to: if_operands_equal 1909 alias_set: custom 1910 generate_lir: true 1911 lir_result_type: none 1912 lir_temps: 1 1913 1914 # Guard a resizable typed array is in-bounds or detached. 1915 - name: GuardResizableArrayBufferViewInBoundsOrDetached 1916 operands: 1917 object: Object 1918 result_type: Object 1919 guard: true 1920 movable: true 1921 congruent_to: if_operands_equal 1922 alias_set: custom 1923 generate_lir: true 1924 lir_result_type: none 1925 lir_temps: 1 1926 1927 # Inline TypedArray.prototype.fill 1928 - name: TypedArrayFill 1929 gen_boilerplate: false 1930 1931 # Inlined TypedArray.prototype.set 1932 - name: TypedArraySet 1933 operands: 1934 target: Object 1935 source: Object 1936 offset: IntPtr 1937 arguments: 1938 canUseBitwiseCopy: bool 1939 alias_set: custom 1940 possibly_calls: true 1941 generate_lir: true 1942 1943 - name: TypedArraySetFromSubarray 1944 operands: 1945 target: Object 1946 source: Object 1947 offset: IntPtr 1948 sourceOffset: IntPtr 1949 sourceLength: IntPtr 1950 arguments: 1951 canUseBitwiseCopy: bool 1952 alias_set: custom 1953 possibly_calls: true 1954 generate_lir: true 1955 1956 - name: GuardTypedArraySetOffset 1957 operands: 1958 offset: IntPtr 1959 targetLength: IntPtr 1960 sourceLength: IntPtr 1961 result_type: IntPtr 1962 guard: true 1963 movable: true 1964 congruent_to: if_operands_equal 1965 alias_set: none 1966 generate_lir: true 1967 lir_result_type: none 1968 lir_temps: 1 1969 1970 # Inlined TypedArray.prototype.subarray 1971 - name: TypedArraySubarray 1972 gen_boilerplate: false 1973 1974 - name: ToIntegerIndex 1975 operands: 1976 index: IntPtr 1977 length: IntPtr 1978 result_type: IntPtr 1979 alias_set: none 1980 folds_to: custom 1981 generate_lir: true 1982 1983 - name: GuardNumberToIntPtrIndex 1984 gen_boilerplate: false 1985 1986 - name: KeepAliveObject 1987 operands: 1988 object: Object 1989 result_type: None 1990 guard: true 1991 generate_lir: true 1992 1993 - name: DebugEnterGCUnsafeRegion 1994 result_type: None 1995 guard: true 1996 alias_set: none 1997 generate_lir: true 1998 lir_temps: 1 1999 2000 - name: DebugLeaveGCUnsafeRegion 2001 result_type: None 2002 guard: true 2003 alias_set: none 2004 generate_lir: true 2005 lir_temps: 1 2006 2007 - name: Not 2008 gen_boilerplate: false 2009 2010 - name: BoundsCheck 2011 gen_boilerplate: false 2012 2013 - name: BoundsCheckLower 2014 gen_boilerplate: false 2015 2016 - name: SpectreMaskIndex 2017 gen_boilerplate: false 2018 2019 - name: LoadElement 2020 gen_boilerplate: false 2021 2022 - name: LoadElementAndUnbox 2023 gen_boilerplate: false 2024 2025 - name: LoadElementHole 2026 gen_boilerplate: false 2027 2028 - name: StoreElement 2029 gen_boilerplate: false 2030 2031 - name: StoreHoleValueElement 2032 gen_boilerplate: false 2033 2034 - name: StoreElementHole 2035 gen_boilerplate: false 2036 2037 - name: ArrayPopShift 2038 gen_boilerplate: false 2039 2040 # Array.prototype.push on a dense array. Returns the new array length. 2041 - name: ArrayPush 2042 operands: 2043 object: Object 2044 value: Value 2045 result_type: Int32 2046 alias_set: custom 2047 compute_range: custom 2048 clone: true 2049 generate_lir: true 2050 lir_temps: 2 2051 2052 # Array.prototype.slice on a dense array. 2053 - name: ArraySlice 2054 operands: 2055 object: Object 2056 begin: Int32 2057 end: Int32 2058 arguments: 2059 templateObj: JSObject* 2060 initialHeap: gc::Heap 2061 result_type: Object 2062 possibly_calls: true 2063 generate_lir: true 2064 lir_temps: 2 2065 2066 # Array.prototype.slice on an arguments object. 2067 - name: ArgumentsSlice 2068 operands: 2069 object: Object 2070 begin: Int32 2071 end: Int32 2072 arguments: 2073 templateObj: JSObject* 2074 initialHeap: gc::Heap 2075 result_type: Object 2076 possibly_calls: true 2077 generate_lir: true 2078 lir_temps: 2 2079 2080 # Array.prototype.slice on an arguments object. 2081 - name: FrameArgumentsSlice 2082 operands: 2083 begin: Int32 2084 count: Int32 2085 arguments: 2086 templateObj: JSObject* 2087 initialHeap: gc::Heap 2088 result_type: Object 2089 alias_set: none 2090 possibly_calls: true 2091 2092 # Array.prototype.slice on an inlined arguments object. 2093 - name: InlineArgumentsSlice 2094 gen_boilerplate: false 2095 2096 - name: NormalizeSliceTerm 2097 operands: 2098 value: Int32 2099 length: Int32 2100 result_type: Int32 2101 movable: true 2102 congruent_to: if_operands_equal 2103 alias_set: none 2104 folds_to: custom 2105 generate_lir: true 2106 2107 # MArrayJoin doesn't override |getAliasSet()|, because Array.prototype.join 2108 # might coerce the elements of the Array to strings. This coercion might 2109 # cause the evaluation of JavaScript code. 2110 - name: ArrayJoin 2111 operands: 2112 array: Object 2113 separator: String 2114 result_type: String 2115 possibly_calls: true 2116 folds_to: custom 2117 generate_lir: true 2118 lir_temps: 1 2119 # MArrayJoin doesn't override |getAliasSet()|, because Array.prototype.join 2120 # might coerce the elements of the Array to strings. This coercion might 2121 # cause the evaluation of JavaScript code. 2122 2123 # Object.prototype.keys. Used to elide it when possible. 2124 - name: ObjectKeys 2125 operands: 2126 object: Object 2127 arguments: 2128 resultShape: Shape* 2129 result_type: Object 2130 can_recover: custom 2131 possibly_calls: true 2132 generate_lir: true 2133 2134 - name: ObjectKeysFromIterator 2135 operands: 2136 iterator: Object 2137 result_type: Object 2138 can_recover: true 2139 2140 # Used to fold Object.keys(obj).length into a single operation. 2141 # 2142 # This should not be used with a Proxy, as proxies can have a user-defined 2143 # `ownKeys` function which can have arbitrary outputs. 2144 # 2145 # This MIR node is created by folding an MObjectKeys with an MArrayLength, as 2146 # part of MArrayLength::foldsTo. 2147 - name: ObjectKeysLength 2148 operands: 2149 object: Object 2150 result_type: Int32 2151 movable: false 2152 congruent_to: if_operands_equal 2153 alias_set: custom 2154 clone: true 2155 possibly_calls: true 2156 generate_lir: true 2157 2158 - name: LoadUnboxedScalar 2159 gen_boilerplate: false 2160 2161 - name: LoadDataViewElement 2162 gen_boilerplate: false 2163 2164 - name: LoadTypedArrayElementHole 2165 gen_boilerplate: false 2166 2167 - name: StoreUnboxedScalar 2168 gen_boilerplate: false 2169 2170 - name: StoreDataViewElement 2171 gen_boilerplate: false 2172 2173 - name: StoreTypedArrayElementHole 2174 gen_boilerplate: false 2175 2176 - name: EffectiveAddress3 2177 gen_boilerplate: false 2178 2179 - name: EffectiveAddress2 2180 gen_boilerplate: false 2181 2182 - name: ClampToUint8 2183 gen_boilerplate: false 2184 2185 - name: LoadFixedSlot 2186 gen_boilerplate: false 2187 2188 - name: LoadFixedSlotFromOffset 2189 operands: 2190 object: Object 2191 offset: Int32 2192 result_type: Value 2193 movable: true 2194 congruent_to: if_operands_equal 2195 alias_set: custom 2196 generate_lir: true 2197 2198 - name: LoadFixedSlotAndUnbox 2199 gen_boilerplate: false 2200 2201 - name: LoadDynamicSlotAndUnbox 2202 gen_boilerplate: false 2203 2204 - name: StoreFixedSlot 2205 gen_boilerplate: false 2206 2207 - name: StoreFixedSlotFromOffset 2208 gen_boilerplate: false 2209 2210 - name: StoreDynamicSlotFromOffset 2211 gen_boilerplate: false 2212 2213 - name: GetPropertyCache 2214 gen_boilerplate: false 2215 2216 - name: HomeObjectSuperBase 2217 operands: 2218 homeObject: Object 2219 result_type: Value 2220 movable: true 2221 congruent_to: if_operands_equal 2222 alias_set: custom 2223 generate_lir: true 2224 2225 - name: GetPropSuperCache 2226 gen_boilerplate: false 2227 2228 - name: BindNameCache 2229 operands: 2230 environmentChain: Object 2231 result_type: Object 2232 generate_lir: true 2233 lir_temps: 1 2234 2235 - name: CallBindVar 2236 operands: 2237 environmentChain: Object 2238 result_type: Object 2239 movable: true 2240 congruent_to: if_operands_equal 2241 alias_set: none 2242 generate_lir: true 2243 2244 - name: GuardShape 2245 operands: 2246 object: Object 2247 arguments: 2248 shape: Shape* 2249 result_type: Object 2250 guard: true 2251 movable: true 2252 congruent_to: custom 2253 alias_set: custom 2254 might_alias: custom 2255 folds_to: custom 2256 generate_lir: true 2257 lir_temps: 1 2258 2259 - name: HasShape 2260 operands: 2261 object: Object 2262 arguments: 2263 shape: Shape* 2264 result_type: Boolean 2265 movable: true 2266 congruent_to: custom 2267 alias_set: custom 2268 generate_lir: true 2269 2270 - name: GuardFuse 2271 arguments: 2272 fuseIndex: RealmFuses::FuseIndex 2273 result_type: None 2274 guard: true 2275 movable: true 2276 congruent_to: custom 2277 alias_set: custom 2278 generate_lir: true 2279 2280 # This is the equivalent of the GuardMultipleShapes CacheIR op. Because it 2281 # stores a pointer to the ShapeListObject, we don't need to recompile Ion code 2282 # when a new shape is added to the list. 2283 - name: GuardMultipleShapes 2284 operands: 2285 object: Object 2286 shapeList: Object 2287 result_type: Object 2288 guard: true 2289 movable: true 2290 congruent_to: if_operands_equal 2291 alias_set: custom 2292 generate_lir: true 2293 lir_temps: 4 2294 2295 # Similar to GuardMultipleShapes but used when the list had a small number of 2296 # shapes. These shapes have been copied to the ShapeListSnapshot and are 2297 # available at compile-time. This lets us perform more MIR optimizations, but 2298 # we need to recompile when a new shape is added to the list. 2299 - name: GuardShapeList 2300 operands: 2301 object: Object 2302 arguments: 2303 shapeList: const ShapeListSnapshot* 2304 result_type: Object 2305 guard: true 2306 movable: true 2307 congruent_to: custom 2308 alias_set: custom 2309 generate_lir: true 2310 lir_temps: 2 2311 2312 - name: GuardShapeListToOffset 2313 operands: 2314 object: Object 2315 arguments: 2316 shapeList: const ShapeListWithOffsetsSnapshot* 2317 result_type: Int32 2318 guard: true 2319 movable: true 2320 congruent_to: custom 2321 alias_set: custom 2322 generate_lir: true 2323 lir_temps: 2 2324 2325 - name: GuardMultipleShapesToOffset 2326 operands: 2327 object: Object 2328 shapeList: Object 2329 result_type: Int32 2330 guard: true 2331 movable: true 2332 congruent_to: if_operands_equal 2333 alias_set: custom 2334 2335 - name: GuardProto 2336 gen_boilerplate: false 2337 2338 - name: GuardNullProto 2339 gen_boilerplate: false 2340 2341 # Guard the object is a native object. 2342 - name: GuardIsNativeObject 2343 operands: 2344 object: Object 2345 result_type: Object 2346 guard: true 2347 movable: true 2348 congruent_to: if_operands_equal 2349 alias_set: none 2350 generate_lir: true 2351 lir_result_type: none 2352 lir_temps: 1 2353 2354 - name: GuardGlobalGeneration 2355 arguments: 2356 expected: uint32_t 2357 generationAddr: const void* 2358 result_type: None 2359 guard: true 2360 movable: true 2361 alias_set: custom 2362 congruent_to: custom 2363 generate_lir: true 2364 lir_temps: 1 2365 2366 - name: GuardIsProxy 2367 operands: 2368 object: Object 2369 result_type: Object 2370 guard: true 2371 movable: true 2372 congruent_to: if_operands_equal 2373 alias_set: none 2374 generate_lir: true 2375 lir_result_type: none 2376 lir_temps: 1 2377 2378 - name: GuardIsNotDOMProxy 2379 operands: 2380 proxy: Object 2381 result_type: Object 2382 guard: true 2383 movable: true 2384 congruent_to: if_operands_equal 2385 alias_set: none 2386 generate_lir: true 2387 lir_result_type: none 2388 lir_temps: 1 2389 2390 - name: GuardIsNotProxy 2391 operands: 2392 object: Object 2393 result_type: Object 2394 guard: true 2395 movable: true 2396 congruent_to: if_operands_equal 2397 folds_to: custom 2398 alias_set: none 2399 generate_lir: true 2400 lir_result_type: none 2401 lir_temps: 1 2402 2403 - name: ProxyGet 2404 operands: 2405 proxy: Object 2406 arguments: 2407 id: jsid 2408 result_type: Value 2409 possibly_calls: true 2410 generate_lir: true 2411 lir_temps: 1 2412 2413 - name: ProxyGetByValue 2414 operands: 2415 proxy: Object 2416 idVal: Value 2417 result_type: Value 2418 possibly_calls: true 2419 generate_lir: true 2420 2421 - name: ProxyHasProp 2422 operands: 2423 proxy: Object 2424 idVal: Value 2425 arguments: 2426 hasOwn: bool 2427 result_type: Boolean 2428 possibly_calls: true 2429 2430 - name: ProxySet 2431 operands: 2432 proxy: Object 2433 rhs: Value 2434 arguments: 2435 id: jsid 2436 strict: bool 2437 possibly_calls: true 2438 generate_lir: true 2439 lir_temps: 1 2440 2441 - name: ProxySetByValue 2442 operands: 2443 proxy: Object 2444 idVal: Value 2445 rhs: Value 2446 arguments: 2447 strict: bool 2448 possibly_calls: true 2449 generate_lir: true 2450 2451 - name: CallSetArrayLength 2452 operands: 2453 obj: Object 2454 rhs: Value 2455 arguments: 2456 strict: bool 2457 possibly_calls: true 2458 generate_lir: true 2459 2460 - name: MegamorphicLoadSlot 2461 operands: 2462 object: Object 2463 arguments: 2464 name: PropertyKey 2465 result_type: Value 2466 # Bails when non-native or accessor properties are encountered, so we can't 2467 # DCE this instruction. 2468 guard: true 2469 possibly_calls: true 2470 congruent_to: custom 2471 alias_set: custom 2472 generate_lir: true 2473 lir_temps: 4 2474 2475 - name: MegamorphicLoadSlotPermissive 2476 operands: 2477 object: Object 2478 arguments: 2479 name: PropertyKey 2480 result_type: Value 2481 guard: true 2482 possibly_calls: true 2483 generate_lir: true 2484 lir_temps: 4 2485 2486 - name: MegamorphicLoadSlotByValue 2487 operands: 2488 object: Object 2489 idVal: Value 2490 result_type: Value 2491 # Bails when non-native or accessor properties are encountered, so we can't 2492 # DCE this instruction. 2493 guard: true 2494 folds_to: custom 2495 congruent_to: if_operands_equal 2496 alias_set: custom 2497 possibly_calls: true 2498 generate_lir: true 2499 lir_temps: 3 2500 2501 - name: MegamorphicLoadSlotByValuePermissive 2502 operands: 2503 object: Object 2504 idVal: Value 2505 result_type: Value 2506 guard: true 2507 folds_to: custom 2508 possibly_calls: true 2509 generate_lir: true 2510 #ifdef JS_CODEGEN_X86 2511 lir_temps: 3 2512 #else 2513 lir_temps: 4 2514 #endif 2515 2516 - name: MegamorphicStoreSlot 2517 operands: 2518 object: Object 2519 rhs: Value 2520 arguments: 2521 name: PropertyKey 2522 strict: bool 2523 possibly_calls: true 2524 generate_lir: true 2525 #ifdef JS_CODEGEN_X86 2526 lir_temps: 1 2527 #else 2528 lir_temps: 3 2529 #endif 2530 2531 - name: MegamorphicHasProp 2532 operands: 2533 object: Object 2534 idVal: Value 2535 arguments: 2536 hasOwn: bool 2537 result_type: Boolean 2538 # Bails when non-native or accessor properties are encountered, so we can't 2539 # DCE this instruction. 2540 guard: true 2541 congruent_to: custom 2542 alias_set: custom 2543 possibly_calls: true 2544 generate_lir: true 2545 lir_temps: 3 2546 2547 - name: SmallObjectVariableKeyHasProp 2548 operands: 2549 idStr: String 2550 arguments: 2551 shape: Shape* 2552 congruent_to: custom 2553 result_type: Boolean 2554 alias_set: custom 2555 generate_lir: true 2556 2557 - name: GuardToArrayBuffer 2558 operands: 2559 object: Object 2560 result_type: Object 2561 guard: true 2562 movable: true 2563 congruent_to: if_operands_equal 2564 alias_set: none 2565 generate_lir: true 2566 lir_temps: 1 2567 2568 - name: GuardToSharedArrayBuffer 2569 operands: 2570 object: Object 2571 result_type: Object 2572 guard: true 2573 movable: true 2574 congruent_to: if_operands_equal 2575 alias_set: none 2576 generate_lir: true 2577 lir_temps: 1 2578 2579 - name: GuardIsNotArrayBufferMaybeShared 2580 operands: 2581 object: Object 2582 result_type: Object 2583 guard: true 2584 movable: true 2585 congruent_to: if_operands_equal 2586 folds_to: custom 2587 alias_set: none 2588 generate_lir: true 2589 lir_result_type: none 2590 lir_temps: 1 2591 2592 - name: GuardIsTypedArray 2593 operands: 2594 object: Object 2595 result_type: Object 2596 guard: true 2597 movable: true 2598 congruent_to: if_operands_equal 2599 alias_set: none 2600 generate_lir: true 2601 lir_result_type: none 2602 lir_temps: 1 2603 2604 - name: GuardIsNonResizableTypedArray 2605 operands: 2606 object: Object 2607 result_type: Object 2608 guard: true 2609 movable: true 2610 congruent_to: if_operands_equal 2611 alias_set: none 2612 generate_lir: true 2613 lir_result_type: none 2614 lir_temps: 1 2615 2616 - name: GuardIsResizableTypedArray 2617 operands: 2618 object: Object 2619 result_type: Object 2620 guard: true 2621 movable: true 2622 congruent_to: if_operands_equal 2623 alias_set: none 2624 generate_lir: true 2625 lir_result_type: none 2626 lir_temps: 1 2627 2628 - name: GuardHasProxyHandler 2629 operands: 2630 object: Object 2631 arguments: 2632 handler: const void* 2633 result_type: Object 2634 guard: true 2635 movable: true 2636 congruent_to: if_operands_equal 2637 alias_set: none 2638 generate_lir: true 2639 lir_result_type: none 2640 2641 # Loads a specific JSObject* that was originally nursery-allocated. 2642 # See also WarpObjectField. 2643 - name: NurseryObject 2644 arguments: 2645 # Index in the Vector of objects stored in the WarpSnapshot. 2646 nurseryObjectIndex: uint32_t 2647 result_type: Object 2648 movable: true 2649 value_hash: custom 2650 congruent_to: custom 2651 alias_set: none 2652 generate_lir: true 2653 2654 - name: GuardValue 2655 gen_boilerplate: false 2656 2657 - name: GuardNullOrUndefined 2658 operands: 2659 value: Value 2660 result_type: Value 2661 guard: true 2662 movable: true 2663 congruent_to: if_operands_equal 2664 folds_to: custom 2665 alias_set: none 2666 generate_lir: true 2667 lir_result_type: none 2668 2669 - name: GuardIsNotObject 2670 operands: 2671 value: Value 2672 result_type: Value 2673 guard: true 2674 movable: true 2675 congruent_to: if_operands_equal 2676 folds_to: custom 2677 alias_set: none 2678 generate_lir: true 2679 lir_result_type: none 2680 2681 - name: GuardFunctionFlags 2682 gen_boilerplate: false 2683 2684 - name: GuardFunctionIsNonBuiltinCtor 2685 operands: 2686 function: Object 2687 result_type: Object 2688 guard: true 2689 movable: true 2690 congruent_to: if_operands_equal 2691 alias_set: custom 2692 generate_lir: true 2693 lir_result_type: none 2694 lir_temps: 1 2695 2696 - name: GuardFunctionKind 2697 operands: 2698 function: Object 2699 arguments: 2700 expected: FunctionFlags::FunctionKind 2701 bailOnEquality: bool 2702 result_type: Object 2703 guard: true 2704 movable: true 2705 congruent_to: custom 2706 alias_set: custom 2707 generate_lir: true 2708 lir_result_type: none 2709 lir_temps: 1 2710 2711 - name: GuardFunctionScript 2712 operands: 2713 function: Object 2714 arguments: 2715 expected: BaseScript* 2716 nargs: uint16_t 2717 flags: FunctionFlags 2718 result_type: Object 2719 guard: true 2720 movable: true 2721 folds_to: custom 2722 congruent_to: custom 2723 # A JSFunction's BaseScript pointer is immutable. Relazification of 2724 # self-hosted functions is an exception to this, but we don't use this 2725 # guard for self-hosted functions. 2726 alias_set: custom 2727 generate_lir: true 2728 lir_result_type: none 2729 2730 - name: GuardObjectIdentity 2731 gen_boilerplate: false 2732 2733 - name: GuardSpecificFunction 2734 gen_boilerplate: false 2735 2736 - name: GuardSpecificAtom 2737 operands: 2738 str: String 2739 arguments: 2740 atom: JSOffThreadAtom* 2741 result_type: String 2742 guard: true 2743 movable: true 2744 congruent_to: custom 2745 folds_to: custom 2746 alias_set: none 2747 generate_lir: true 2748 lir_result_type: none 2749 lir_temps: 1 2750 2751 - name: GuardSpecificSymbol 2752 gen_boilerplate: false 2753 2754 - name: GuardSpecificInt32 2755 operands: 2756 num: Int32 2757 arguments: 2758 expected: int32_t 2759 result_type: Int32 2760 guard: true 2761 movable: true 2762 folds_to: custom 2763 alias_set: none 2764 generate_lir: true 2765 lir_result_type: none 2766 2767 - name: GuardStringToIndex 2768 operands: 2769 string: String 2770 result_type: Int32 2771 # Mark as guard because this instruction must not be eliminated. For 2772 # example, if the string is not an index the operation could change from a 2773 # typed array load to a getter call. 2774 guard: true 2775 movable: true 2776 congruent_to: if_operands_equal 2777 folds_to: custom 2778 alias_set: none 2779 generate_lir: true 2780 2781 - name: GuardStringToInt32 2782 operands: 2783 string: String 2784 result_type: Int32 2785 # Mark as guard to prevent the issue described in MGuardStringToIndex's 2786 # constructor. 2787 guard: true 2788 movable: true 2789 congruent_to: if_operands_equal 2790 folds_to: custom 2791 alias_set: none 2792 generate_lir: true 2793 lir_temps: 1 2794 2795 - name: GuardStringToDouble 2796 operands: 2797 string: String 2798 result_type: Double 2799 # Mark as guard to prevent the issue described in MGuardStringToIndex's 2800 # constructor. 2801 guard: true 2802 movable: true 2803 congruent_to: if_operands_equal 2804 folds_to: custom 2805 alias_set: none 2806 generate_lir: true 2807 lir_temps: 2 2808 2809 - name: GuardNoDenseElements 2810 operands: 2811 object: Object 2812 result_type: Object 2813 guard: true 2814 movable: true 2815 alias_set: custom 2816 generate_lir: true 2817 lir_result_type: none 2818 lir_temps: 1 2819 2820 - name: GuardTagNotEqual 2821 gen_boilerplate: false 2822 2823 - name: LoadDynamicSlot 2824 gen_boilerplate: false 2825 2826 - name: LoadDynamicSlotFromOffset 2827 operands: 2828 slots: Slots 2829 offset: Int32 2830 result_type: Value 2831 movable: true 2832 congruent_to: if_operands_equal 2833 alias_set: custom 2834 generate_lir: true 2835 2836 # Inline call to access a function's environment (scope chain). 2837 - name: FunctionEnvironment 2838 operands: 2839 function: Object 2840 result_type: Object 2841 movable: true 2842 folds_to: custom 2843 # A function's environment is fixed. 2844 alias_set: none 2845 can_recover: true 2846 generate_lir: true 2847 2848 # Allocate a new BlockLexicalEnvironmentObject. 2849 - name: NewLexicalEnvironmentObject 2850 operands: 2851 templateObj: Object 2852 result_type: Object 2853 alias_set: none 2854 2855 # Allocate a new ClassBodyEnvironmentObject. 2856 - name: NewClassBodyEnvironmentObject 2857 operands: 2858 templateObj: Object 2859 result_type: Object 2860 alias_set: none 2861 2862 - name: NewVarEnvironmentObject 2863 operands: 2864 templateObj: Object 2865 result_type: Object 2866 alias_set: none 2867 2868 - name: HomeObject 2869 operands: 2870 function: Object 2871 result_type: Object 2872 movable: true 2873 # A function's [[HomeObject]] is fixed. 2874 alias_set: none 2875 generate_lir: true 2876 2877 - name: AddAndStoreSlot 2878 gen_boilerplate: false 2879 2880 - name: AllocateAndStoreSlot 2881 operands: 2882 object: Object 2883 value: Value 2884 arguments: 2885 slotOffset: uint32_t 2886 shape: Shape* 2887 numNewSlots: uint32_t 2888 preserveWrapper: bool 2889 possibly_calls: true 2890 alias_set: custom 2891 generate_lir: true 2892 lir_temps: 2 2893 2894 - name: AddSlotAndCallAddPropHook 2895 operands: 2896 object: Object 2897 value: Value 2898 arguments: 2899 shape: Shape* 2900 possibly_calls: true 2901 generate_lir: true 2902 2903 - name: StoreDynamicSlot 2904 gen_boilerplate: false 2905 2906 # Note, Name ICs always return a Value. There are no V/T variants. 2907 - name: GetNameCache 2908 operands: 2909 envObj: Object 2910 result_type: Value 2911 generate_lir: true 2912 lir_temps: 1 2913 2914 - name: CallGetIntrinsicValue 2915 arguments: 2916 name: PropertyName* 2917 result_type: Value 2918 possibly_calls: true 2919 generate_lir: true 2920 2921 - name: DeleteProperty 2922 operands: 2923 value: Value 2924 arguments: 2925 name: PropertyName* 2926 strict: bool 2927 result_type: Boolean 2928 possibly_calls: true 2929 generate_lir: true 2930 2931 - name: DeleteElement 2932 operands: 2933 value: Value 2934 index: Value 2935 arguments: 2936 strict: bool 2937 result_type: Boolean 2938 possibly_calls: true 2939 generate_lir: true 2940 2941 - name: SetPropertyCache 2942 gen_boilerplate: false 2943 2944 - name: MegamorphicSetElement 2945 gen_boilerplate: false 2946 2947 - name: SetDOMProperty 2948 gen_boilerplate: false 2949 2950 - name: GetDOMProperty 2951 gen_boilerplate: false 2952 2953 - name: GetDOMMember 2954 gen_boilerplate: false 2955 2956 - name: ObjectToIterator 2957 gen_boilerplate: false 2958 2959 - name: IteratorLength 2960 operands: 2961 iter: Object 2962 result_type: Int32 2963 generate_lir: true 2964 2965 - name: LoadIteratorElement 2966 operands: 2967 iter: Object 2968 index: Int32 2969 result_type: String 2970 alias_set: none 2971 generate_lir: true 2972 2973 - name: ValueToIterator 2974 operands: 2975 value: Value 2976 result_type: Object 2977 possibly_calls: true 2978 generate_lir: true 2979 2980 - name: IteratorHasIndices 2981 operands: 2982 object: Object 2983 iterator: Object 2984 result_type: Boolean 2985 alias_set: custom 2986 2987 - name: IteratorsMatchAndHaveIndices 2988 operands: 2989 object: Object 2990 iterator: Object 2991 otherIterator: Object 2992 result_type: Boolean 2993 alias_set: custom 2994 2995 - name: LoadSlotByIteratorIndex 2996 operands: 2997 object: Object 2998 iterator: Object # TODO: add MIRType::NativeIterator? 2999 result_type: Value 3000 alias_set: custom 3001 generate_lir: true 3002 lir_temps: 2 3003 3004 - name: StoreSlotByIteratorIndex 3005 operands: 3006 object: Object 3007 iterator: Object 3008 value: Value 3009 alias_set: custom 3010 generate_lir: true 3011 lir_temps: 2 3012 3013 # Okay this is a confusing name, but essentially, the above ops load/store a 3014 # slot of an object using the PropertyIndex associated with the *current* key 3015 # for the iterator. The below op uses the PropertyIndex associated with the 3016 # key indexed by `index`, rather than the current one. 3017 - name: LoadSlotByIteratorIndexIndexed 3018 operands: 3019 object: Object 3020 iterator: Object 3021 index: Int32 3022 result_type: Value 3023 alias_set: custom 3024 generate_lir: true 3025 lir_temps: 2 3026 3027 - name: StoreSlotByIteratorIndexIndexed 3028 operands: 3029 object: Object 3030 iterator: Object 3031 index: Int32 3032 value: Value 3033 alias_set: custom 3034 generate_lir: true 3035 lir_temps: 2 3036 3037 # Load the private value expando from a DOM proxy. The target is stored in the 3038 # proxy object's private slot. 3039 # This is either an UndefinedValue (no expando), ObjectValue (the expando 3040 # object), or PrivateValue(ExpandoAndGeneration*). 3041 - name: LoadDOMExpandoValue 3042 operands: 3043 proxy: Object 3044 result_type: Value 3045 movable: true 3046 congruent_to: if_operands_equal 3047 alias_set: custom 3048 generate_lir: true 3049 3050 - name: LoadDOMExpandoValueGuardGeneration 3051 gen_boilerplate: false 3052 3053 - name: LoadDOMExpandoValueIgnoreGeneration 3054 operands: 3055 proxy: Object 3056 result_type: Value 3057 movable: true 3058 congruent_to: if_operands_equal 3059 alias_set: custom 3060 generate_lir: true 3061 3062 # Takes an expando Value as input, then guards it's either UndefinedValue or 3063 # an object with the expected shape. 3064 - name: GuardDOMExpandoMissingOrGuardShape 3065 operands: 3066 expando: Value 3067 arguments: 3068 shape: Shape* 3069 result_type: Value 3070 guard: true 3071 movable: true 3072 congruent_to: custom 3073 alias_set: custom 3074 generate_lir: true 3075 lir_result_type: none 3076 lir_temps: 1 3077 3078 # Read length field of a JSString*. 3079 - name: StringLength 3080 operands: 3081 string: String 3082 result_type: Int32 3083 movable: true 3084 folds_to: custom 3085 congruent_to: if_operands_equal 3086 # The string |length| property is immutable, so there is no 3087 # implicit dependency. 3088 alias_set: none 3089 compute_range: custom 3090 can_recover: true 3091 clone: true 3092 generate_lir: true 3093 3094 - name: Floor 3095 gen_boilerplate: false 3096 3097 - name: Ceil 3098 gen_boilerplate: false 3099 3100 - name: Round 3101 gen_boilerplate: false 3102 3103 - name: Trunc 3104 gen_boilerplate: false 3105 3106 - name: NearbyInt 3107 gen_boilerplate: false 3108 3109 - name: RoundToDouble 3110 gen_boilerplate: false 3111 3112 - name: GetIteratorCache 3113 gen_boilerplate: false 3114 3115 - name: OptimizeSpreadCallCache 3116 operands: 3117 value: Value 3118 result_type: Value 3119 generate_lir: true 3120 lir_temps: 1 3121 3122 - name: IteratorMore 3123 operands: 3124 iterator: Object 3125 result_type: Value 3126 generate_lir: true 3127 lir_temps: 1 3128 3129 - name: IsNoIter 3130 operands: 3131 def: Object 3132 result_type: Boolean 3133 type_policy: none 3134 movable : true 3135 alias_set: none 3136 3137 - name: IteratorEnd 3138 operands: 3139 iterator: Object 3140 generate_lir: true 3141 lir_temps: 3 3142 3143 - name: CloseIterCache 3144 operands: 3145 iter: Object 3146 arguments: 3147 completionKind: uint8_t 3148 possibly_calls: true 3149 3150 - name: OptimizeGetIteratorCache 3151 operands: 3152 value: Value 3153 result_type: Boolean 3154 generate_lir: true 3155 lir_temps: 1 3156 3157 - name: InCache 3158 gen_boilerplate: false 3159 3160 - name: InArray 3161 gen_boilerplate: false 3162 3163 - name: GuardElementNotHole 3164 gen_boilerplate: false 3165 3166 - name: NewPrivateName 3167 arguments: 3168 name: JSOffThreadAtom* 3169 result_type: Symbol 3170 possibly_calls: true 3171 generate_lir: true 3172 3173 - name: CheckPrivateFieldCache 3174 gen_boilerplate: false 3175 3176 - name: HasOwnCache 3177 gen_boilerplate: false 3178 3179 - name: InstanceOf 3180 gen_boilerplate: false 3181 3182 # Implementation for instanceof operator with unknown rhs. 3183 - name: InstanceOfCache 3184 operands: 3185 obj: Value 3186 proto: Object 3187 result_type: Boolean 3188 generate_lir: true 3189 3190 # Read the number of actual arguments. 3191 - name: ArgumentsLength 3192 result_type: Int32 3193 movable: true 3194 congruent_to: if_operands_equal 3195 # Arguments |length| cannot be mutated by Ion Code. 3196 alias_set: none 3197 compute_range: custom 3198 can_recover: true 3199 generate_lir: true 3200 3201 # This MIR instruction is used to get an argument from the actual arguments. 3202 - name: GetFrameArgument 3203 operands: 3204 index: Int32 3205 result_type: Value 3206 movable: true 3207 congruent_to: if_operands_equal 3208 # This instruction is never aliased, because ops like JSOp::SetArg don't 3209 # write to the argument frames. We create an arguments object in that case. 3210 alias_set: none 3211 generate_lir: true 3212 3213 # This MIR instruction is used to get an argument from the actual arguments. 3214 # Returns undefined if |index| is larger-or-equals to |length|. Bails out if 3215 # |index| is negative. 3216 - name: GetFrameArgumentHole 3217 operands: 3218 index: Int32 3219 length: Int32 3220 result_type: Value 3221 guard: true 3222 movable: true 3223 congruent_to: if_operands_equal 3224 # This instruction is never aliased, because ops like JSOp::SetArg don't 3225 # write to the argument frames. We create an arguments object in that case. 3226 alias_set: none 3227 generate_lir: true 3228 lir_temps: 1 3229 3230 - name: NewTarget 3231 result_type: Value 3232 movable: true 3233 congruent_to: if_operands_equal 3234 alias_set: none 3235 generate_lir: true 3236 3237 # Create the rest parameter. 3238 - name: Rest 3239 operands: 3240 numActuals: Int32 3241 arguments: 3242 numFormals: unsigned 3243 shape: Shape* 3244 result_type: Object 3245 possibly_calls: true 3246 alias_set: none 3247 can_recover: true 3248 generate_lir: true 3249 lir_temps: 4 3250 3251 - name: PostWriteBarrier 3252 gen_boilerplate: false 3253 3254 - name: PostWriteElementBarrier 3255 gen_boilerplate: false 3256 3257 - name: AssertCanElidePostWriteBarrier 3258 operands: 3259 object: Object 3260 value: Value 3261 result_type: None 3262 guard: true 3263 alias_set: none 3264 generate_lir: true 3265 lir_temps: 1 3266 3267 # Allocates a new NamedLambdaObject. 3268 # 3269 # This instruction generates two possible instruction sets: 3270 # (1) An inline allocation of the call object is attempted. 3271 # (2) Otherwise, a callVM create a new object. 3272 - name: NewNamedLambdaObject 3273 arguments: 3274 templateObj: NamedLambdaObject* 3275 initialHeap: gc::Heap 3276 result_type: Object 3277 alias_set: none 3278 generate_lir: true 3279 lir_temps: 1 3280 3281 - name: NewCallObject 3282 gen_boilerplate: false 3283 3284 - name: NewStringObject 3285 gen_boilerplate: false 3286 3287 - name: IsCallable 3288 gen_boilerplate: false 3289 3290 - name: IsConstructor 3291 operands: 3292 object: Object 3293 result_type: Boolean 3294 movable: true 3295 congruent_to: if_operands_equal 3296 alias_set: none 3297 generate_lir: true 3298 3299 - name: IsCrossRealmArrayConstructor 3300 operands: 3301 object: Object 3302 result_type: Boolean 3303 movable: true 3304 congruent_to: if_operands_equal 3305 alias_set: none 3306 generate_lir: true 3307 3308 - name: IsObject 3309 operands: 3310 object: Value 3311 result_type: Boolean 3312 movable: true 3313 folds_to: custom 3314 congruent_to: if_operands_equal 3315 alias_set: none 3316 generate_lir: true 3317 3318 - name: IsNullOrUndefined 3319 operands: 3320 value: Value 3321 result_type: Boolean 3322 movable: true 3323 folds_to: custom 3324 congruent_to: if_operands_equal 3325 alias_set: none 3326 type_policy: none 3327 can_consume_float32: true 3328 generate_lir: true 3329 3330 - name: HasClass 3331 gen_boilerplate: false 3332 3333 - name: GuardToClass 3334 gen_boilerplate: false 3335 3336 - name: GuardToFunction 3337 gen_boilerplate: false 3338 3339 - name: IsArray 3340 gen_boilerplate: false 3341 3342 - name: IsTypedArray 3343 gen_boilerplate: false 3344 3345 - name: ObjectClassToString 3346 operands: 3347 object: Object 3348 result_type: String 3349 guard: true 3350 movable: true 3351 congruent_to: if_operands_equal 3352 possibly_calls: true 3353 # Tests @@toStringTag is neither present on this object nor on any object 3354 # of the prototype chain. 3355 alias_set: custom 3356 generate_lir: true 3357 lir_temps: 1 3358 3359 - name: CheckReturn 3360 operands: 3361 returnValue: Value 3362 thisValue: Value 3363 result_type: Value 3364 guard: true 3365 folds_to: custom 3366 alias_set: custom 3367 generate_lir: true 3368 3369 - name: CheckThis 3370 operands: 3371 thisValue: Value 3372 result_type: Value 3373 guard: true 3374 folds_to: custom 3375 alias_set: custom 3376 generate_lir: true 3377 lir_result_type: none 3378 3379 - name: AsyncResolve 3380 operands: 3381 generator: Object 3382 value: Value 3383 result_type: Object 3384 possibly_calls: true 3385 generate_lir: true 3386 3387 - name: AsyncReject 3388 operands: 3389 generator: Object 3390 reason: Value 3391 stack: Value 3392 result_type: Object 3393 possibly_calls: true 3394 generate_lir: true 3395 3396 # Returns from this function to the previous caller; this looks like a regular 3397 # Unary instruction and is used to lie to the MIR generator about suspending 3398 # ops like Yield/Await, which are emitted like returns, but MIR-Build like 3399 # regular instructions. 3400 - name: GeneratorReturn 3401 operands: 3402 input: Value 3403 guard: true 3404 alias_set: none 3405 3406 - name: AsyncAwait 3407 operands: 3408 value: Value 3409 generator: Object 3410 result_type: Object 3411 possibly_calls: true 3412 generate_lir: true 3413 3414 - name: CheckThisReinit 3415 operands: 3416 thisValue: Value 3417 result_type: Value 3418 guard: true 3419 folds_to: custom 3420 alias_set: custom 3421 generate_lir: true 3422 lir_result_type: none 3423 3424 - name: Generator 3425 gen_boilerplate: false 3426 3427 - name: CanSkipAwait 3428 operands: 3429 value: Value 3430 result_type: Boolean 3431 possibly_calls: true 3432 generate_lir: true 3433 3434 - name: MaybeExtractAwaitValue 3435 gen_boilerplate: false 3436 3437 - name: IncrementWarmUpCounter 3438 arguments: 3439 script: JSScript* 3440 alias_set: none 3441 generate_lir: true 3442 lir_temps: 1 3443 3444 - name: AtomicIsLockFree 3445 gen_boilerplate: false 3446 3447 - name: AtomicPause 3448 guard: true 3449 movable: false 3450 alias_set: none 3451 generate_lir: true 3452 3453 - name: CompareExchangeTypedArrayElement 3454 gen_boilerplate: false 3455 3456 - name: AtomicExchangeTypedArrayElement 3457 gen_boilerplate: false 3458 3459 - name: AtomicTypedArrayElementBinop 3460 gen_boilerplate: false 3461 3462 - name: Debugger 3463 gen_boilerplate: false 3464 3465 - name: CheckIsObj 3466 operands: 3467 value: Value 3468 arguments: 3469 checkKind: uint8_t 3470 result_type: Object 3471 guard: true 3472 folds_to: custom 3473 alias_set: custom 3474 generate_lir: true 3475 3476 - name: CheckObjCoercible 3477 operands: 3478 checkValue: Value 3479 result_type: Value 3480 guard: true 3481 folds_to: custom 3482 # Throws on null or undefined. 3483 alias_set: custom 3484 generate_lir: true 3485 lir_result_type: none 3486 3487 - name: CheckClassHeritage 3488 operands: 3489 heritage: Value 3490 result_type: Value 3491 guard: true 3492 generate_lir: true 3493 lir_result_type: none 3494 lir_temps: 2 3495 3496 - name: DebugCheckSelfHosted 3497 operands: 3498 checkValue: Value 3499 result_type: Value 3500 guard: true 3501 possibly_calls: true 3502 generate_lir: true 3503 lir_result_type: none 3504 3505 - name: IsPackedArray 3506 operands: 3507 object: Object 3508 result_type: Boolean 3509 movable: true 3510 alias_set: custom 3511 generate_lir: true 3512 lir_temps: 1 3513 3514 - name: GuardArrayIsPacked 3515 operands: 3516 array: Object 3517 result_type: Object 3518 guard: true 3519 movable: true 3520 congruent_to: if_operands_equal 3521 alias_set: custom 3522 generate_lir: true 3523 lir_result_type: none 3524 lir_temps: 2 3525 3526 - name: GuardElementsArePacked 3527 operands: 3528 elements: Elements 3529 type_policy: none 3530 guard: true 3531 movable: true 3532 congruent_to: if_operands_equal 3533 alias_set: custom 3534 generate_lir: true 3535 3536 - name: GetPrototypeOf 3537 operands: 3538 target: Object 3539 result_type: Value 3540 # May throw if target is a proxy. 3541 guard: true 3542 generate_lir: true 3543 3544 - name: ObjectWithProto 3545 operands: 3546 prototype: Value 3547 result_type: Object 3548 # May throw if prototype is neither an object nor null. 3549 guard: true 3550 possibly_calls: true 3551 generate_lir: true 3552 3553 - name: ObjectStaticProto 3554 gen_boilerplate: false 3555 3556 # This is basically just a limited case of Constant, for objects which are 3557 # the prototype of another object and will be used for a GuardShape. It 3558 # includes a reference to the receiver object so we can eliminate redundant 3559 # shape guards. 3560 - name: ConstantProto 3561 gen_boilerplate: false 3562 3563 - name: BuiltinObject 3564 arguments: 3565 builtinObjectKind: BuiltinObjectKind 3566 result_type: Object 3567 possibly_calls: true 3568 generate_lir: true 3569 3570 - name: SuperFunction 3571 operands: 3572 callee: Object 3573 result_type: Value 3574 movable: true 3575 congruent_to: if_operands_equal 3576 alias_set: custom 3577 generate_lir: true 3578 3579 - name: SuperFunctionAndUnbox 3580 operands: 3581 callee: Object 3582 result_type: Object 3583 movable: true 3584 guard: true 3585 congruent_to: if_operands_equal 3586 alias_set: custom 3587 generate_lir: true 3588 3589 - name: InitHomeObject 3590 operands: 3591 function: Object 3592 homeObject: Value 3593 result_type: Object 3594 alias_set: custom 3595 generate_lir: true 3596 lir_result_type: none 3597 3598 # Return true if the object is definitely a TypedArray constructor, but not 3599 # necessarily from the currently active realm. Return false if the object is 3600 # not a TypedArray constructor or if it's a wrapper. 3601 - name: IsTypedArrayConstructor 3602 operands: 3603 object: Object 3604 result_type: Boolean 3605 alias_set: none 3606 generate_lir: true 3607 3608 # Load the JSValueTag on all platforms except ARM64. See the comments in 3609 # MacroAssembler-arm64.h for the |cmpTag(Register, ImmTag)| method for why 3610 # ARM64 doesn't use the raw JSValueTag, but instead a modified tag value. That 3611 # modified tag value can't be directly compared against JSValueTag constants. 3612 - name: LoadValueTag 3613 operands: 3614 value: Value 3615 result_type: Int32 3616 movable: true 3617 congruent_to: if_operands_equal 3618 alias_set: none 3619 generate_lir: true 3620 3621 # Load the target object from a proxy wrapper. The target is stored in the 3622 # proxy object's private slot. This operation is fallible if the proxy can 3623 # be revoked. 3624 - name: LoadWrapperTarget 3625 operands: 3626 object: Object 3627 arguments: 3628 fallible: bool 3629 result_type: Object 3630 movable: true 3631 congruent_to: custom 3632 # Can't use |AliasSet::None| because the target changes on navigation. 3633 # TODO: Investigate using a narrower or a custom alias set. 3634 alias_set: custom 3635 generate_lir: true 3636 3637 - name: LoadGetterSetterFunction 3638 operands: 3639 getterSetter: Value 3640 arguments: 3641 isGetter: bool 3642 needsClassGuard: bool 3643 result_type: Object 3644 generate_lir: true 3645 lir_temps: 1 3646 alias_set: none 3647 3648 # Guard the accessor shape is present on the object or its prototype chain. 3649 - name: GuardHasGetterSetter 3650 operands: 3651 object: Object 3652 arguments: 3653 propId: jsid 3654 getterSetterValue: ValueOrNurseryValueIndex 3655 result_type: Object 3656 guard: true 3657 movable: true 3658 possibly_calls: true 3659 congruent_to: custom 3660 alias_set: custom 3661 generate_lir: true 3662 lir_result_type: none 3663 lir_temps: 3 3664 3665 - name: GuardIsExtensible 3666 operands: 3667 object: Object 3668 result_type: Object 3669 guard: true 3670 movable: true 3671 congruent_to: if_operands_equal 3672 alias_set: custom 3673 generate_lir: true 3674 lir_result_type: none 3675 lir_temps: 1 3676 3677 - name: GuardInt32IsNonNegative 3678 operands: 3679 index: Int32 3680 result_type: Int32 3681 guard: true 3682 movable: true 3683 congruent_to: if_operands_equal 3684 folds_to: custom 3685 alias_set: none 3686 generate_lir: true 3687 lir_result_type: none 3688 3689 - name: GuardIntPtrIsNonNegative 3690 operands: 3691 index: IntPtr 3692 result_type: IntPtr 3693 guard: true 3694 movable: true 3695 congruent_to: if_operands_equal 3696 folds_to: custom 3697 alias_set: none 3698 generate_lir: true 3699 lir_result_type: none 3700 3701 - name: GuardInt32Range 3702 operands: 3703 input: Int32 3704 arguments: 3705 minimum: int32_t 3706 maximum: int32_t 3707 result_type: Int32 3708 guard: true 3709 movable: true 3710 congruent_to: if_operands_equal 3711 folds_to: custom 3712 alias_set: none 3713 generate_lir: true 3714 lir_result_type: none 3715 3716 # Guard the input index is either greater than the dense initialized length of 3717 # an object, or a hole element. 3718 - name: GuardIndexIsNotDenseElement 3719 operands: 3720 object: Object 3721 index: Int32 3722 result_type: Int32 3723 guard: true 3724 movable: true 3725 congruent_to: if_operands_equal 3726 alias_set: custom 3727 generate_lir: true 3728 lir_result_type: none 3729 lir_temps: 2 3730 3731 # Guard an array object's length can be updated successfully when adding an 3732 # element at the input index. 3733 - name: GuardIndexIsValidUpdateOrAdd 3734 operands: 3735 object: Object 3736 index: Int32 3737 result_type: Int32 3738 guard: true 3739 movable: true 3740 congruent_to: if_operands_equal 3741 alias_set: custom 3742 generate_lir: true 3743 lir_result_type: none 3744 lir_temps: 2 3745 3746 # Add or update a sparse element of an ArrayObject or PlainObject. It's allowed 3747 # for the sparse element to be already present on the object. It may also be an 3748 # accessor property, so this instruction is always marked as effectful. 3749 - name: CallAddOrUpdateSparseElement 3750 operands: 3751 object: Object 3752 index: Int32 3753 value: Value 3754 arguments: 3755 strict: bool 3756 possibly_calls: true 3757 generate_lir: true 3758 3759 # Get a sparse element from an ArrayObject or PlainObject, possibly by calling 3760 # an accessor property. 3761 - name: CallGetSparseElement 3762 operands: 3763 object: Object 3764 index: Int32 3765 result_type: Value 3766 possibly_calls: true 3767 generate_lir: true 3768 3769 - name: CallNativeGetElement 3770 operands: 3771 object: Object 3772 index: Int32 3773 result_type: Value 3774 possibly_calls: true 3775 generate_lir: true 3776 3777 - name: CallNativeGetElementSuper 3778 operands: 3779 object: Object 3780 index: Int32 3781 receiver: Value 3782 result_type: Value 3783 possibly_calls: true 3784 generate_lir: true 3785 3786 # Test if a native object has an own element (sparse or dense) at an index. 3787 - name: CallObjectHasSparseElement 3788 operands: 3789 object: Object 3790 index: Int32 3791 result_type: Boolean 3792 guard: true 3793 congruent_to: if_operands_equal 3794 possibly_calls: true 3795 alias_set: custom 3796 generate_lir: true 3797 lir_temps: 2 3798 3799 - name: BigIntAsIntN 3800 operands: 3801 bits: Int32 3802 input: BigInt 3803 result_type: BigInt 3804 movable: true 3805 congruent_to: if_operands_equal 3806 possibly_calls: true 3807 folds_to: custom 3808 alias_set: none 3809 can_recover: true 3810 clone: true 3811 generate_lir: true 3812 3813 - name: BigIntAsUintN 3814 operands: 3815 bits: Int32 3816 input: BigInt 3817 result_type: BigInt 3818 movable: true 3819 congruent_to: if_operands_equal 3820 possibly_calls: true 3821 folds_to: custom 3822 alias_set: none 3823 can_recover: true 3824 clone: true 3825 generate_lir: true 3826 3827 - name: GuardNonGCThing 3828 operands: 3829 input: Value 3830 result_type: Value 3831 guard: true 3832 movable: true 3833 congruent_to: if_operands_equal 3834 folds_to: custom 3835 alias_set: none 3836 generate_lir: true 3837 lir_result_type: none 3838 3839 - name: ToHashableNonGCThing 3840 operands: 3841 input: Value 3842 result_type: Value 3843 movable: true 3844 congruent_to: if_operands_equal 3845 alias_set: none 3846 generate_lir: true 3847 lir_temps: 1 3848 3849 - name: ToHashableString 3850 operands: 3851 input: String 3852 result_type: String 3853 movable: true 3854 congruent_to: if_operands_equal 3855 alias_set: none 3856 generate_lir: true 3857 3858 - name: ToHashableValue 3859 operands: 3860 input: Value 3861 result_type: Value 3862 movable: true 3863 congruent_to: if_operands_equal 3864 alias_set: none 3865 generate_lir: true 3866 lir_temps: 1 3867 3868 - name: HashNonGCThing 3869 operands: 3870 input: Value 3871 result_type: Int32 3872 movable: true 3873 congruent_to: if_operands_equal 3874 alias_set: none 3875 generate_lir: true 3876 lir_temps: 1 3877 3878 - name: HashString 3879 operands: 3880 input: String 3881 result_type: Int32 3882 movable: true 3883 congruent_to: if_operands_equal 3884 alias_set: none 3885 generate_lir: true 3886 lir_temps: 1 3887 3888 - name: HashSymbol 3889 operands: 3890 input: Symbol 3891 result_type: Int32 3892 movable: true 3893 congruent_to: if_operands_equal 3894 alias_set: none 3895 generate_lir: true 3896 3897 - name: HashBigInt 3898 operands: 3899 input: BigInt 3900 result_type: Int32 3901 movable: true 3902 congruent_to: if_operands_equal 3903 alias_set: none 3904 generate_lir: true 3905 lir_temps: 3 3906 3907 - name: HashObject 3908 operands: 3909 setObject: Object 3910 input: Value 3911 result_type: Int32 3912 # In contrast to the previous hash operations, we can't move this 3913 # instruction, because the hashcode is computed from the object's address, 3914 # which can change when the object is moved by the GC. 3915 movable: false 3916 alias_set: none 3917 generate_lir: true 3918 lir_temps: 4 3919 3920 - name: HashValue 3921 operands: 3922 setObject: Object 3923 input: Value 3924 result_type: Int32 3925 movable: false 3926 alias_set: none 3927 generate_lir: true 3928 lir_temps: 4 3929 3930 - name: SetObjectHasNonBigInt 3931 operands: 3932 setObject: Object 3933 value: Value 3934 hash: Int32 3935 result_type: Boolean 3936 movable: true 3937 congruent_to: if_operands_equal 3938 alias_set: custom 3939 generate_lir: true 3940 lir_temps: 2 3941 3942 - name: SetObjectHasBigInt 3943 operands: 3944 setObject: Object 3945 value: Value 3946 hash: Int32 3947 result_type: Boolean 3948 movable: true 3949 congruent_to: if_operands_equal 3950 alias_set: custom 3951 generate_lir: true 3952 lir_temps: 4 3953 3954 - name: SetObjectHasValue 3955 operands: 3956 setObject: Object 3957 value: Value 3958 hash: Int32 3959 result_type: Boolean 3960 movable: true 3961 congruent_to: if_operands_equal 3962 alias_set: custom 3963 generate_lir: true 3964 lir_temps: 4 3965 3966 - name: SetObjectHasValueVMCall 3967 operands: 3968 setObject: Object 3969 value: Value 3970 result_type: Boolean 3971 movable: true 3972 congruent_to: if_operands_equal 3973 alias_set: custom 3974 possibly_calls: true 3975 generate_lir: true 3976 3977 - name: SetObjectDelete 3978 operands: 3979 setObject: Object 3980 key: Value 3981 result_type: Boolean 3982 possibly_calls: true 3983 generate_lir: true 3984 3985 - name: SetObjectAdd 3986 operands: 3987 setObject: Object 3988 key: Value 3989 possibly_calls: true 3990 generate_lir: true 3991 3992 - name: SetObjectSize 3993 operands: 3994 setObject: Object 3995 result_type: Int32 3996 movable: true 3997 congruent_to: if_operands_equal 3998 alias_set: custom 3999 generate_lir: true 4000 4001 - name: MapObjectHasNonBigInt 4002 operands: 4003 mapObject: Object 4004 value: Value 4005 hash: Int32 4006 result_type: Boolean 4007 movable: true 4008 congruent_to: if_operands_equal 4009 alias_set: custom 4010 generate_lir: true 4011 lir_temps: 2 4012 4013 - name: MapObjectHasBigInt 4014 operands: 4015 mapObject: Object 4016 value: Value 4017 hash: Int32 4018 result_type: Boolean 4019 movable: true 4020 congruent_to: if_operands_equal 4021 alias_set: custom 4022 generate_lir: true 4023 lir_temps: 4 4024 4025 - name: MapObjectHasValue 4026 operands: 4027 mapObject: Object 4028 value: Value 4029 hash: Int32 4030 result_type: Boolean 4031 movable: true 4032 congruent_to: if_operands_equal 4033 alias_set: custom 4034 generate_lir: true 4035 lir_temps: 4 4036 4037 - name: MapObjectHasValueVMCall 4038 operands: 4039 mapObject: Object 4040 value: Value 4041 result_type: Boolean 4042 movable: true 4043 congruent_to: if_operands_equal 4044 alias_set: custom 4045 possibly_calls: true 4046 generate_lir: true 4047 4048 - name: MapObjectGetNonBigInt 4049 operands: 4050 mapObject: Object 4051 value: Value 4052 hash: Int32 4053 result_type: Value 4054 movable: true 4055 congruent_to: if_operands_equal 4056 alias_set: custom 4057 generate_lir: true 4058 lir_temps: 2 4059 4060 - name: MapObjectGetBigInt 4061 operands: 4062 mapObject: Object 4063 value: Value 4064 hash: Int32 4065 result_type: Value 4066 movable: true 4067 congruent_to: if_operands_equal 4068 alias_set: custom 4069 generate_lir: true 4070 lir_temps: 4 4071 4072 - name: MapObjectGetValue 4073 operands: 4074 mapObject: Object 4075 value: Value 4076 hash: Int32 4077 result_type: Value 4078 movable: true 4079 congruent_to: if_operands_equal 4080 alias_set: custom 4081 generate_lir: true 4082 lir_temps: 4 4083 4084 - name: MapObjectGetValueVMCall 4085 operands: 4086 mapObject: Object 4087 value: Value 4088 result_type: Value 4089 movable: true 4090 congruent_to: if_operands_equal 4091 alias_set: custom 4092 possibly_calls: true 4093 generate_lir: true 4094 4095 - name: MapObjectDelete 4096 operands: 4097 mapObject: Object 4098 key: Value 4099 result_type: Boolean 4100 possibly_calls: true 4101 generate_lir: true 4102 4103 - name: MapObjectSet 4104 operands: 4105 mapObject: Object 4106 key: Value 4107 value: Value 4108 possibly_calls: true 4109 generate_lir: true 4110 4111 - name: MapObjectSize 4112 operands: 4113 mapObject: Object 4114 result_type: Int32 4115 movable: true 4116 congruent_to: if_operands_equal 4117 alias_set: custom 4118 generate_lir: true 4119 4120 # Note: for now these WeakMap/WeakSet instructions are non-movable and don't 4121 # override congruentTo, but it'd probably be fine to change this in the future. 4122 - name: WeakMapGetObject 4123 operands: 4124 weakMap: Object 4125 object: Object 4126 result_type: Value 4127 alias_set: custom 4128 movable: false 4129 generate_lir: true 4130 #ifdef JS_CODEGEN_X86 4131 possibly_calls: true 4132 lir_temps: 1 4133 #else 4134 lir_temps: 7 4135 #endif 4136 4137 - name: WeakMapHasObject 4138 operands: 4139 weakMap: Object 4140 object: Object 4141 result_type: Boolean 4142 alias_set: custom 4143 movable: false 4144 generate_lir: true 4145 #ifdef JS_CODEGEN_X86 4146 possibly_calls: true 4147 #else 4148 lir_temps: 7 4149 #endif 4150 4151 - name: WeakSetHasObject 4152 operands: 4153 weakSet: Object 4154 object: Object 4155 result_type: Boolean 4156 alias_set: custom 4157 movable: false 4158 possibly_calls: true 4159 generate_lir: true 4160 4161 - name: DateFillLocalTimeSlots 4162 operands: 4163 date: Object 4164 congruent_to: if_operands_equal 4165 alias_set: custom 4166 generate_lir: true 4167 lir_temps: 1 4168 4169 - name: DateHoursFromSecondsIntoYear 4170 operands: 4171 secondsIntoYear: Value 4172 result_type: Value 4173 movable: true 4174 congruent_to: if_operands_equal 4175 alias_set: none 4176 generate_lir: true 4177 lir_temps: 2 4178 4179 - name: DateMinutesFromSecondsIntoYear 4180 operands: 4181 secondsIntoYear: Value 4182 result_type: Value 4183 movable: true 4184 congruent_to: if_operands_equal 4185 alias_set: none 4186 generate_lir: true 4187 lir_temps: 2 4188 4189 - name: DateSecondsFromSecondsIntoYear 4190 operands: 4191 secondsIntoYear: Value 4192 result_type: Value 4193 movable: true 4194 congruent_to: if_operands_equal 4195 alias_set: none 4196 generate_lir: true 4197 lir_temps: 2 4198 4199 - name: PostIntPtrConversion 4200 gen_boilerplate: false 4201 4202 - name: CanonicalizeNaN 4203 gen_boilerplate: false 4204 4205 - name: WasmNeg 4206 gen_boilerplate: false 4207 4208 - name: WasmBinaryBitwise 4209 gen_boilerplate: false 4210 4211 - name: WasmLoadInstance 4212 gen_boilerplate: false 4213 4214 - name: WasmStoreInstance 4215 gen_boilerplate: false 4216 4217 - name: WasmHeapReg 4218 gen_boilerplate: false 4219 4220 - name: WasmBoundsCheck 4221 gen_boilerplate: false 4222 4223 - name: WasmBoundsCheckRange32 4224 operands: 4225 index: Int32 4226 length: Int32 4227 limit: Int32 4228 arguments: 4229 trapSiteDesc: wasm::TrapSiteDesc 4230 result_type: Int32 4231 congruent_to: if_operands_equal 4232 type_policy: none 4233 generate_lir: true 4234 lir_result_type: none 4235 lir_temps: 1 4236 alias_set: none 4237 guard: true 4238 4239 - name: WasmExtendU32Index 4240 operands: 4241 input: Int32 4242 result_type: Int64 4243 movable: true 4244 congruent_to: if_operands_equal 4245 folds_to: custom 4246 type_policy: none 4247 alias_set: none 4248 4249 - name: WasmWrapU32Index 4250 operands: 4251 input: Int64 4252 result_type: Int32 4253 movable: true 4254 congruent_to: if_operands_equal 4255 folds_to: custom 4256 type_policy: none 4257 alias_set: none 4258 4259 - name: WasmClampTable64Address 4260 operands: 4261 address: Int64 4262 result_type: Int32 4263 movable: true 4264 congruent_to: if_operands_equal 4265 type_policy: none 4266 alias_set: none 4267 generate_lir: true 4268 4269 - name: WasmAddOffset 4270 gen_boilerplate: false 4271 4272 - name: WasmAlignmentCheck 4273 gen_boilerplate: false 4274 4275 - name: WasmLoad 4276 gen_boilerplate: false 4277 4278 - name: WasmStore 4279 gen_boilerplate: false 4280 4281 - name: AsmJSLoadHeap 4282 gen_boilerplate: false 4283 4284 - name: AsmJSStoreHeap 4285 gen_boilerplate: false 4286 4287 - name: WasmFence 4288 guard: true 4289 alias_set: none 4290 clone: true 4291 generate_lir: true 4292 4293 - name: WasmCompareExchangeHeap 4294 gen_boilerplate: false 4295 4296 - name: WasmAtomicExchangeHeap 4297 gen_boilerplate: false 4298 4299 - name: WasmAtomicBinopHeap 4300 gen_boilerplate: false 4301 4302 - name: WasmLoadInstanceDataField 4303 gen_boilerplate: false 4304 4305 - name: WasmLoadGlobalCell 4306 gen_boilerplate: false 4307 4308 - name: WasmLoadTableElement 4309 gen_boilerplate: false 4310 4311 - name: WasmStoreInstanceDataField 4312 gen_boilerplate: false 4313 4314 - name: WasmStoreGlobalCell 4315 gen_boilerplate: false 4316 4317 - name: WasmStoreStackResult 4318 gen_boilerplate: false 4319 4320 - name: WasmDerivedPointer 4321 gen_boilerplate: false 4322 4323 - name: WasmDerivedIndexPointer 4324 gen_boilerplate: false 4325 4326 - name: WasmStoreRef 4327 gen_boilerplate: false 4328 4329 - name: WasmPostWriteBarrierWholeCell 4330 gen_boilerplate: false 4331 4332 - name: WasmPostWriteBarrierEdgeAtIndex 4333 gen_boilerplate: false 4334 4335 - name: WasmParameter 4336 gen_boilerplate: false 4337 4338 - name: WasmReturn 4339 gen_boilerplate: false 4340 4341 - name: WasmReturnVoid 4342 gen_boilerplate: false 4343 4344 - name: WasmStackArg 4345 gen_boilerplate: false 4346 4347 - name: WasmRegisterResult 4348 gen_boilerplate: false 4349 4350 - name: WasmFloatRegisterResult 4351 gen_boilerplate: false 4352 4353 - name: WasmSystemFloatRegisterResult 4354 gen_boilerplate: false 4355 4356 - name: WasmRegister64Result 4357 gen_boilerplate: false 4358 4359 - name: WasmStackResultArea 4360 gen_boilerplate: false 4361 4362 - name: WasmStackResult 4363 gen_boilerplate: false 4364 4365 - name: WasmCallCatchable 4366 gen_boilerplate: false 4367 4368 - name: WasmCallUncatchable 4369 gen_boilerplate: false 4370 4371 - name: WasmCallLandingPrePad 4372 gen_boilerplate: false 4373 generate_lir: true 4374 4375 - name: WasmReturnCall 4376 gen_boilerplate: false 4377 4378 - name: WasmSelect 4379 gen_boilerplate: false 4380 4381 - name: ReinterpretCast 4382 gen_boilerplate: false 4383 4384 - name: Rotate 4385 gen_boilerplate: false 4386 4387 - name: WasmStackSwitchToMain 4388 operands: 4389 instance: WasmAnyRef 4390 suspender: WasmAnyRef 4391 fn: WasmAnyRef 4392 data: WasmAnyRef 4393 result_type: WasmAnyRef 4394 type_policy: none 4395 possibly_calls: true 4396 generate_lir: true 4397 4398 - name: WasmStackSwitchToSuspendable 4399 operands: 4400 instance: WasmAnyRef 4401 suspender: WasmAnyRef 4402 fn: WasmAnyRef 4403 data: WasmAnyRef 4404 type_policy: none 4405 possibly_calls: true 4406 generate_lir: true 4407 4408 - name: WasmStackContinueOnSuspendable 4409 operands: 4410 instance: WasmAnyRef 4411 suspender: WasmAnyRef 4412 result: WasmAnyRef 4413 type_policy: none 4414 possibly_calls: true 4415 generate_lir: true 4416 lir_temps: 2 4417 4418 - name: WasmBinarySimd128 4419 gen_boilerplate: false 4420 4421 - name: WasmBinarySimd128WithConstant 4422 gen_boilerplate: false 4423 4424 # (v128, i32) -> v128 effect-free shift operations. 4425 - name: WasmShiftSimd128 4426 operands: 4427 lhs: Simd128 4428 rhs: Int32 4429 arguments: 4430 simdOp: wasm::SimdOp 4431 type_policy: none 4432 result_type: Simd128 4433 movable: true 4434 congruent_to: custom 4435 alias_set: none 4436 clone: true 4437 4438 # (v128, v128, mask) -> v128 effect-free operation. 4439 - name: WasmShuffleSimd128 4440 operands: 4441 lhs: Simd128 4442 rhs: Simd128 4443 arguments: 4444 shuffle: SimdShuffle 4445 type_policy: none 4446 result_type: Simd128 4447 movable: true 4448 congruent_to: custom 4449 alias_set: none 4450 clone: true 4451 4452 - name: WasmReplaceLaneSimd128 4453 gen_boilerplate: false 4454 4455 - name: WasmUnarySimd128 4456 operands: 4457 src: Simd128 4458 arguments: 4459 simdOp: wasm::SimdOp 4460 type_policy: none 4461 result_type: Simd128 4462 movable: true 4463 congruent_to: custom 4464 alias_set: none 4465 clone: true 4466 generate_lir: true 4467 # temp is FPR (if in use). 4468 lir_temps: 1 4469 4470 - name: WasmTernarySimd128 4471 gen_boilerplate: false 4472 4473 - name: WasmScalarToSimd128 4474 gen_boilerplate: false 4475 4476 - name: WasmReduceSimd128 4477 gen_boilerplate: false 4478 4479 - name: WasmLoadLaneSimd128 4480 gen_boilerplate: false 4481 4482 - name: WasmStoreLaneSimd128 4483 gen_boilerplate: false 4484 4485 - name: UnreachableResult 4486 gen_boilerplate: false 4487 4488 - name: IonToWasmCall 4489 gen_boilerplate: false 4490 4491 - name: WasmLoadField 4492 gen_boilerplate: false 4493 4494 - name: WasmLoadElement 4495 gen_boilerplate: false 4496 4497 - name: WasmStoreField 4498 gen_boilerplate: false 4499 4500 - name: WasmStoreFieldRef 4501 gen_boilerplate: false 4502 4503 - name: WasmStoreElement 4504 gen_boilerplate: false 4505 4506 - name: WasmStoreElementRef 4507 gen_boilerplate: false 4508 4509 - name: WasmRefAsNonNull 4510 gen_boilerplate: false 4511 4512 - name: WasmRefTestConcrete 4513 gen_boilerplate: false 4514 4515 - name: WasmRefTestAbstract 4516 gen_boilerplate: false 4517 4518 - name: WasmRefCastConcrete 4519 gen_boilerplate: false 4520 4521 - name: WasmRefCastAbstract 4522 gen_boilerplate: false 4523 4524 - name: WasmRefConvertAnyExtern 4525 gen_boilerplate: false 4526 4527 - name: WasmNewStructObject 4528 gen_boilerplate: false 4529 4530 - name: WasmNewArrayObject 4531 gen_boilerplate: false 4532 4533 #ifdef FUZZING_JS_FUZZILLI 4534 - name: FuzzilliHash 4535 gen_boilerplate: false 4536 4537 - name: FuzzilliHashStore 4538 gen_boilerplate: false 4539 #endif 4540 4541 #ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT 4542 - name: AddDisposableResource 4543 operands: 4544 environment: Object 4545 resource: Value 4546 method: Value 4547 needsClosure: Boolean 4548 arguments: 4549 hint: uint8_t 4550 possibly_calls: true 4551 generate_lir: true 4552 4553 - name: TakeDisposeCapability 4554 operands: 4555 environment: Object 4556 result_type: Value 4557 generate_lir: true 4558 4559 - name: CreateSuppressedError 4560 operands: 4561 error: Value 4562 suppressed: Value 4563 result_type: Object 4564 alias_set: none 4565 possibly_calls: true 4566 generate_lir: true 4567 #endif