/ bytecode / BytecodeList.rb
BytecodeList.rb
   1  # Copyright (C) 2018-2019 Apple Inc. All rights reserved.
   2  #
   3  # Redistribution and use in source and binary forms, with or without
   4  # modification, are permitted provided that the following conditions
   5  # are met:
   6  # 1. Redistributions of source code must retain the above copyright
   7  #    notice, this list of conditions and the following disclaimer.
   8  # 2. Redistributions in binary form must reproduce the above copyright
   9  #    notice, this list of conditions and the following disclaimer in the
  10  #    documentation and/or other materials provided with the distribution.
  11  #
  12  # THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
  13  # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  14  # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  15  # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
  16  # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  17  # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18  # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  19  # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  20  # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21  # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  22  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23  
  24  types [
  25      :VirtualRegister,
  26  
  27      :BasicBlockLocation,
  28      :BoundLabel,
  29      :DebugHookType,
  30      :ECMAMode,
  31      :ErrorTypeWithExtension,
  32      :GetByIdMode,
  33      :GetByIdModeMetadata,
  34      :GetByValHistory,
  35      :GetPutInfo,
  36      :IndexingType,
  37      :IterationModeMetadata,
  38      :JSCell,
  39      :JSGlobalLexicalEnvironment,
  40      :JSGlobalObject,
  41      :JSModuleEnvironment,
  42      :JSObject,
  43      :JSScope,
  44      :JSType,
  45      :JSValue,
  46      :LLIntCallLinkInfo,
  47      :ResultType,
  48      :OperandTypes,
  49      :PrivateFieldPutKind,
  50      :ProfileTypeBytecodeFlag,
  51      :PropertyOffset,
  52      :PutByIdFlags,
  53      :ResolveType,
  54      :Structure,
  55      :StructureID,
  56      :StructureChain,
  57      :SymbolTable,
  58      :SymbolTableOrScopeDepth,
  59      :ToThisStatus,
  60      :TypeLocation,
  61      :WasmBoundLabel,
  62      :WatchpointSet,
  63  
  64      :ValueProfile,
  65      :ValueProfileAndVirtualRegisterBuffer,
  66      :UnaryArithProfile,
  67      :BinaryArithProfile,
  68      :ArrayProfile,
  69      :ArrayAllocationProfile,
  70      :ObjectAllocationProfile,
  71  ]
  72  
  73  templates [
  74      :WriteBarrier,
  75      :WriteBarrierBase,
  76  ]
  77  
  78  
  79  begin_section :Bytecode,
  80      emit_in_h_file: true,
  81      emit_in_structs_file: true,
  82      emit_in_asm_file: true,
  83      emit_opcode_id_string_values_in_h_file: true,
  84      macro_name_component: :BYTECODE,
  85      asm_prefix: "llint_",
  86      op_prefix: "op_"
  87  
  88  op :wide16
  89  op :wide32
  90  
  91  op :enter
  92  
  93  op :get_scope,
  94      args: {
  95          dst: VirtualRegister
  96      }
  97  
  98  op :create_direct_arguments,
  99      args: {
 100          dst: VirtualRegister,
 101      }
 102  
 103  op :create_scoped_arguments,
 104      args: {
 105          dst: VirtualRegister,
 106          scope: VirtualRegister,
 107      }
 108  
 109  op :create_cloned_arguments,
 110      args: {
 111          dst: VirtualRegister,
 112      }
 113  
 114  op :create_arguments_butterfly,
 115      args: {
 116          dst: VirtualRegister,
 117      }
 118  
 119  op :create_this,
 120      args: {
 121          dst: VirtualRegister,
 122          callee: VirtualRegister,
 123          inlineCapacity: unsigned,
 124      },
 125      metadata: {
 126          cachedCallee: WriteBarrier[JSCell]
 127      }
 128  
 129  op :create_promise,
 130      args: {
 131          dst: VirtualRegister,
 132          callee: VirtualRegister,
 133          isInternalPromise: bool,
 134      },
 135      metadata: {
 136          cachedCallee: WriteBarrier[JSCell]
 137      }
 138  
 139  op :new_promise,
 140      args: {
 141          dst: VirtualRegister,
 142          isInternalPromise: bool,
 143      }
 144  
 145  op :new_generator,
 146      args: {
 147          dst: VirtualRegister,
 148      }
 149  
 150  op_group :CreateInternalFieldObjectOp,
 151      [
 152          :create_generator,
 153          :create_async_generator,
 154      ],
 155      args: {
 156          dst: VirtualRegister,
 157          callee: VirtualRegister,
 158      },
 159      metadata: {
 160          cachedCallee: WriteBarrier[JSCell]
 161      }
 162  
 163  op :get_argument,
 164      args: {
 165          dst: VirtualRegister,
 166          index: int,
 167      },
 168      metadata: {
 169          profile: ValueProfile,
 170      }
 171  
 172  op :argument_count,
 173      args: {
 174          dst: VirtualRegister,
 175      }
 176  
 177  op :to_this,
 178      args: {
 179          srcDst: VirtualRegister,
 180          ecmaMode: ECMAMode,
 181      },
 182      metadata: {
 183          cachedStructureID: StructureID,
 184          toThisStatus: ToThisStatus,
 185          profile: ValueProfile,
 186      }
 187  
 188  op :check_tdz,
 189      args: {
 190          targetVirtualRegister: VirtualRegister,
 191      }
 192  
 193  op :new_object,
 194      args: {
 195          dst: VirtualRegister,
 196          inlineCapacity: unsigned,
 197      },
 198      metadata: {
 199          objectAllocationProfile: ObjectAllocationProfile,
 200      }
 201  
 202  op :new_array,
 203      args: {
 204          dst: VirtualRegister,
 205          argv: VirtualRegister,
 206          argc: unsigned,
 207          recommendedIndexingType: IndexingType,
 208      },
 209      metadata: {
 210          arrayAllocationProfile: ArrayAllocationProfile,
 211      }
 212  
 213  op :new_array_with_size,
 214      args: {
 215          dst: VirtualRegister,
 216          length: VirtualRegister,
 217      },
 218      metadata: {
 219          arrayAllocationProfile: ArrayAllocationProfile,
 220      }
 221  
 222  op :new_array_buffer,
 223      args: {
 224          dst: VirtualRegister,
 225          immutableButterfly: VirtualRegister,
 226          recommendedIndexingType: IndexingType
 227      },
 228      metadata: {
 229          arrayAllocationProfile: ArrayAllocationProfile,
 230      }
 231  
 232  op :new_array_with_spread,
 233      args: {
 234          dst: VirtualRegister,
 235          argv: VirtualRegister,
 236          argc: unsigned,
 237          bitVector: unsigned,
 238      }
 239  
 240  op :spread,
 241      args: {
 242          dst: VirtualRegister,
 243          argument: VirtualRegister,
 244      }
 245  
 246  op :new_regexp,
 247      args: {
 248          dst: VirtualRegister,
 249          regexp: VirtualRegister,
 250      }
 251  
 252  op :mov,
 253      args: {
 254          dst: VirtualRegister,
 255          src: VirtualRegister,
 256      }
 257  
 258  op_group :BinaryOp,
 259      [
 260          :eq,
 261          :neq,
 262          :stricteq,
 263          :nstricteq,
 264          :less,
 265          :lesseq,
 266          :greater,
 267          :greatereq,
 268          :below,
 269          :beloweq,
 270          :mod,
 271          :pow,
 272          :urshift,
 273      ],
 274      args: {
 275          dst: VirtualRegister,
 276          lhs: VirtualRegister,
 277          rhs: VirtualRegister,
 278      }
 279  
 280  op_group :ProfiledBinaryOp,
 281      [
 282          :add,
 283          :mul,
 284          :div,
 285          :sub,
 286      ],
 287      args: {
 288          dst: VirtualRegister,
 289          lhs: VirtualRegister,
 290          rhs: VirtualRegister,
 291          operandTypes: OperandTypes,
 292      },
 293      metadata: {
 294          arithProfile: BinaryArithProfile
 295      }
 296  
 297  op_group :ValueProfiledBinaryOp,
 298      [
 299          :bitand,
 300          :bitor,
 301          :bitxor,
 302          :lshift,
 303          :rshift,
 304      ],
 305      args: {
 306          dst: VirtualRegister,
 307          lhs: VirtualRegister,
 308          rhs: VirtualRegister,
 309      },
 310      metadata: {
 311          profile: ValueProfile
 312      }
 313  
 314  op :bitnot,
 315      args: {
 316          dst: VirtualRegister,
 317          operand: VirtualRegister,
 318      },
 319      metadata: {
 320          profile: ValueProfile
 321      }
 322  
 323  op_group :UnaryOp,
 324      [
 325          :eq_null,
 326          :neq_null,
 327          :to_string,
 328          :unsigned,
 329          :is_empty,
 330          :typeof_is_undefined,
 331          :typeof_is_object,
 332          :typeof_is_function,
 333          :is_undefined_or_null,
 334          :is_boolean,
 335          :is_number,
 336          :is_big_int,
 337          :is_object,
 338          :is_callable,
 339          :is_constructor,
 340      ],
 341      args: {
 342          dst: VirtualRegister,
 343          operand: VirtualRegister,
 344      }
 345  
 346  op_group :UnaryInPlaceProfiledOp,
 347      [
 348          :inc,
 349          :dec,
 350      ],
 351      args: {
 352          srcDst: VirtualRegister,
 353      },
 354      metadata: {
 355          arithProfile: UnaryArithProfile
 356      }
 357  
 358  op :to_object,
 359      args: {
 360          dst: VirtualRegister,
 361          operand: VirtualRegister,
 362          message: unsigned,
 363      },
 364      metadata: {
 365          profile: ValueProfile,
 366      }
 367  
 368  op_group :ValueProfiledUnaryOp,
 369      [
 370          :to_number,
 371          :to_numeric,
 372      ],
 373      args: {
 374          dst: VirtualRegister,
 375          operand: VirtualRegister,
 376      },
 377      metadata: {
 378          profile: ValueProfile,
 379      }
 380  
 381  op :negate,
 382      args: {
 383          dst: VirtualRegister,
 384          operand: VirtualRegister,
 385          resultType: ResultType,
 386      },
 387      metadata: {
 388          arithProfile: UnaryArithProfile,
 389      }
 390  
 391  op :not,
 392      args: {
 393          dst: VirtualRegister,
 394          operand: VirtualRegister,
 395      }
 396  
 397  
 398  op :identity_with_profile,
 399      args: {
 400          srcDst: VirtualRegister,
 401          topProfile: unsigned,
 402          bottomProfile: unsigned,
 403      }
 404  
 405  op :overrides_has_instance,
 406      args: {
 407          dst: VirtualRegister,
 408          constructor: VirtualRegister,
 409          hasInstanceValue: VirtualRegister,
 410      }
 411  
 412  op :instanceof,
 413      args: {
 414          dst: VirtualRegister,
 415          value: VirtualRegister,
 416          prototype: VirtualRegister,
 417      }
 418  
 419  op :instanceof_custom,
 420      args: {
 421          dst: VirtualRegister,
 422          value: VirtualRegister,
 423          constructor: VirtualRegister,
 424          hasInstanceValue: VirtualRegister,
 425      }
 426  
 427  op :typeof,
 428      args: {
 429          dst: VirtualRegister,
 430          value: VirtualRegister,
 431      }
 432  
 433  op :is_cell_with_type,
 434      args: {
 435          dst: VirtualRegister,
 436          operand: VirtualRegister,
 437          type: JSType,
 438      }
 439  
 440  op :in_by_val,
 441      args: {
 442          dst: VirtualRegister,
 443          base: VirtualRegister,
 444          property: VirtualRegister,
 445      },
 446      metadata: {
 447          arrayProfile: ArrayProfile,
 448      }
 449  
 450  op :in_by_id,
 451      args: {
 452          dst: VirtualRegister,
 453          base: VirtualRegister,
 454          property: unsigned,
 455      }
 456  
 457  op :get_by_id,
 458      args: {
 459          dst: VirtualRegister,
 460          base: VirtualRegister,
 461          property: unsigned,
 462      },
 463      metadata: {
 464          modeMetadata: GetByIdModeMetadata,
 465          profile: ValueProfile,
 466      }
 467  
 468  op :get_by_id_with_this,
 469      args: {
 470          dst: VirtualRegister,
 471          base: VirtualRegister,
 472          thisValue: VirtualRegister,
 473          property: unsigned,
 474      },
 475      metadata: {
 476          profile: ValueProfile,
 477      }
 478  
 479  op :get_by_val_with_this,
 480      args: {
 481          dst: VirtualRegister,
 482          base: VirtualRegister,
 483          thisValue: VirtualRegister,
 484          property: VirtualRegister,
 485      },
 486      metadata: {
 487          profile: ValueProfile,
 488      }
 489  
 490  op :get_by_id_direct,
 491      args: {
 492          dst: VirtualRegister,
 493          base: VirtualRegister,
 494          property: unsigned,
 495      },
 496      metadata: {
 497          profile: ValueProfile, # not used in llint
 498          structureID: StructureID,
 499          offset: unsigned,
 500      }
 501  
 502  op :get_prototype_of,
 503      args: {
 504          dst: VirtualRegister,
 505          value: VirtualRegister,
 506      },
 507      metadata: {
 508          profile: ValueProfile,
 509      }
 510  
 511  op :try_get_by_id,
 512      args: {
 513          dst: VirtualRegister,
 514          base: VirtualRegister,
 515          property: unsigned,
 516      },
 517      metadata: {
 518          profile: ValueProfile,
 519      }
 520  
 521  op :put_by_id,
 522      args: {
 523          base: VirtualRegister,
 524          property: unsigned,
 525          value: VirtualRegister,
 526          flags: PutByIdFlags,
 527      },
 528      metadata: {
 529          oldStructureID: StructureID,
 530          offset: unsigned,
 531          newStructureID: StructureID,
 532          structureChain: WriteBarrierBase[StructureChain],
 533      }
 534  
 535  op :put_by_id_with_this,
 536      args: {
 537          base: VirtualRegister,
 538          thisValue: VirtualRegister,
 539          property: unsigned,
 540          value: VirtualRegister,
 541          ecmaMode: ECMAMode,
 542      }
 543  
 544  op :del_by_id,
 545      args: {
 546          dst: VirtualRegister,
 547          base: VirtualRegister,
 548          property: unsigned,
 549          ecmaMode: ECMAMode,
 550      }
 551  
 552  op :get_by_val,
 553      args: {
 554          dst: VirtualRegister,
 555          base: VirtualRegister,
 556          property: VirtualRegister,
 557      },
 558      metadata: {
 559          profile: ValueProfile,
 560          arrayProfile: ArrayProfile,
 561          seenIdentifiers: GetByValHistory,
 562      }
 563  
 564  op :get_private_name,
 565      args: {
 566          dst: VirtualRegister,
 567          base: VirtualRegister,
 568          property: VirtualRegister,
 569      },
 570      metadata: {
 571          profile: ValueProfile,
 572          structureID: StructureID,
 573          offset: unsigned,
 574          property: WriteBarrier[JSCell],
 575      }
 576  
 577  op :put_private_name,
 578      args: {
 579          base: VirtualRegister,
 580          property: VirtualRegister,
 581          value: VirtualRegister,
 582          putKind: PrivateFieldPutKind,
 583      },
 584      metadata: {
 585          oldStructureID: StructureID,
 586          property: WriteBarrier[JSCell],
 587          offset: unsigned,
 588          newStructureID: StructureID,
 589      }
 590  
 591  op :put_by_val,
 592      args: {
 593          base: VirtualRegister,
 594          property: VirtualRegister,
 595          value: VirtualRegister,
 596          ecmaMode: ECMAMode,
 597      },
 598      metadata: {
 599          arrayProfile: ArrayProfile,
 600      }
 601  
 602  op :put_by_val_with_this,
 603      args: {
 604          base: VirtualRegister,
 605          thisValue: VirtualRegister,
 606          property: VirtualRegister,
 607          value: VirtualRegister,
 608          ecmaMode: ECMAMode,
 609      }
 610  
 611  op :put_by_val_direct,
 612      args: {
 613          base: VirtualRegister,
 614          property: VirtualRegister,
 615          value: VirtualRegister,
 616          ecmaMode: ECMAMode,
 617      },
 618      metadata: {
 619          arrayProfile: ArrayProfile,
 620      }
 621  
 622  op :del_by_val,
 623      args: {
 624          dst: VirtualRegister,
 625          base: VirtualRegister,
 626          property: VirtualRegister,
 627          ecmaMode: ECMAMode,
 628      }
 629  
 630  op :put_getter_by_id,
 631      args: {
 632          base: VirtualRegister,
 633          property: unsigned,
 634          attributes: unsigned,
 635          accessor: VirtualRegister,
 636      }
 637  
 638  op :put_setter_by_id,
 639      args: {
 640          base: VirtualRegister,
 641          property: unsigned,
 642          attributes: unsigned,
 643          accessor: VirtualRegister,
 644      }
 645  
 646  op :put_getter_setter_by_id,
 647      args: {
 648          base: VirtualRegister,
 649          property: unsigned,
 650          attributes: unsigned,
 651          getter: VirtualRegister,
 652          setter: VirtualRegister,
 653      }
 654  
 655  op :put_getter_by_val,
 656      args: {
 657          base: VirtualRegister,
 658          property: VirtualRegister,
 659          attributes: unsigned,
 660          accessor: VirtualRegister,
 661      }
 662  
 663  op :put_setter_by_val,
 664      args: {
 665          base: VirtualRegister,
 666          property: VirtualRegister,
 667          attributes: unsigned,
 668          accessor: VirtualRegister,
 669      }
 670  
 671  op :define_data_property,
 672      args: {
 673          base: VirtualRegister,
 674          property: VirtualRegister,
 675          value: VirtualRegister,
 676          attributes: VirtualRegister,
 677      }
 678  
 679  op :define_accessor_property,
 680      args: {
 681          base: VirtualRegister,
 682          property: VirtualRegister,
 683          getter: VirtualRegister,
 684          setter: VirtualRegister,
 685          attributes: VirtualRegister,
 686      }
 687  
 688  op :jmp,
 689      args: {
 690          targetLabel: BoundLabel,
 691      }
 692  
 693  op :jtrue,
 694      args: {
 695          condition: VirtualRegister,
 696          targetLabel: BoundLabel,
 697      }
 698  
 699  op :jfalse,
 700      args: {
 701          condition: VirtualRegister,
 702          targetLabel: BoundLabel,
 703      }
 704  
 705  op :jeq_null,
 706      args: {
 707          value: VirtualRegister,
 708          targetLabel: BoundLabel,
 709      }
 710  
 711  op :jneq_null,
 712      args: {
 713          value: VirtualRegister,
 714          targetLabel: BoundLabel,
 715      }
 716  
 717  op :jundefined_or_null,
 718      args: {
 719          value: VirtualRegister,
 720          targetLabel: BoundLabel,
 721      }
 722  
 723  op :jnundefined_or_null,
 724      args: {
 725          value: VirtualRegister,
 726          targetLabel: BoundLabel,
 727      }
 728  
 729  op :jneq_ptr,
 730      args: {
 731          value: VirtualRegister,
 732          specialPointer: VirtualRegister,
 733          targetLabel: BoundLabel,
 734      },
 735      metadata: {
 736          hasJumped: bool,
 737      }
 738  
 739  op_group :BinaryJmp,
 740      [
 741          :jeq,
 742          :jstricteq,
 743          :jneq,
 744          :jnstricteq,
 745          :jless,
 746          :jlesseq,
 747          :jgreater,
 748          :jgreatereq,
 749          :jnless,
 750          :jnlesseq,
 751          :jngreater,
 752          :jngreatereq,
 753          :jbelow,
 754          :jbeloweq,
 755      ],
 756      args: {
 757          lhs: VirtualRegister,
 758          rhs: VirtualRegister,
 759          targetLabel: BoundLabel,
 760      }
 761  
 762  op :loop_hint
 763  
 764  op_group :SwitchValue,
 765      [
 766          :switch_imm,
 767          :switch_char,
 768          :switch_string,
 769      ],
 770      args: {
 771          tableIndex: unsigned,
 772          defaultOffset: BoundLabel,
 773          scrutinee: VirtualRegister,
 774      }
 775  
 776  op_group :NewFunction,
 777      [
 778          :new_func,
 779          :new_func_exp,
 780          :new_generator_func,
 781          :new_generator_func_exp,
 782          :new_async_func,
 783          :new_async_func_exp,
 784          :new_async_generator_func,
 785          :new_async_generator_func_exp,
 786      ],
 787      args: {
 788          dst: VirtualRegister,
 789          scope: VirtualRegister,
 790          functionDecl: unsigned,
 791      }
 792  
 793  op :set_function_name,
 794      args: {
 795          function: VirtualRegister,
 796          name: VirtualRegister,
 797      }
 798  
 799  # op_call variations
 800  op :call,
 801      args: {
 802          dst: VirtualRegister,
 803          callee: VirtualRegister,
 804          argc: unsigned,
 805          argv: unsigned,
 806      },
 807      metadata: {
 808          callLinkInfo: LLIntCallLinkInfo,
 809          profile: ValueProfile,
 810      }
 811  
 812  op :tail_call,
 813      args: {
 814          dst: VirtualRegister,
 815          callee: VirtualRegister,
 816          argc: unsigned,
 817          argv: unsigned,
 818      },
 819      metadata: {
 820          callLinkInfo: LLIntCallLinkInfo,
 821          profile: ValueProfile,
 822      }
 823  
 824  op :call_eval,
 825      args: {
 826          dst: VirtualRegister,
 827          callee: VirtualRegister,
 828          argc: unsigned,
 829          argv: unsigned,
 830          ecmaMode: ECMAMode,
 831      },
 832      metadata: {
 833          callLinkInfo: LLIntCallLinkInfo,
 834          profile: ValueProfile,
 835      }
 836  
 837  op :call_varargs,
 838      args: {
 839          dst: VirtualRegister,
 840          callee: VirtualRegister,
 841          thisValue?: VirtualRegister,
 842          arguments?: VirtualRegister,
 843          firstFree: VirtualRegister,
 844          firstVarArg: int,
 845      },
 846      metadata: {
 847          arrayProfile: ArrayProfile,
 848          profile: ValueProfile,
 849      },
 850      tmps: {
 851          argCountIncludingThis: unsigned,
 852      },
 853      checkpoints: {
 854          determiningArgCount: nil,
 855          makeCall: nil,
 856      }
 857  
 858  op :tail_call_varargs,
 859      args: {
 860          dst: VirtualRegister,
 861          callee: VirtualRegister,
 862          thisValue?: VirtualRegister,
 863          arguments?: VirtualRegister,
 864          firstFree: VirtualRegister,
 865          firstVarArg: int,
 866      },
 867      metadata: {
 868          arrayProfile: ArrayProfile,
 869          profile: ValueProfile,
 870      },
 871      tmps: {
 872          argCountIncludingThis: unsigned
 873      },
 874      checkpoints: {
 875          determiningArgCount: nil,
 876          makeCall: nil,
 877      }
 878  
 879  op :tail_call_forward_arguments,
 880      args: {
 881          dst: VirtualRegister,
 882          callee: VirtualRegister,
 883          thisValue?: VirtualRegister,
 884          arguments?: VirtualRegister,
 885          firstFree: VirtualRegister,
 886          firstVarArg: int,
 887      },
 888      metadata: {
 889          arrayProfile: ArrayProfile,
 890          profile: ValueProfile,
 891      }
 892  
 893  op :construct,
 894      args: {
 895          dst: VirtualRegister,
 896          callee: VirtualRegister,
 897          argc: unsigned,
 898          argv: unsigned,
 899      },
 900      metadata: {
 901          callLinkInfo: LLIntCallLinkInfo,
 902          profile: ValueProfile,
 903      }
 904  
 905  op :construct_varargs,
 906      args: {
 907          dst: VirtualRegister,
 908          callee: VirtualRegister,
 909          thisValue?: VirtualRegister,
 910          arguments?: VirtualRegister,
 911          firstFree: VirtualRegister,
 912          firstVarArg: int,
 913      },
 914      metadata: {
 915          arrayProfile: ArrayProfile,
 916          profile: ValueProfile,
 917      },
 918      tmps: {
 919          argCountIncludingThis: unsigned
 920      },
 921      checkpoints: {
 922          determiningArgCount: nil,
 923          makeCall: nil,
 924      }
 925  
 926  op :ret,
 927      args: {
 928          value: VirtualRegister,
 929      }
 930  
 931  op :strcat,
 932      args: {
 933          dst: VirtualRegister,
 934          src: VirtualRegister,
 935          count: int,
 936      }
 937  
 938  op :to_primitive,
 939      args: {
 940          dst: VirtualRegister,
 941          src: VirtualRegister,
 942      }
 943  
 944  op :to_property_key,
 945      args: {
 946          dst: VirtualRegister,
 947          src: VirtualRegister,
 948      }
 949  
 950  op :resolve_scope,
 951      args: {
 952          dst: VirtualRegister, # offset 1
 953          scope: VirtualRegister, # offset 2
 954          var: unsigned, # offset 3
 955          # $begin: :private,
 956          resolveType: ResolveType,
 957          localScopeDepth: unsigned,
 958      },
 959      metadata: {
 960          resolveType: ResolveType, # offset 4
 961          _0: { # offset 5
 962              localScopeDepth: unsigned,
 963              globalLexicalBindingEpoch: unsigned,
 964          },
 965          _1: { # offset 6
 966               # written during linking
 967               lexicalEnvironment: WriteBarrierBase[JSCell], # lexicalEnvironment && type == ModuleVar
 968               symbolTable: WriteBarrierBase[SymbolTable], # lexicalEnvironment && type != ModuleVar
 969  
 970               constantScope: WriteBarrierBase[JSScope],
 971  
 972               # written from the slow path
 973               globalLexicalEnvironment: WriteBarrierBase[JSGlobalLexicalEnvironment],
 974               globalObject: WriteBarrierBase[JSGlobalObject],
 975          },
 976      }
 977  
 978  op :get_from_scope,
 979      args: {
 980          dst: VirtualRegister, # offset  1
 981          scope: VirtualRegister, # offset 2
 982          var: unsigned, # offset 3
 983          # $begin: :private,
 984          getPutInfo: GetPutInfo,
 985          localScopeDepth: unsigned,
 986          offset: unsigned,
 987      },
 988      metadata: {
 989          getPutInfo: GetPutInfo, # offset 4
 990          _: { #previously offset 5
 991              watchpointSet: WatchpointSet.*,
 992              structure: WriteBarrierBase[Structure],
 993          },
 994          operand: uintptr_t, #offset 6
 995          profile: ValueProfile, # offset 7
 996      },
 997      metadata_initializers: {
 998          getPutInfo: :getPutInfo,
 999          operand: :offset,
1000      }
1001  
1002  op :put_to_scope,
1003      args: {
1004          scope: VirtualRegister, # offset 1
1005          var: unsigned, # offset 2
1006          value: VirtualRegister, # offset 3
1007          # $begin: :private,
1008          getPutInfo: GetPutInfo,
1009          symbolTableOrScopeDepth: SymbolTableOrScopeDepth,
1010          offset: unsigned,
1011      },
1012      metadata: {
1013          getPutInfo: GetPutInfo, # offset 4
1014          _: { # offset 5
1015              structure: WriteBarrierBase[Structure],
1016              watchpointSet: WatchpointSet.*,
1017          },
1018          operand: uintptr_t, # offset 6
1019      },
1020      metadata_initializers: {
1021          getPutInfo: :getPutInfo,
1022          operand: :offset,
1023      }
1024  
1025  op :get_from_arguments,
1026      args: {
1027          dst: VirtualRegister,
1028          arguments: VirtualRegister,
1029          index: unsigned,
1030      },
1031      metadata: {
1032          profile: ValueProfile,
1033      }
1034  
1035  op :put_to_arguments,
1036      args: {
1037          arguments: VirtualRegister,
1038          index: unsigned,
1039          value: VirtualRegister,
1040      }
1041  
1042  op :push_with_scope,
1043      args: {
1044          dst: VirtualRegister,
1045          currentScope: VirtualRegister,
1046          newScope: VirtualRegister,
1047      }
1048  
1049  op :create_lexical_environment,
1050      args: {
1051          dst: VirtualRegister,
1052          scope: VirtualRegister,
1053          symbolTable: VirtualRegister,
1054          initialValue: VirtualRegister,
1055      }
1056  
1057  op :create_generator_frame_environment,
1058      args: {
1059          dst: VirtualRegister,
1060          scope: VirtualRegister,
1061          symbolTable: VirtualRegister,
1062          initialValue: VirtualRegister,
1063      }
1064  
1065  op :get_parent_scope,
1066      args: {
1067          dst: VirtualRegister,
1068          scope: VirtualRegister,
1069      }
1070  
1071  op :catch,
1072      args: {
1073          exception: VirtualRegister,
1074          thrownValue: VirtualRegister,
1075      },
1076      metadata: {
1077          buffer: ValueProfileAndVirtualRegisterBuffer.*,
1078      }
1079  
1080  op :throw,
1081      args: {
1082          value: VirtualRegister,
1083      }
1084  
1085  op :throw_static_error,
1086      args: {
1087          message: VirtualRegister,
1088          errorType: ErrorTypeWithExtension,
1089      }
1090  
1091  op :debug,
1092      args: {
1093          debugHookType: DebugHookType,
1094          hasBreakpoint: bool,
1095      }
1096  
1097  op :end,
1098      args: {
1099          value: VirtualRegister,
1100      }
1101  
1102  op :profile_type,
1103      args: {
1104          targetVirtualRegister: VirtualRegister,
1105          symbolTableOrScopeDepth: SymbolTableOrScopeDepth,
1106          flag: ProfileTypeBytecodeFlag,
1107          identifier?: unsigned,
1108          resolveType: ResolveType,
1109      },
1110      metadata: {
1111          typeLocation: TypeLocation.*,
1112      }
1113  
1114  op :profile_control_flow,
1115      args: {
1116          textOffset: int,
1117      },
1118      metadata: {
1119          basicBlockLocation: BasicBlockLocation.*,
1120      }
1121  
1122  op :get_enumerable_length,
1123      args: {
1124          dst: VirtualRegister,
1125          base: VirtualRegister,
1126      }
1127  
1128  op :has_enumerable_indexed_property,
1129      args: {
1130          dst: VirtualRegister,
1131          base: VirtualRegister,
1132          property: VirtualRegister,
1133      },
1134      metadata: {
1135          arrayProfile: ArrayProfile,
1136      }
1137  
1138  op :has_enumerable_structure_property,
1139      args: {
1140          dst: VirtualRegister,
1141          base: VirtualRegister,
1142          property: VirtualRegister,
1143          enumerator: VirtualRegister,
1144      }
1145  
1146  op :has_own_structure_property,
1147      args: {
1148          dst: VirtualRegister,
1149          base: VirtualRegister,
1150          property: VirtualRegister,
1151          enumerator: VirtualRegister,
1152      }
1153  
1154  op :in_structure_property,
1155      args: {
1156          dst: VirtualRegister,
1157          base: VirtualRegister,
1158          property: VirtualRegister,
1159          enumerator: VirtualRegister,
1160      }
1161  
1162  op :has_enumerable_property,
1163      args: {
1164          dst: VirtualRegister,
1165          base: VirtualRegister,
1166          property: VirtualRegister,
1167      }
1168  
1169  op :get_direct_pname,
1170      args: {
1171          dst: VirtualRegister,
1172          base: VirtualRegister,
1173          property: VirtualRegister,
1174          index: VirtualRegister,
1175          enumerator: VirtualRegister,
1176      },
1177      metadata: {
1178          profile: ValueProfile,
1179      }
1180  
1181  op :get_property_enumerator,
1182      args: {
1183          dst: VirtualRegister,
1184          base: VirtualRegister,
1185      }
1186  
1187  op :enumerator_structure_pname,
1188      args: {
1189          dst: VirtualRegister,
1190          enumerator: VirtualRegister,
1191          index: VirtualRegister,
1192      }
1193  
1194  op :enumerator_generic_pname,
1195      args: {
1196          dst: VirtualRegister,
1197          enumerator: VirtualRegister,
1198          index: VirtualRegister,
1199      }
1200  
1201  op :to_index_string,
1202      args: {
1203          dst: VirtualRegister,
1204          index: VirtualRegister,
1205      }
1206  
1207  op :unreachable
1208  
1209  op :create_rest,
1210      args: {
1211          dst: VirtualRegister,
1212          arraySize: VirtualRegister,
1213          numParametersToSkip: unsigned,
1214      }
1215  
1216  op :get_rest_length,
1217      args: {
1218          dst: VirtualRegister,
1219          numParametersToSkip: unsigned,
1220      }
1221  
1222  # Semantically, this is iterator = symbolIterator.@call(iterable); next = iterator.next;
1223  # where symbolIterator the result of iterable[Symbol.iterator] (which is done in a different bytecode).
1224  # For builtin iterators, however, this has special behavior where next becomes the empty value, which
1225  # indicates that we are in a known iteration mode to op_iterator_next.
1226  op :iterator_open,
1227      args: {
1228          iterator: VirtualRegister,
1229          next: VirtualRegister,
1230          symbolIterator: VirtualRegister,
1231          iterable: VirtualRegister,
1232          stackOffset: unsigned,
1233      },
1234      metadata: {
1235          iterationMetadata: IterationModeMetadata,
1236          iterableProfile: ValueProfile,
1237          callLinkInfo: LLIntCallLinkInfo,
1238          iteratorProfile: ValueProfile,
1239          modeMetadata: GetByIdModeMetadata,
1240          nextProfile: ValueProfile,
1241      },
1242      checkpoints: {
1243          symbolCall: nil,
1244          getNext: nil,
1245      }
1246  
1247  # Semantically, this is nextResult = next.@call(iterator); done = nextResult.done; value = done ? undefined : nextResult.value;
1248  op :iterator_next,
1249      args: {
1250          done: VirtualRegister,
1251          value: VirtualRegister,
1252          iterable: VirtualRegister,
1253          next: VirtualRegister,
1254          iterator: VirtualRegister,
1255          stackOffset: unsigned,
1256      },
1257      metadata: {
1258          iterationMetadata: IterationModeMetadata,
1259          iterableProfile: ArrayProfile,
1260          callLinkInfo: LLIntCallLinkInfo,
1261          nextResultProfile: ValueProfile,
1262          doneModeMetadata: GetByIdModeMetadata,
1263          doneProfile: ValueProfile,
1264          valueModeMetadata: GetByIdModeMetadata,
1265          valueProfile: ValueProfile,
1266      },
1267      tmps: {
1268          nextResult: JSValue,
1269      },
1270      checkpoints: {
1271          computeNext: nil,
1272          getDone: nil,
1273          getValue: nil,
1274      }
1275  
1276  op :yield,
1277      args: {
1278          generator: VirtualRegister,
1279          yieldPoint: unsigned,
1280          argument: VirtualRegister,
1281      }
1282  
1283  op :check_traps
1284  
1285  op :log_shadow_chicken_prologue,
1286      args: {
1287          scope: VirtualRegister,
1288      }
1289  
1290  op :log_shadow_chicken_tail,
1291      args: {
1292          thisValue: VirtualRegister,
1293          scope: VirtualRegister,
1294      }
1295  
1296  op :resolve_scope_for_hoisting_func_decl_in_eval,
1297      args: {
1298          dst: VirtualRegister,
1299          scope: VirtualRegister,
1300          property: unsigned,
1301      }
1302  
1303  op :get_internal_field,
1304      args: {
1305          dst: VirtualRegister,
1306          base: VirtualRegister,
1307          index: unsigned,
1308      },
1309      metadata: {
1310          profile: ValueProfile,
1311      }
1312  
1313  op :put_internal_field,
1314      args: {
1315          base: VirtualRegister,
1316          index: unsigned,
1317          value: VirtualRegister,
1318      }
1319  
1320  op :nop
1321  
1322  op :super_sampler_begin
1323  
1324  op :super_sampler_end
1325  
1326  end_section :Bytecode
1327  
1328  begin_section :CLoopHelpers,
1329      emit_in_h_file: true,
1330      macro_name_component: :CLOOP_BYTECODE_HELPER
1331  
1332  op :llint_entry
1333  op :llint_return_to_host
1334  op :llint_vm_entry_to_javascript
1335  op :llint_vm_entry_to_native
1336  op :llint_cloop_did_return_from_js_1
1337  op :llint_cloop_did_return_from_js_2
1338  op :llint_cloop_did_return_from_js_3
1339  op :llint_cloop_did_return_from_js_4
1340  op :llint_cloop_did_return_from_js_5
1341  op :llint_cloop_did_return_from_js_6
1342  op :llint_cloop_did_return_from_js_7
1343  op :llint_cloop_did_return_from_js_8
1344  op :llint_cloop_did_return_from_js_9
1345  op :llint_cloop_did_return_from_js_10
1346  op :llint_cloop_did_return_from_js_11
1347  op :llint_cloop_did_return_from_js_12
1348  op :llint_cloop_did_return_from_js_13
1349  op :llint_cloop_did_return_from_js_14
1350  op :llint_cloop_did_return_from_js_15
1351  op :llint_cloop_did_return_from_js_16
1352  op :llint_cloop_did_return_from_js_17
1353  op :llint_cloop_did_return_from_js_18
1354  op :llint_cloop_did_return_from_js_19
1355  op :llint_cloop_did_return_from_js_20
1356  op :llint_cloop_did_return_from_js_21
1357  op :llint_cloop_did_return_from_js_22
1358  op :llint_cloop_did_return_from_js_23
1359  op :llint_cloop_did_return_from_js_24
1360  op :llint_cloop_did_return_from_js_25
1361  op :llint_cloop_did_return_from_js_26
1362  op :llint_cloop_did_return_from_js_27
1363  op :llint_cloop_did_return_from_js_28
1364  op :llint_cloop_did_return_from_js_29
1365  op :llint_cloop_did_return_from_js_30
1366  op :llint_cloop_did_return_from_js_31
1367  op :llint_cloop_did_return_from_js_32
1368  op :llint_cloop_did_return_from_js_33
1369  op :llint_cloop_did_return_from_js_34
1370  op :llint_cloop_did_return_from_js_35
1371  op :llint_cloop_did_return_from_js_36
1372  op :llint_cloop_did_return_from_js_37
1373  op :llint_cloop_did_return_from_js_38
1374  op :llint_cloop_did_return_from_js_39
1375  op :llint_cloop_did_return_from_js_40
1376  op :llint_cloop_did_return_from_js_41
1377  op :llint_cloop_did_return_from_js_42
1378  op :llint_cloop_did_return_from_js_43
1379  op :llint_cloop_did_return_from_js_44
1380  op :llint_cloop_did_return_from_js_45
1381  op :llint_cloop_did_return_from_js_46
1382  
1383  end_section :CLoopHelpers
1384  
1385  begin_section :NativeHelpers,
1386      emit_in_h_file: true,
1387      emit_in_asm_file: true,
1388      macro_name_component: :BYTECODE_HELPER
1389  
1390  op :llint_program_prologue
1391  op :llint_eval_prologue
1392  op :llint_module_program_prologue
1393  op :llint_function_for_call_prologue
1394  op :llint_function_for_construct_prologue
1395  op :llint_function_for_call_arity_check
1396  op :llint_function_for_construct_arity_check
1397  op :llint_generic_return_point
1398  op :llint_throw_from_slow_path_trampoline
1399  op :llint_throw_during_call_trampoline
1400  op :llint_native_call_trampoline
1401  op :llint_native_construct_trampoline
1402  op :llint_internal_function_call_trampoline
1403  op :llint_internal_function_construct_trampoline
1404  op :checkpoint_osr_exit_from_inlined_call_trampoline
1405  op :checkpoint_osr_exit_trampoline
1406  op :normal_osr_exit_trampoline
1407  op :fuzzer_return_early_from_loop_hint
1408  op :llint_get_host_call_return_value
1409  op :llint_handle_uncaught_exception
1410  op :op_call_return_location
1411  op :op_construct_return_location
1412  op :op_call_varargs_slow_return_location
1413  op :op_construct_varargs_slow_return_location
1414  op :op_get_by_id_return_location
1415  op :op_get_by_val_return_location
1416  op :op_put_by_id_return_location
1417  op :op_put_by_val_return_location
1418  op :op_iterator_open_return_location
1419  op :op_iterator_next_return_location
1420  op :wasm_function_prologue
1421  op :wasm_function_prologue_no_tls
1422  
1423  op :op_call_slow_return_location
1424  op :op_construct_slow_return_location
1425  op :op_iterator_open_slow_return_location
1426  op :op_iterator_next_slow_return_location
1427  op :op_tail_call_return_location
1428  op :op_tail_call_slow_return_location
1429  op :op_tail_call_forward_arguments_slow_return_location
1430  op :op_tail_call_varargs_slow_return_location
1431  op :op_call_eval_slow_return_location
1432  
1433  op :js_trampoline_op_call
1434  op :js_trampoline_op_tail_call
1435  op :js_trampoline_op_construct
1436  op :js_trampoline_op_iterator_next
1437  op :js_trampoline_op_iterator_open
1438  op :js_trampoline_op_call_slow
1439  op :js_trampoline_op_tail_call_slow
1440  op :js_trampoline_op_construct_slow
1441  op :js_trampoline_op_call_varargs_slow
1442  op :js_trampoline_op_tail_call_varargs_slow
1443  op :js_trampoline_op_tail_call_forward_arguments_slow
1444  op :js_trampoline_op_construct_varargs_slow
1445  op :js_trampoline_op_call_eval_slow
1446  op :js_trampoline_op_iterator_next_slow
1447  op :js_trampoline_op_iterator_open_slow
1448  op :js_trampoline_llint_function_for_call_arity_check_untag
1449  op :js_trampoline_llint_function_for_call_arity_check_tag
1450  op :js_trampoline_llint_function_for_construct_arity_check_untag
1451  op :js_trampoline_llint_function_for_construct_arity_check_tag
1452  op :wasm_trampoline_wasm_call
1453  op :wasm_trampoline_wasm_call_no_tls
1454  op :wasm_trampoline_wasm_call_indirect
1455  op :wasm_trampoline_wasm_call_indirect_no_tls
1456  
1457  end_section :NativeHelpers
1458  
1459  begin_section :Wasm,
1460      emit_in_h_file: true,
1461      emit_in_structs_file: true,
1462      macro_name_component: :WASM,
1463      op_prefix: "wasm_"
1464  
1465  autogenerate_wasm_opcodes
1466  
1467  # Helpers
1468  
1469  op :throw_from_slow_path_trampoline
1470  op :throw_from_fault_handler_trampoline
1471  
1472  op :call_return_location
1473  op :call_no_tls_return_location
1474  op :call_indirect_return_location
1475  op :call_indirect_no_tls_return_location
1476  
1477  # FIXME: Wasm and JS LLInt should share common opcodes
1478  # https://bugs.webkit.org/show_bug.cgi?id=203656
1479  
1480  op :wide16
1481  op :wide32
1482  
1483  op :enter
1484  op :nop
1485  op :loop_hint
1486  
1487  op :mov,
1488      args: {
1489          dst: VirtualRegister,
1490          src: VirtualRegister,
1491      }
1492  
1493  op_group :ConditionalJump,
1494      [
1495          :jtrue,
1496          :jfalse,
1497      ],
1498      args: {
1499          condition: VirtualRegister,
1500          targetLabel: WasmBoundLabel,
1501      }
1502  
1503  op :jmp,
1504      args: {
1505          targetLabel: WasmBoundLabel,
1506      }
1507  
1508  op :ret
1509  
1510  op :switch,
1511      args: {
1512          scrutinee: VirtualRegister,
1513          tableIndex: unsigned,
1514      }
1515  
1516  # Wasm specific bytecodes
1517  
1518  op :unreachable
1519  op :ret_void
1520  
1521  op :drop_keep,
1522      args: {
1523          startOffset: unsigned,
1524          dropCount: unsigned,
1525          keepCount: unsigned,
1526      }
1527  
1528  op :ref_is_null,
1529      args: {
1530          dst: VirtualRegister,
1531          ref: VirtualRegister,
1532      }
1533  
1534  op :ref_func,
1535      args: {
1536          dst: VirtualRegister,
1537          functionIndex: unsigned,
1538      }
1539  
1540  op :get_global,
1541      args: {
1542          dst: VirtualRegister,
1543          globalIndex: unsigned,
1544      }
1545  
1546  op :set_global,
1547      args: {
1548          globalIndex: unsigned,
1549          value: VirtualRegister,
1550      }
1551  
1552  op :set_global_ref,
1553      args: {
1554          globalIndex: unsigned,
1555          value: VirtualRegister,
1556      }
1557  
1558  op :get_global_portable_binding,
1559      args: {
1560          dst: VirtualRegister,
1561          globalIndex: unsigned,
1562      }
1563  
1564  op :set_global_portable_binding,
1565      args: {
1566          globalIndex: unsigned,
1567          value: VirtualRegister,
1568      }
1569  
1570  op :set_global_ref_portable_binding,
1571      args: {
1572          globalIndex: unsigned,
1573          value: VirtualRegister,
1574      }
1575  
1576  op :table_get,
1577      args: {
1578          dst: VirtualRegister,
1579          index: VirtualRegister,
1580          tableIndex: unsigned,
1581      }
1582  
1583  op :table_set,
1584      args: {
1585          index: VirtualRegister,
1586          value: VirtualRegister,
1587          tableIndex: unsigned,
1588      }
1589  
1590  op :table_init,
1591      args: {
1592          dstOffset: VirtualRegister,
1593          srcOffset: VirtualRegister,
1594          length: VirtualRegister,
1595          elementIndex: unsigned,
1596          tableIndex: unsigned,
1597      }
1598  
1599  op :elem_drop,
1600      args: {
1601          elementIndex: unsigned,
1602      }
1603  
1604  op :table_size,
1605      args: {
1606          dst: VirtualRegister,
1607          tableIndex: unsigned,
1608      }
1609  
1610  op :table_grow,
1611      args: {
1612          dst: VirtualRegister,
1613          fill: VirtualRegister,
1614          size: VirtualRegister,
1615          tableIndex: unsigned,
1616      }
1617  
1618  op :table_fill,
1619      args: {
1620          offset: VirtualRegister,
1621          fill: VirtualRegister,
1622          size: VirtualRegister,
1623          tableIndex: unsigned,
1624      }
1625  
1626  op :table_copy,
1627      args: {
1628          dstOffset: VirtualRegister,
1629          srcOffset: VirtualRegister,
1630          length: VirtualRegister,
1631          dstTableIndex: unsigned,
1632          srcTableIndex: unsigned,
1633      }
1634  
1635  op :call,
1636      args: {
1637          functionIndex: unsigned,
1638          stackOffset: unsigned,
1639          numberOfStackArgs: unsigned,
1640      }
1641  
1642  op :call_no_tls,
1643      args: {
1644          functionIndex: unsigned,
1645          stackOffset: unsigned,
1646          numberOfStackArgs: unsigned,
1647      }
1648  
1649  op :call_indirect,
1650      args: {
1651          functionIndex: VirtualRegister,
1652          signatureIndex: unsigned,
1653          stackOffset: unsigned,
1654          numberOfStackArgs: unsigned,
1655          tableIndex: unsigned,
1656      }
1657  
1658  op :call_indirect_no_tls,
1659      args: {
1660          functionIndex: VirtualRegister,
1661          signatureIndex: unsigned,
1662          stackOffset: unsigned,
1663          numberOfStackArgs: unsigned,
1664          tableIndex: unsigned,
1665      }
1666  
1667  op :current_memory,
1668      args: {
1669          dst: VirtualRegister,
1670      }
1671  
1672  op :grow_memory,
1673      args: {
1674          dst: VirtualRegister,
1675          delta: VirtualRegister
1676      }
1677  
1678  op :memory_fill,
1679      args: {
1680          dstAddress: VirtualRegister,
1681          targetValue: VirtualRegister,
1682          count: VirtualRegister,
1683      }
1684  
1685  op :memory_copy,
1686      args: {
1687          dstAddress: VirtualRegister,
1688          srcAddress: VirtualRegister,
1689          count: VirtualRegister,
1690      }
1691  
1692  op :memory_init,
1693      args: {
1694          dstAddress: VirtualRegister,
1695          srcAddress: VirtualRegister,
1696          length: VirtualRegister,
1697          dataSegmentIndex: unsigned,
1698      }
1699  
1700  op :data_drop,
1701      args: {
1702          dataSegmentIndex: unsigned,
1703      }
1704  
1705  op :select,
1706      args: {
1707          dst: VirtualRegister,
1708          condition: VirtualRegister,
1709          nonZero: VirtualRegister,
1710          zero: VirtualRegister,
1711      }
1712  
1713  op_group :Load,
1714      [
1715          :load8_u,
1716          :load16_u,
1717          :load32_u,
1718          :load64_u,
1719          :i32_load8_s,
1720          :i64_load8_s,
1721          :i32_load16_s,
1722          :i64_load16_s,
1723          :i64_load32_s,
1724      ],
1725      args: {
1726          dst: VirtualRegister,
1727          pointer: VirtualRegister,
1728          offset: unsigned,
1729      }
1730  
1731  op_group :Store,
1732      [
1733          :store8,
1734          :store16,
1735          :store32,
1736          :store64,
1737      ],
1738      args: {
1739          pointer: VirtualRegister,
1740          value: VirtualRegister,
1741          offset: unsigned,
1742      }
1743  
1744  op_group :AtomicBinaryRMW,
1745      [
1746          "add",
1747          "sub",
1748          "and",
1749          "or",
1750          "xor",
1751          "xchg",
1752      ].flat_map {|op|
1753          [
1754              "i64_atomic_rmw_#{op}",
1755              "i64_atomic_rmw8_#{op}_u",
1756              "i64_atomic_rmw16_#{op}_u",
1757              "i64_atomic_rmw32_#{op}_u",
1758          ]
1759      }.map {|op| op.to_sym },
1760      args: {
1761          dst: VirtualRegister,
1762          pointer: VirtualRegister,
1763          offset: unsigned,
1764          value: VirtualRegister,
1765      }
1766  
1767  op_group :AtomicCompareExchange,
1768      [
1769          :i64_atomic_rmw_cmpxchg,
1770          :i64_atomic_rmw8_cmpxchg_u,
1771          :i64_atomic_rmw16_cmpxchg_u,
1772          :i64_atomic_rmw32_cmpxchg_u,
1773      ],
1774      args: {
1775          dst: VirtualRegister,
1776          pointer: VirtualRegister,
1777          offset: unsigned,
1778          expected: VirtualRegister,
1779          value: VirtualRegister,
1780      }
1781  
1782  op_group :AtomicWait,
1783      [
1784          :memory_atomic_wait32,
1785          :memory_atomic_wait64,
1786      ],
1787      args: {
1788          dst: VirtualRegister,
1789          pointer: VirtualRegister,
1790          offset: unsigned,
1791          value: VirtualRegister,
1792          timeout: VirtualRegister,
1793      }
1794  
1795  op :memory_atomic_notify,
1796      args: {
1797          dst: VirtualRegister,
1798          pointer: VirtualRegister,
1799          offset: unsigned,
1800          count: VirtualRegister,
1801      }
1802  
1803  op :atomic_fence,
1804      args: {
1805      }
1806  
1807  end_section :Wasm