LCOV - code coverage report
Current view: top level - src/compiler - machine-operator.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 149 222 67.1 %
Date: 2019-03-21 Functions: 818 1931 42.4 %

          Line data    Source code
       1             : // Copyright 2014 the V8 project authors. All rights reserved.
       2             : // Use of this source code is governed by a BSD-style license that can be
       3             : // found in the LICENSE file.
       4             : 
       5             : #include "src/compiler/machine-operator.h"
       6             : 
       7             : #include "src/base/lazy-instance.h"
       8             : #include "src/compiler/opcodes.h"
       9             : #include "src/compiler/operator.h"
      10             : 
      11             : namespace v8 {
      12             : namespace internal {
      13             : namespace compiler {
      14             : 
      15         171 : bool operator==(StoreRepresentation lhs, StoreRepresentation rhs) {
      16         171 :   return lhs.representation() == rhs.representation() &&
      17         171 :          lhs.write_barrier_kind() == rhs.write_barrier_kind();
      18             : }
      19             : 
      20             : 
      21           0 : bool operator!=(StoreRepresentation lhs, StoreRepresentation rhs) {
      22           0 :   return !(lhs == rhs);
      23             : }
      24             : 
      25             : 
      26           0 : size_t hash_value(StoreRepresentation rep) {
      27           0 :   return base::hash_combine(rep.representation(), rep.write_barrier_kind());
      28             : }
      29             : 
      30             : 
      31          36 : std::ostream& operator<<(std::ostream& os, StoreRepresentation rep) {
      32         108 :   return os << "(" << rep.representation() << " : " << rep.write_barrier_kind()
      33          36 :             << ")";
      34             : }
      35             : 
      36             : 
      37    19369976 : LoadRepresentation LoadRepresentationOf(Operator const* op) {
      38             :   DCHECK(IrOpcode::kLoad == op->opcode() ||
      39             :          IrOpcode::kProtectedLoad == op->opcode() ||
      40             :          IrOpcode::kWord32AtomicLoad == op->opcode() ||
      41             :          IrOpcode::kWord64AtomicLoad == op->opcode() ||
      42             :          IrOpcode::kWord32AtomicPairLoad == op->opcode() ||
      43             :          IrOpcode::kPoisonedLoad == op->opcode() ||
      44             :          IrOpcode::kUnalignedLoad == op->opcode());
      45    19369976 :   return OpParameter<LoadRepresentation>(op);
      46             : }
      47             : 
      48             : 
      49     8548423 : StoreRepresentation const& StoreRepresentationOf(Operator const* op) {
      50             :   DCHECK(IrOpcode::kStore == op->opcode() ||
      51             :          IrOpcode::kProtectedStore == op->opcode());
      52     8548423 :   return OpParameter<StoreRepresentation>(op);
      53             : }
      54             : 
      55           1 : UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
      56             :     Operator const* op) {
      57             :   DCHECK_EQ(IrOpcode::kUnalignedStore, op->opcode());
      58           1 :   return OpParameter<UnalignedStoreRepresentation>(op);
      59             : }
      60             : 
      61           7 : bool operator==(StackSlotRepresentation lhs, StackSlotRepresentation rhs) {
      62           7 :   return lhs.size() == rhs.size() && lhs.alignment() == rhs.alignment();
      63             : }
      64             : 
      65           0 : bool operator!=(StackSlotRepresentation lhs, StackSlotRepresentation rhs) {
      66           0 :   return !(lhs == rhs);
      67             : }
      68             : 
      69           0 : size_t hash_value(StackSlotRepresentation rep) {
      70           0 :   return base::hash_combine(rep.size(), rep.alignment());
      71             : }
      72             : 
      73           0 : std::ostream& operator<<(std::ostream& os, StackSlotRepresentation rep) {
      74           0 :   return os << "(" << rep.size() << " : " << rep.alignment() << ")";
      75             : }
      76             : 
      77      366539 : StackSlotRepresentation const& StackSlotRepresentationOf(Operator const* op) {
      78             :   DCHECK_EQ(IrOpcode::kStackSlot, op->opcode());
      79      366539 :   return OpParameter<StackSlotRepresentation>(op);
      80             : }
      81             : 
      82        4093 : MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
      83             :   DCHECK(IrOpcode::kWord32AtomicStore == op->opcode() ||
      84             :          IrOpcode::kWord64AtomicStore == op->opcode());
      85        4093 :   return OpParameter<MachineRepresentation>(op);
      86             : }
      87             : 
      88       62351 : MachineType AtomicOpType(Operator const* op) {
      89       62351 :   return OpParameter<MachineType>(op);
      90             : }
      91             : 
      92             : #define PURE_BINARY_OP_LIST_32(V)                                           \
      93             :   V(Word32And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)    \
      94             :   V(Word32Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
      95             :   V(Word32Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)    \
      96             :   V(Word32Shl, Operator::kNoProperties, 2, 0, 1)                            \
      97             :   V(Word32Shr, Operator::kNoProperties, 2, 0, 1)                            \
      98             :   V(Word32Sar, Operator::kNoProperties, 2, 0, 1)                            \
      99             :   V(Word32Ror, Operator::kNoProperties, 2, 0, 1)                            \
     100             :   V(Word32Equal, Operator::kCommutative, 2, 0, 1)                           \
     101             :   V(Int32Add, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
     102             :   V(Int32Sub, Operator::kNoProperties, 2, 0, 1)                             \
     103             :   V(Int32Mul, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
     104             :   V(Int32MulHigh, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
     105             :   V(Int32Div, Operator::kNoProperties, 2, 1, 1)                             \
     106             :   V(Int32Mod, Operator::kNoProperties, 2, 1, 1)                             \
     107             :   V(Int32LessThan, Operator::kNoProperties, 2, 0, 1)                        \
     108             :   V(Int32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)                 \
     109             :   V(Uint32Div, Operator::kNoProperties, 2, 1, 1)                            \
     110             :   V(Uint32LessThan, Operator::kNoProperties, 2, 0, 1)                       \
     111             :   V(Uint32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)                \
     112             :   V(Uint32Mod, Operator::kNoProperties, 2, 1, 1)                            \
     113             :   V(Uint32MulHigh, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)
     114             : 
     115             : #define PURE_BINARY_OP_LIST_64(V)                                        \
     116             :   V(Word64And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
     117             :   V(Word64Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
     118             :   V(Word64Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
     119             :   V(Word64Shl, Operator::kNoProperties, 2, 0, 1)                         \
     120             :   V(Word64Shr, Operator::kNoProperties, 2, 0, 1)                         \
     121             :   V(Word64Sar, Operator::kNoProperties, 2, 0, 1)                         \
     122             :   V(Word64Ror, Operator::kNoProperties, 2, 0, 1)                         \
     123             :   V(Word64Equal, Operator::kCommutative, 2, 0, 1)                        \
     124             :   V(Int64Add, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
     125             :   V(Int64Sub, Operator::kNoProperties, 2, 0, 1)                          \
     126             :   V(Int64Mul, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
     127             :   V(Int64Div, Operator::kNoProperties, 2, 1, 1)                          \
     128             :   V(Int64Mod, Operator::kNoProperties, 2, 1, 1)                          \
     129             :   V(Int64LessThan, Operator::kNoProperties, 2, 0, 1)                     \
     130             :   V(Int64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)              \
     131             :   V(Uint64Div, Operator::kNoProperties, 2, 1, 1)                         \
     132             :   V(Uint64Mod, Operator::kNoProperties, 2, 1, 1)                         \
     133             :   V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1)                    \
     134             :   V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)
     135             : 
     136             : #define MACHINE_PURE_OP_LIST(V)                                               \
     137             :   PURE_BINARY_OP_LIST_32(V)                                                   \
     138             :   PURE_BINARY_OP_LIST_64(V)                                                   \
     139             :   V(Word32Clz, Operator::kNoProperties, 1, 0, 1)                              \
     140             :   V(Word64Clz, Operator::kNoProperties, 1, 0, 1)                              \
     141             :   V(Word32ReverseBytes, Operator::kNoProperties, 1, 0, 1)                     \
     142             :   V(Word64ReverseBytes, Operator::kNoProperties, 1, 0, 1)                     \
     143             :   V(BitcastWordToTaggedSigned, Operator::kNoProperties, 1, 0, 1)              \
     144             :   V(TruncateFloat64ToWord32, Operator::kNoProperties, 1, 0, 1)                \
     145             :   V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1)                 \
     146             :   V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1)                   \
     147             :   V(ChangeFloat64ToInt64, Operator::kNoProperties, 1, 0, 1)                   \
     148             :   V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1)                  \
     149             :   V(ChangeFloat64ToUint64, Operator::kNoProperties, 1, 0, 1)                  \
     150             :   V(TruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 1)                 \
     151             :   V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1)                \
     152             :   V(TruncateFloat32ToInt32, Operator::kNoProperties, 1, 0, 1)                 \
     153             :   V(TruncateFloat32ToUint32, Operator::kNoProperties, 1, 0, 1)                \
     154             :   V(TryTruncateFloat32ToInt64, Operator::kNoProperties, 1, 0, 2)              \
     155             :   V(TryTruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 2)              \
     156             :   V(TryTruncateFloat32ToUint64, Operator::kNoProperties, 1, 0, 2)             \
     157             :   V(TryTruncateFloat64ToUint64, Operator::kNoProperties, 1, 0, 2)             \
     158             :   V(ChangeInt32ToFloat64, Operator::kNoProperties, 1, 0, 1)                   \
     159             :   V(ChangeInt64ToFloat64, Operator::kNoProperties, 1, 0, 1)                   \
     160             :   V(Float64SilenceNaN, Operator::kNoProperties, 1, 0, 1)                      \
     161             :   V(RoundFloat64ToInt32, Operator::kNoProperties, 1, 0, 1)                    \
     162             :   V(RoundInt32ToFloat32, Operator::kNoProperties, 1, 0, 1)                    \
     163             :   V(RoundInt64ToFloat32, Operator::kNoProperties, 1, 0, 1)                    \
     164             :   V(RoundInt64ToFloat64, Operator::kNoProperties, 1, 0, 1)                    \
     165             :   V(RoundUint32ToFloat32, Operator::kNoProperties, 1, 0, 1)                   \
     166             :   V(RoundUint64ToFloat32, Operator::kNoProperties, 1, 0, 1)                   \
     167             :   V(RoundUint64ToFloat64, Operator::kNoProperties, 1, 0, 1)                   \
     168             :   V(ChangeInt32ToInt64, Operator::kNoProperties, 1, 0, 1)                     \
     169             :   V(ChangeUint32ToFloat64, Operator::kNoProperties, 1, 0, 1)                  \
     170             :   V(ChangeUint32ToUint64, Operator::kNoProperties, 1, 0, 1)                   \
     171             :   V(ChangeTaggedToCompressed, Operator::kNoProperties, 1, 0, 1)               \
     172             :   V(ChangeTaggedPointerToCompressedPointer, Operator::kNoProperties, 1, 0, 1) \
     173             :   V(ChangeTaggedSignedToCompressedSigned, Operator::kNoProperties, 1, 0, 1)   \
     174             :   V(ChangeCompressedToTagged, Operator::kNoProperties, 1, 0, 1)               \
     175             :   V(ChangeCompressedPointerToTaggedPointer, Operator::kNoProperties, 1, 0, 1) \
     176             :   V(ChangeCompressedSignedToTaggedSigned, Operator::kNoProperties, 1, 0, 1)   \
     177             :   V(TruncateFloat64ToFloat32, Operator::kNoProperties, 1, 0, 1)               \
     178             :   V(TruncateInt64ToInt32, Operator::kNoProperties, 1, 0, 1)                   \
     179             :   V(BitcastFloat32ToInt32, Operator::kNoProperties, 1, 0, 1)                  \
     180             :   V(BitcastFloat64ToInt64, Operator::kNoProperties, 1, 0, 1)                  \
     181             :   V(BitcastInt32ToFloat32, Operator::kNoProperties, 1, 0, 1)                  \
     182             :   V(BitcastInt64ToFloat64, Operator::kNoProperties, 1, 0, 1)                  \
     183             :   V(SignExtendWord8ToInt32, Operator::kNoProperties, 1, 0, 1)                 \
     184             :   V(SignExtendWord16ToInt32, Operator::kNoProperties, 1, 0, 1)                \
     185             :   V(SignExtendWord8ToInt64, Operator::kNoProperties, 1, 0, 1)                 \
     186             :   V(SignExtendWord16ToInt64, Operator::kNoProperties, 1, 0, 1)                \
     187             :   V(SignExtendWord32ToInt64, Operator::kNoProperties, 1, 0, 1)                \
     188             :   V(Float32Abs, Operator::kNoProperties, 1, 0, 1)                             \
     189             :   V(Float32Add, Operator::kCommutative, 2, 0, 1)                              \
     190             :   V(Float32Sub, Operator::kNoProperties, 2, 0, 1)                             \
     191             :   V(Float32Mul, Operator::kCommutative, 2, 0, 1)                              \
     192             :   V(Float32Div, Operator::kNoProperties, 2, 0, 1)                             \
     193             :   V(Float32Neg, Operator::kNoProperties, 1, 0, 1)                             \
     194             :   V(Float32Sqrt, Operator::kNoProperties, 1, 0, 1)                            \
     195             :   V(Float32Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
     196             :   V(Float32Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
     197             :   V(Float64Abs, Operator::kNoProperties, 1, 0, 1)                             \
     198             :   V(Float64Acos, Operator::kNoProperties, 1, 0, 1)                            \
     199             :   V(Float64Acosh, Operator::kNoProperties, 1, 0, 1)                           \
     200             :   V(Float64Asin, Operator::kNoProperties, 1, 0, 1)                            \
     201             :   V(Float64Asinh, Operator::kNoProperties, 1, 0, 1)                           \
     202             :   V(Float64Atan, Operator::kNoProperties, 1, 0, 1)                            \
     203             :   V(Float64Atan2, Operator::kNoProperties, 2, 0, 1)                           \
     204             :   V(Float64Atanh, Operator::kNoProperties, 1, 0, 1)                           \
     205             :   V(Float64Cbrt, Operator::kNoProperties, 1, 0, 1)                            \
     206             :   V(Float64Cos, Operator::kNoProperties, 1, 0, 1)                             \
     207             :   V(Float64Cosh, Operator::kNoProperties, 1, 0, 1)                            \
     208             :   V(Float64Exp, Operator::kNoProperties, 1, 0, 1)                             \
     209             :   V(Float64Expm1, Operator::kNoProperties, 1, 0, 1)                           \
     210             :   V(Float64Log, Operator::kNoProperties, 1, 0, 1)                             \
     211             :   V(Float64Log1p, Operator::kNoProperties, 1, 0, 1)                           \
     212             :   V(Float64Log2, Operator::kNoProperties, 1, 0, 1)                            \
     213             :   V(Float64Log10, Operator::kNoProperties, 1, 0, 1)                           \
     214             :   V(Float64Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
     215             :   V(Float64Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
     216             :   V(Float64Neg, Operator::kNoProperties, 1, 0, 1)                             \
     217             :   V(Float64Add, Operator::kCommutative, 2, 0, 1)                              \
     218             :   V(Float64Sub, Operator::kNoProperties, 2, 0, 1)                             \
     219             :   V(Float64Mul, Operator::kCommutative, 2, 0, 1)                              \
     220             :   V(Float64Div, Operator::kNoProperties, 2, 0, 1)                             \
     221             :   V(Float64Mod, Operator::kNoProperties, 2, 0, 1)                             \
     222             :   V(Float64Pow, Operator::kNoProperties, 2, 0, 1)                             \
     223             :   V(Float64Sin, Operator::kNoProperties, 1, 0, 1)                             \
     224             :   V(Float64Sinh, Operator::kNoProperties, 1, 0, 1)                            \
     225             :   V(Float64Sqrt, Operator::kNoProperties, 1, 0, 1)                            \
     226             :   V(Float64Tan, Operator::kNoProperties, 1, 0, 1)                             \
     227             :   V(Float64Tanh, Operator::kNoProperties, 1, 0, 1)                            \
     228             :   V(Float32Equal, Operator::kCommutative, 2, 0, 1)                            \
     229             :   V(Float32LessThan, Operator::kNoProperties, 2, 0, 1)                        \
     230             :   V(Float32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)                 \
     231             :   V(Float64Equal, Operator::kCommutative, 2, 0, 1)                            \
     232             :   V(Float64LessThan, Operator::kNoProperties, 2, 0, 1)                        \
     233             :   V(Float64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)                 \
     234             :   V(Float64ExtractLowWord32, Operator::kNoProperties, 1, 0, 1)                \
     235             :   V(Float64ExtractHighWord32, Operator::kNoProperties, 1, 0, 1)               \
     236             :   V(Float64InsertLowWord32, Operator::kNoProperties, 2, 0, 1)                 \
     237             :   V(Float64InsertHighWord32, Operator::kNoProperties, 2, 0, 1)                \
     238             :   V(LoadStackPointer, Operator::kNoProperties, 0, 0, 1)                       \
     239             :   V(LoadFramePointer, Operator::kNoProperties, 0, 0, 1)                       \
     240             :   V(LoadParentFramePointer, Operator::kNoProperties, 0, 0, 1)                 \
     241             :   V(Int32PairAdd, Operator::kNoProperties, 4, 0, 2)                           \
     242             :   V(Int32PairSub, Operator::kNoProperties, 4, 0, 2)                           \
     243             :   V(Int32PairMul, Operator::kNoProperties, 4, 0, 2)                           \
     244             :   V(Word32PairShl, Operator::kNoProperties, 3, 0, 2)                          \
     245             :   V(Word32PairShr, Operator::kNoProperties, 3, 0, 2)                          \
     246             :   V(Word32PairSar, Operator::kNoProperties, 3, 0, 2)                          \
     247             :   V(F32x4Splat, Operator::kNoProperties, 1, 0, 1)                             \
     248             :   V(F32x4SConvertI32x4, Operator::kNoProperties, 1, 0, 1)                     \
     249             :   V(F32x4UConvertI32x4, Operator::kNoProperties, 1, 0, 1)                     \
     250             :   V(F32x4Abs, Operator::kNoProperties, 1, 0, 1)                               \
     251             :   V(F32x4Neg, Operator::kNoProperties, 1, 0, 1)                               \
     252             :   V(F32x4RecipApprox, Operator::kNoProperties, 1, 0, 1)                       \
     253             :   V(F32x4RecipSqrtApprox, Operator::kNoProperties, 1, 0, 1)                   \
     254             :   V(F32x4Add, Operator::kCommutative, 2, 0, 1)                                \
     255             :   V(F32x4AddHoriz, Operator::kNoProperties, 2, 0, 1)                          \
     256             :   V(F32x4Sub, Operator::kNoProperties, 2, 0, 1)                               \
     257             :   V(F32x4Mul, Operator::kCommutative, 2, 0, 1)                                \
     258             :   V(F32x4Min, Operator::kCommutative, 2, 0, 1)                                \
     259             :   V(F32x4Max, Operator::kCommutative, 2, 0, 1)                                \
     260             :   V(F32x4Eq, Operator::kCommutative, 2, 0, 1)                                 \
     261             :   V(F32x4Ne, Operator::kCommutative, 2, 0, 1)                                 \
     262             :   V(F32x4Lt, Operator::kNoProperties, 2, 0, 1)                                \
     263             :   V(F32x4Le, Operator::kNoProperties, 2, 0, 1)                                \
     264             :   V(I32x4Splat, Operator::kNoProperties, 1, 0, 1)                             \
     265             :   V(I32x4SConvertF32x4, Operator::kNoProperties, 1, 0, 1)                     \
     266             :   V(I32x4SConvertI16x8Low, Operator::kNoProperties, 1, 0, 1)                  \
     267             :   V(I32x4SConvertI16x8High, Operator::kNoProperties, 1, 0, 1)                 \
     268             :   V(I32x4Neg, Operator::kNoProperties, 1, 0, 1)                               \
     269             :   V(I32x4Add, Operator::kCommutative, 2, 0, 1)                                \
     270             :   V(I32x4AddHoriz, Operator::kNoProperties, 2, 0, 1)                          \
     271             :   V(I32x4Sub, Operator::kNoProperties, 2, 0, 1)                               \
     272             :   V(I32x4Mul, Operator::kCommutative, 2, 0, 1)                                \
     273             :   V(I32x4MinS, Operator::kCommutative, 2, 0, 1)                               \
     274             :   V(I32x4MaxS, Operator::kCommutative, 2, 0, 1)                               \
     275             :   V(I32x4Eq, Operator::kCommutative, 2, 0, 1)                                 \
     276             :   V(I32x4Ne, Operator::kCommutative, 2, 0, 1)                                 \
     277             :   V(I32x4GtS, Operator::kNoProperties, 2, 0, 1)                               \
     278             :   V(I32x4GeS, Operator::kNoProperties, 2, 0, 1)                               \
     279             :   V(I32x4UConvertF32x4, Operator::kNoProperties, 1, 0, 1)                     \
     280             :   V(I32x4UConvertI16x8Low, Operator::kNoProperties, 1, 0, 1)                  \
     281             :   V(I32x4UConvertI16x8High, Operator::kNoProperties, 1, 0, 1)                 \
     282             :   V(I32x4MinU, Operator::kCommutative, 2, 0, 1)                               \
     283             :   V(I32x4MaxU, Operator::kCommutative, 2, 0, 1)                               \
     284             :   V(I32x4GtU, Operator::kNoProperties, 2, 0, 1)                               \
     285             :   V(I32x4GeU, Operator::kNoProperties, 2, 0, 1)                               \
     286             :   V(I16x8Splat, Operator::kNoProperties, 1, 0, 1)                             \
     287             :   V(I16x8SConvertI8x16Low, Operator::kNoProperties, 1, 0, 1)                  \
     288             :   V(I16x8SConvertI8x16High, Operator::kNoProperties, 1, 0, 1)                 \
     289             :   V(I16x8Neg, Operator::kNoProperties, 1, 0, 1)                               \
     290             :   V(I16x8SConvertI32x4, Operator::kNoProperties, 2, 0, 1)                     \
     291             :   V(I16x8Add, Operator::kCommutative, 2, 0, 1)                                \
     292             :   V(I16x8AddSaturateS, Operator::kCommutative, 2, 0, 1)                       \
     293             :   V(I16x8AddHoriz, Operator::kNoProperties, 2, 0, 1)                          \
     294             :   V(I16x8Sub, Operator::kNoProperties, 2, 0, 1)                               \
     295             :   V(I16x8SubSaturateS, Operator::kNoProperties, 2, 0, 1)                      \
     296             :   V(I16x8Mul, Operator::kCommutative, 2, 0, 1)                                \
     297             :   V(I16x8MinS, Operator::kCommutative, 2, 0, 1)                               \
     298             :   V(I16x8MaxS, Operator::kCommutative, 2, 0, 1)                               \
     299             :   V(I16x8Eq, Operator::kCommutative, 2, 0, 1)                                 \
     300             :   V(I16x8Ne, Operator::kCommutative, 2, 0, 1)                                 \
     301             :   V(I16x8GtS, Operator::kNoProperties, 2, 0, 1)                               \
     302             :   V(I16x8GeS, Operator::kNoProperties, 2, 0, 1)                               \
     303             :   V(I16x8UConvertI8x16Low, Operator::kNoProperties, 1, 0, 1)                  \
     304             :   V(I16x8UConvertI8x16High, Operator::kNoProperties, 1, 0, 1)                 \
     305             :   V(I16x8UConvertI32x4, Operator::kNoProperties, 2, 0, 1)                     \
     306             :   V(I16x8AddSaturateU, Operator::kCommutative, 2, 0, 1)                       \
     307             :   V(I16x8SubSaturateU, Operator::kNoProperties, 2, 0, 1)                      \
     308             :   V(I16x8MinU, Operator::kCommutative, 2, 0, 1)                               \
     309             :   V(I16x8MaxU, Operator::kCommutative, 2, 0, 1)                               \
     310             :   V(I16x8GtU, Operator::kNoProperties, 2, 0, 1)                               \
     311             :   V(I16x8GeU, Operator::kNoProperties, 2, 0, 1)                               \
     312             :   V(I8x16Splat, Operator::kNoProperties, 1, 0, 1)                             \
     313             :   V(I8x16Neg, Operator::kNoProperties, 1, 0, 1)                               \
     314             :   V(I8x16SConvertI16x8, Operator::kNoProperties, 2, 0, 1)                     \
     315             :   V(I8x16Add, Operator::kCommutative, 2, 0, 1)                                \
     316             :   V(I8x16AddSaturateS, Operator::kCommutative, 2, 0, 1)                       \
     317             :   V(I8x16Sub, Operator::kNoProperties, 2, 0, 1)                               \
     318             :   V(I8x16SubSaturateS, Operator::kNoProperties, 2, 0, 1)                      \
     319             :   V(I8x16Mul, Operator::kCommutative, 2, 0, 1)                                \
     320             :   V(I8x16MinS, Operator::kCommutative, 2, 0, 1)                               \
     321             :   V(I8x16MaxS, Operator::kCommutative, 2, 0, 1)                               \
     322             :   V(I8x16Eq, Operator::kCommutative, 2, 0, 1)                                 \
     323             :   V(I8x16Ne, Operator::kCommutative, 2, 0, 1)                                 \
     324             :   V(I8x16GtS, Operator::kNoProperties, 2, 0, 1)                               \
     325             :   V(I8x16GeS, Operator::kNoProperties, 2, 0, 1)                               \
     326             :   V(I8x16UConvertI16x8, Operator::kNoProperties, 2, 0, 1)                     \
     327             :   V(I8x16AddSaturateU, Operator::kCommutative, 2, 0, 1)                       \
     328             :   V(I8x16SubSaturateU, Operator::kNoProperties, 2, 0, 1)                      \
     329             :   V(I8x16MinU, Operator::kCommutative, 2, 0, 1)                               \
     330             :   V(I8x16MaxU, Operator::kCommutative, 2, 0, 1)                               \
     331             :   V(I8x16GtU, Operator::kNoProperties, 2, 0, 1)                               \
     332             :   V(I8x16GeU, Operator::kNoProperties, 2, 0, 1)                               \
     333             :   V(S128Load, Operator::kNoProperties, 2, 0, 1)                               \
     334             :   V(S128Store, Operator::kNoProperties, 3, 0, 1)                              \
     335             :   V(S128Zero, Operator::kNoProperties, 0, 0, 1)                               \
     336             :   V(S128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)        \
     337             :   V(S128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)         \
     338             :   V(S128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)        \
     339             :   V(S128Not, Operator::kNoProperties, 1, 0, 1)                                \
     340             :   V(S128Select, Operator::kNoProperties, 3, 0, 1)                             \
     341             :   V(S1x4AnyTrue, Operator::kNoProperties, 1, 0, 1)                            \
     342             :   V(S1x4AllTrue, Operator::kNoProperties, 1, 0, 1)                            \
     343             :   V(S1x8AnyTrue, Operator::kNoProperties, 1, 0, 1)                            \
     344             :   V(S1x8AllTrue, Operator::kNoProperties, 1, 0, 1)                            \
     345             :   V(S1x16AnyTrue, Operator::kNoProperties, 1, 0, 1)                           \
     346             :   V(S1x16AllTrue, Operator::kNoProperties, 1, 0, 1)
     347             : 
     348             : #define PURE_OPTIONAL_OP_LIST(V)                            \
     349             :   V(Word32Ctz, Operator::kNoProperties, 1, 0, 1)            \
     350             :   V(Word64Ctz, Operator::kNoProperties, 1, 0, 1)            \
     351             :   V(Word32ReverseBits, Operator::kNoProperties, 1, 0, 1)    \
     352             :   V(Word64ReverseBits, Operator::kNoProperties, 1, 0, 1)    \
     353             :   V(Int32AbsWithOverflow, Operator::kNoProperties, 1, 0, 2) \
     354             :   V(Int64AbsWithOverflow, Operator::kNoProperties, 1, 0, 2) \
     355             :   V(Word32Popcnt, Operator::kNoProperties, 1, 0, 1)         \
     356             :   V(Word64Popcnt, Operator::kNoProperties, 1, 0, 1)         \
     357             :   V(Float32RoundDown, Operator::kNoProperties, 1, 0, 1)     \
     358             :   V(Float64RoundDown, Operator::kNoProperties, 1, 0, 1)     \
     359             :   V(Float32RoundUp, Operator::kNoProperties, 1, 0, 1)       \
     360             :   V(Float64RoundUp, Operator::kNoProperties, 1, 0, 1)       \
     361             :   V(Float32RoundTruncate, Operator::kNoProperties, 1, 0, 1) \
     362             :   V(Float64RoundTruncate, Operator::kNoProperties, 1, 0, 1) \
     363             :   V(Float64RoundTiesAway, Operator::kNoProperties, 1, 0, 1) \
     364             :   V(Float32RoundTiesEven, Operator::kNoProperties, 1, 0, 1) \
     365             :   V(Float64RoundTiesEven, Operator::kNoProperties, 1, 0, 1)
     366             : 
     367             : #define OVERFLOW_OP_LIST(V)                                                \
     368             :   V(Int32AddWithOverflow, Operator::kAssociative | Operator::kCommutative) \
     369             :   V(Int32SubWithOverflow, Operator::kNoProperties)                         \
     370             :   V(Int32MulWithOverflow, Operator::kAssociative | Operator::kCommutative) \
     371             :   V(Int64AddWithOverflow, Operator::kAssociative | Operator::kCommutative) \
     372             :   V(Int64SubWithOverflow, Operator::kNoProperties)
     373             : 
     374             : #define MACHINE_TYPE_LIST(V) \
     375             :   V(Float32)                 \
     376             :   V(Float64)                 \
     377             :   V(Simd128)                 \
     378             :   V(Int8)                    \
     379             :   V(Uint8)                   \
     380             :   V(Int16)                   \
     381             :   V(Uint16)                  \
     382             :   V(Int32)                   \
     383             :   V(Uint32)                  \
     384             :   V(Int64)                   \
     385             :   V(Uint64)                  \
     386             :   V(Pointer)                 \
     387             :   V(TaggedSigned)            \
     388             :   V(TaggedPointer)           \
     389             :   V(AnyTagged)               \
     390             :   V(CompressedSigned)        \
     391             :   V(CompressedPointer)       \
     392             :   V(AnyCompressed)
     393             : 
     394             : #define MACHINE_REPRESENTATION_LIST(V) \
     395             :   V(kFloat32)                          \
     396             :   V(kFloat64)                          \
     397             :   V(kSimd128)                          \
     398             :   V(kWord8)                            \
     399             :   V(kWord16)                           \
     400             :   V(kWord32)                           \
     401             :   V(kWord64)                           \
     402             :   V(kTaggedSigned)                     \
     403             :   V(kTaggedPointer)                    \
     404             :   V(kTagged)                           \
     405             :   V(kCompressedSigned)                 \
     406             :   V(kCompressedPointer)                \
     407             :   V(kCompressed)
     408             : 
     409             : #define ATOMIC_U32_TYPE_LIST(V) \
     410             :   V(Uint8)                      \
     411             :   V(Uint16)                     \
     412             :   V(Uint32)
     413             : 
     414             : #define ATOMIC_TYPE_LIST(V) \
     415             :   ATOMIC_U32_TYPE_LIST(V)   \
     416             :   V(Int8)                   \
     417             :   V(Int16)                  \
     418             :   V(Int32)
     419             : 
     420             : #define ATOMIC_U64_TYPE_LIST(V) \
     421             :   ATOMIC_U32_TYPE_LIST(V)       \
     422             :   V(Uint64)
     423             : 
     424             : #define ATOMIC_REPRESENTATION_LIST(V) \
     425             :   V(kWord8)                           \
     426             :   V(kWord16)                          \
     427             :   V(kWord32)
     428             : 
     429             : #define ATOMIC64_REPRESENTATION_LIST(V) \
     430             :   ATOMIC_REPRESENTATION_LIST(V)         \
     431             :   V(kWord64)
     432             : 
     433             : #define ATOMIC_PAIR_BINOP_LIST(V) \
     434             :   V(Add)                          \
     435             :   V(Sub)                          \
     436             :   V(And)                          \
     437             :   V(Or)                           \
     438             :   V(Xor)                          \
     439             :   V(Exchange)
     440             : 
     441             : #define SIMD_LANE_OP_LIST(V) \
     442             :   V(F32x4, 4)                \
     443             :   V(I32x4, 4)                \
     444             :   V(I16x8, 8)                \
     445             :   V(I8x16, 16)
     446             : 
     447             : #define SIMD_FORMAT_LIST(V) \
     448             :   V(32x4, 32)               \
     449             :   V(16x8, 16)               \
     450             :   V(8x16, 8)
     451             : 
     452             : #define STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(V) \
     453             :   V(4, 0) V(8, 0) V(16, 0) V(4, 4) V(8, 8) V(16, 16)
     454             : 
     455           0 : struct StackSlotOperator : public Operator1<StackSlotRepresentation> {
     456      536691 :   explicit StackSlotOperator(int size, int alignment)
     457             :       : Operator1<StackSlotRepresentation>(
     458             :             IrOpcode::kStackSlot, Operator::kNoDeopt | Operator::kNoThrow,
     459             :             "StackSlot", 0, 0, 0, 1, 0, 0,
     460      536691 :             StackSlotRepresentation(size, alignment)) {}
     461             : };
     462             : 
     463      402066 : struct MachineOperatorGlobalCache {
     464             : #define PURE(Name, properties, value_input_count, control_input_count,         \
     465             :              output_count)                                                     \
     466             :   struct Name##Operator final : public Operator {                              \
     467             :     Name##Operator()                                                           \
     468             :         : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name,     \
     469             :                    value_input_count, 0, control_input_count, output_count, 0, \
     470             :                    0) {}                                                       \
     471             :   };                                                                           \
     472             :   Name##Operator k##Name;
     473     7122312 :   MACHINE_PURE_OP_LIST(PURE)
     474      488223 :   PURE_OPTIONAL_OP_LIST(PURE)
     475             : #undef PURE
     476             : 
     477             : #define OVERFLOW_OP(Name, properties)                                        \
     478             :   struct Name##Operator final : public Operator {                            \
     479             :     Name##Operator()                                                         \
     480             :         : Operator(IrOpcode::k##Name,                                        \
     481             :                    Operator::kEliminatable | Operator::kNoRead | properties, \
     482             :                    #Name, 2, 0, 1, 2, 0, 0) {}                               \
     483             :   };                                                                         \
     484             :   Name##Operator k##Name;
     485      143595 :   OVERFLOW_OP_LIST(OVERFLOW_OP)
     486             : #undef OVERFLOW_OP
     487             : 
     488             : #define LOAD(Type)                                                            \
     489             :   struct Load##Type##Operator final : public Operator1<LoadRepresentation> {  \
     490             :     Load##Type##Operator()                                                    \
     491             :         : Operator1<LoadRepresentation>(                                      \
     492             :               IrOpcode::kLoad,                                                \
     493             :               Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite,   \
     494             :               "Load", 2, 1, 1, 1, 1, 0, MachineType::Type()) {}               \
     495             :   };                                                                          \
     496             :   struct PoisonedLoad##Type##Operator final                                   \
     497             :       : public Operator1<LoadRepresentation> {                                \
     498             :     PoisonedLoad##Type##Operator()                                            \
     499             :         : Operator1<LoadRepresentation>(                                      \
     500             :               IrOpcode::kPoisonedLoad,                                        \
     501             :               Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite,   \
     502             :               "PoisonedLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {}       \
     503             :   };                                                                          \
     504             :   struct UnalignedLoad##Type##Operator final                                  \
     505             :       : public Operator1<LoadRepresentation> {                                \
     506             :     UnalignedLoad##Type##Operator()                                           \
     507             :         : Operator1<LoadRepresentation>(                                      \
     508             :               IrOpcode::kUnalignedLoad,                                       \
     509             :               Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite,   \
     510             :               "UnalignedLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {}      \
     511             :   };                                                                          \
     512             :   struct ProtectedLoad##Type##Operator final                                  \
     513             :       : public Operator1<LoadRepresentation> {                                \
     514             :     ProtectedLoad##Type##Operator()                                           \
     515             :         : Operator1<LoadRepresentation>(                                      \
     516             :               IrOpcode::kProtectedLoad,                                       \
     517             :               Operator::kNoDeopt | Operator::kNoThrow, "ProtectedLoad", 2, 1, \
     518             :               1, 1, 1, 0, MachineType::Type()) {}                             \
     519             :   };                                                                          \
     520             :   Load##Type##Operator kLoad##Type;                                           \
     521             :   PoisonedLoad##Type##Operator kPoisonedLoad##Type;                           \
     522             :   UnalignedLoad##Type##Operator kUnalignedLoad##Type;                         \
     523             :   ProtectedLoad##Type##Operator kProtectedLoad##Type;
     524     4135536 :   MACHINE_TYPE_LIST(LOAD)
     525             : #undef LOAD
     526             : 
     527             : #define STACKSLOT(Size, Alignment)                                     \
     528             :   struct StackSlotOfSize##Size##OfAlignment##Alignment##Operator final \
     529             :       : public StackSlotOperator {                                     \
     530             :     StackSlotOfSize##Size##OfAlignment##Alignment##Operator()          \
     531             :         : StackSlotOperator(Size, Alignment) {}                        \
     532             :   };                                                                   \
     533             :   StackSlotOfSize##Size##OfAlignment##Alignment##Operator              \
     534             :       kStackSlotOfSize##Size##OfAlignment##Alignment;
     535       28719 :   STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(STACKSLOT)
     536             : #undef STACKSLOT
     537             : 
     538             : #define STORE(Type)                                                            \
     539             :   struct Store##Type##Operator : public Operator1<StoreRepresentation> {       \
     540             :     explicit Store##Type##Operator(WriteBarrierKind write_barrier_kind)        \
     541             :         : Operator1<StoreRepresentation>(                                      \
     542             :               IrOpcode::kStore,                                                \
     543             :               Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,     \
     544             :               "Store", 3, 1, 1, 0, 1, 0,                                       \
     545             :               StoreRepresentation(MachineRepresentation::Type,                 \
     546             :                                   write_barrier_kind)) {}                      \
     547             :   };                                                                           \
     548             :   struct Store##Type##NoWriteBarrier##Operator final                           \
     549             :       : public Store##Type##Operator {                                         \
     550             :     Store##Type##NoWriteBarrier##Operator()                                    \
     551             :         : Store##Type##Operator(kNoWriteBarrier) {}                            \
     552             :   };                                                                           \
     553             :   struct Store##Type##MapWriteBarrier##Operator final                          \
     554             :       : public Store##Type##Operator {                                         \
     555             :     Store##Type##MapWriteBarrier##Operator()                                   \
     556             :         : Store##Type##Operator(kMapWriteBarrier) {}                           \
     557             :   };                                                                           \
     558             :   struct Store##Type##PointerWriteBarrier##Operator final                      \
     559             :       : public Store##Type##Operator {                                         \
     560             :     Store##Type##PointerWriteBarrier##Operator()                               \
     561             :         : Store##Type##Operator(kPointerWriteBarrier) {}                       \
     562             :   };                                                                           \
     563             :   struct Store##Type##FullWriteBarrier##Operator final                         \
     564             :       : public Store##Type##Operator {                                         \
     565             :     Store##Type##FullWriteBarrier##Operator()                                  \
     566             :         : Store##Type##Operator(kFullWriteBarrier) {}                          \
     567             :   };                                                                           \
     568             :   struct UnalignedStore##Type##Operator final                                  \
     569             :       : public Operator1<UnalignedStoreRepresentation> {                       \
     570             :     UnalignedStore##Type##Operator()                                           \
     571             :         : Operator1<UnalignedStoreRepresentation>(                             \
     572             :               IrOpcode::kUnalignedStore,                                       \
     573             :               Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,     \
     574             :               "UnalignedStore", 3, 1, 1, 0, 1, 0,                              \
     575             :               MachineRepresentation::Type) {}                                  \
     576             :   };                                                                           \
     577             :   struct ProtectedStore##Type##Operator                                        \
     578             :       : public Operator1<StoreRepresentation> {                                \
     579             :     explicit ProtectedStore##Type##Operator()                                  \
     580             :         : Operator1<StoreRepresentation>(                                      \
     581             :               IrOpcode::kProtectedStore,                                       \
     582             :               Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,     \
     583             :               "Store", 3, 1, 1, 0, 1, 0,                                       \
     584             :               StoreRepresentation(MachineRepresentation::Type,                 \
     585             :                                   kNoWriteBarrier)) {}                         \
     586             :   };                                                                           \
     587             :   Store##Type##NoWriteBarrier##Operator kStore##Type##NoWriteBarrier;          \
     588             :   Store##Type##MapWriteBarrier##Operator kStore##Type##MapWriteBarrier;        \
     589             :   Store##Type##PointerWriteBarrier##Operator                                   \
     590             :       kStore##Type##PointerWriteBarrier;                                       \
     591             :   Store##Type##FullWriteBarrier##Operator kStore##Type##FullWriteBarrier;      \
     592             :   UnalignedStore##Type##Operator kUnalignedStore##Type;                        \
     593             :   ProtectedStore##Type##Operator kProtectedStore##Type;
     594     4853511 :   MACHINE_REPRESENTATION_LIST(STORE)
     595             : #undef STORE
     596             : 
     597             : #define ATOMIC_LOAD(Type)                                                   \
     598             :   struct Word32AtomicLoad##Type##Operator final                             \
     599             :       : public Operator1<LoadRepresentation> {                              \
     600             :     Word32AtomicLoad##Type##Operator()                                      \
     601             :         : Operator1<LoadRepresentation>(                                    \
     602             :               IrOpcode::kWord32AtomicLoad,                                  \
     603             :               Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \
     604             :               "Word32AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \
     605             :   };                                                                        \
     606             :   Word32AtomicLoad##Type##Operator kWord32AtomicLoad##Type;
     607      344628 :   ATOMIC_TYPE_LIST(ATOMIC_LOAD)
     608             : #undef ATOMIC_LOAD
     609             : 
     610             : #define ATOMIC_LOAD(Type)                                                   \
     611             :   struct Word64AtomicLoad##Type##Operator final                             \
     612             :       : public Operator1<LoadRepresentation> {                              \
     613             :     Word64AtomicLoad##Type##Operator()                                      \
     614             :         : Operator1<LoadRepresentation>(                                    \
     615             :               IrOpcode::kWord64AtomicLoad,                                  \
     616             :               Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \
     617             :               "Word64AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \
     618             :   };                                                                        \
     619             :   Word64AtomicLoad##Type##Operator kWord64AtomicLoad##Type;
     620      229752 :   ATOMIC_U64_TYPE_LIST(ATOMIC_LOAD)
     621             : #undef ATOMIC_LOAD
     622             : 
     623             : #define ATOMIC_STORE(Type)                                                 \
     624             :   struct Word32AtomicStore##Type##Operator                                 \
     625             :       : public Operator1<MachineRepresentation> {                          \
     626             :     Word32AtomicStore##Type##Operator()                                    \
     627             :         : Operator1<MachineRepresentation>(                                \
     628             :               IrOpcode::kWord32AtomicStore,                                \
     629             :               Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow, \
     630             :               "Word32AtomicStore", 3, 1, 1, 0, 1, 0,                       \
     631             :               MachineRepresentation::Type) {}                              \
     632             :   };                                                                       \
     633             :   Word32AtomicStore##Type##Operator kWord32AtomicStore##Type;
     634      172314 :   ATOMIC_REPRESENTATION_LIST(ATOMIC_STORE)
     635             : #undef ATOMIC_STORE
     636             : 
     637             : #define ATOMIC_STORE(Type)                                                 \
     638             :   struct Word64AtomicStore##Type##Operator                                 \
     639             :       : public Operator1<MachineRepresentation> {                          \
     640             :     Word64AtomicStore##Type##Operator()                                    \
     641             :         : Operator1<MachineRepresentation>(                                \
     642             :               IrOpcode::kWord64AtomicStore,                                \
     643             :               Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow, \
     644             :               "Word64AtomicStore", 3, 1, 1, 0, 1, 0,                       \
     645             :               MachineRepresentation::Type) {}                              \
     646             :   };                                                                       \
     647             :   Word64AtomicStore##Type##Operator kWord64AtomicStore##Type;
     648      229752 :   ATOMIC64_REPRESENTATION_LIST(ATOMIC_STORE)
     649             : #undef ATOMIC_STORE
     650             : 
     651             : #define ATOMIC_OP(op, type)                                                    \
     652             :   struct op##type##Operator : public Operator1<MachineType> {                  \
     653             :     op##type##Operator()                                                       \
     654             :         : Operator1<MachineType>(IrOpcode::k##op,                              \
     655             :                                  Operator::kNoDeopt | Operator::kNoThrow, #op, \
     656             :                                  3, 1, 1, 1, 1, 0, MachineType::type()) {}     \
     657             :   };                                                                           \
     658             :   op##type##Operator k##op##type;
     659             : #define ATOMIC_OP_LIST(type)       \
     660             :   ATOMIC_OP(Word32AtomicAdd, type) \
     661             :   ATOMIC_OP(Word32AtomicSub, type) \
     662             :   ATOMIC_OP(Word32AtomicAnd, type) \
     663             :   ATOMIC_OP(Word32AtomicOr, type)  \
     664             :   ATOMIC_OP(Word32AtomicXor, type) \
     665             :   ATOMIC_OP(Word32AtomicExchange, type)
     666     2067768 :   ATOMIC_TYPE_LIST(ATOMIC_OP_LIST)
     667             : #undef ATOMIC_OP_LIST
     668             : #define ATOMIC64_OP_LIST(type)     \
     669             :   ATOMIC_OP(Word64AtomicAdd, type) \
     670             :   ATOMIC_OP(Word64AtomicSub, type) \
     671             :   ATOMIC_OP(Word64AtomicAnd, type) \
     672             :   ATOMIC_OP(Word64AtomicOr, type)  \
     673             :   ATOMIC_OP(Word64AtomicXor, type) \
     674             :   ATOMIC_OP(Word64AtomicExchange, type)
     675     1378512 :   ATOMIC_U64_TYPE_LIST(ATOMIC64_OP_LIST)
     676             : #undef ATOMIC64_OP_LIST
     677             : #undef ATOMIC_OP
     678             : 
     679             : #define ATOMIC_COMPARE_EXCHANGE(Type)                                          \
     680             :   struct Word32AtomicCompareExchange##Type##Operator                           \
     681             :       : public Operator1<MachineType> {                                        \
     682             :     Word32AtomicCompareExchange##Type##Operator()                              \
     683             :         : Operator1<MachineType>(IrOpcode::kWord32AtomicCompareExchange,       \
     684             :                                  Operator::kNoDeopt | Operator::kNoThrow,      \
     685             :                                  "Word32AtomicCompareExchange", 4, 1, 1, 1, 1, \
     686             :                                  0, MachineType::Type()) {}                    \
     687             :   };                                                                           \
     688             :   Word32AtomicCompareExchange##Type##Operator                                  \
     689             :       kWord32AtomicCompareExchange##Type;
     690      344628 :   ATOMIC_TYPE_LIST(ATOMIC_COMPARE_EXCHANGE)
     691             : #undef ATOMIC_COMPARE_EXCHANGE
     692             : 
     693             : #define ATOMIC_COMPARE_EXCHANGE(Type)                                          \
     694             :   struct Word64AtomicCompareExchange##Type##Operator                           \
     695             :       : public Operator1<MachineType> {                                        \
     696             :     Word64AtomicCompareExchange##Type##Operator()                              \
     697             :         : Operator1<MachineType>(IrOpcode::kWord64AtomicCompareExchange,       \
     698             :                                  Operator::kNoDeopt | Operator::kNoThrow,      \
     699             :                                  "Word64AtomicCompareExchange", 4, 1, 1, 1, 1, \
     700             :                                  0, MachineType::Type()) {}                    \
     701             :   };                                                                           \
     702             :   Word64AtomicCompareExchange##Type##Operator                                  \
     703             :       kWord64AtomicCompareExchange##Type;
     704      229752 :   ATOMIC_U64_TYPE_LIST(ATOMIC_COMPARE_EXCHANGE)
     705             : #undef ATOMIC_COMPARE_EXCHANGE
     706             : 
     707           0 :   struct Word32AtomicPairLoadOperator : public Operator {
     708       28719 :     Word32AtomicPairLoadOperator()
     709             :         : Operator(IrOpcode::kWord32AtomicPairLoad,
     710             :                    Operator::kNoDeopt | Operator::kNoThrow,
     711       28719 :                    "Word32AtomicPairLoad", 2, 1, 1, 2, 1, 0) {}
     712             :   };
     713             :   Word32AtomicPairLoadOperator kWord32AtomicPairLoad;
     714             : 
     715           0 :   struct Word32AtomicPairStoreOperator : public Operator {
     716       28719 :     Word32AtomicPairStoreOperator()
     717             :         : Operator(IrOpcode::kWord32AtomicPairStore,
     718             :                    Operator::kNoDeopt | Operator::kNoThrow,
     719       28719 :                    "Word32AtomicPairStore", 4, 1, 1, 0, 1, 0) {}
     720             :   };
     721             :   Word32AtomicPairStoreOperator kWord32AtomicPairStore;
     722             : 
     723             : #define ATOMIC_PAIR_OP(op)                                      \
     724             :   struct Word32AtomicPair##op##Operator : public Operator {     \
     725             :     Word32AtomicPair##op##Operator()                            \
     726             :         : Operator(IrOpcode::kWord32AtomicPair##op,             \
     727             :                    Operator::kNoDeopt | Operator::kNoThrow,     \
     728             :                    "Word32AtomicPair##op", 4, 1, 1, 2, 1, 0) {} \
     729             :   };                                                            \
     730             :   Word32AtomicPair##op##Operator kWord32AtomicPair##op;
     731      172314 :   ATOMIC_PAIR_BINOP_LIST(ATOMIC_PAIR_OP)
     732             : #undef ATOMIC_PAIR_OP
     733             : #undef ATOMIC_PAIR_BINOP_LIST
     734             : 
     735           0 :   struct Word32AtomicPairCompareExchangeOperator : public Operator {
     736       28719 :     Word32AtomicPairCompareExchangeOperator()
     737             :         : Operator(IrOpcode::kWord32AtomicPairCompareExchange,
     738             :                    Operator::kNoDeopt | Operator::kNoThrow,
     739       28719 :                    "Word32AtomicPairCompareExchange", 6, 1, 1, 2, 1, 0) {}
     740             :   };
     741             :   Word32AtomicPairCompareExchangeOperator kWord32AtomicPairCompareExchange;
     742             : 
     743             :   // The {BitcastWordToTagged} operator must not be marked as pure (especially
     744             :   // not idempotent), because otherwise the splitting logic in the Scheduler
     745             :   // might decide to split these operators, thus potentially creating live
     746             :   // ranges of allocation top across calls or other things that might allocate.
     747             :   // See https://bugs.chromium.org/p/v8/issues/detail?id=6059 for more details.
     748           0 :   struct BitcastWordToTaggedOperator : public Operator {
     749       28719 :     BitcastWordToTaggedOperator()
     750             :         : Operator(IrOpcode::kBitcastWordToTagged,
     751             :                    Operator::kEliminatable | Operator::kNoWrite,
     752       28719 :                    "BitcastWordToTagged", 1, 1, 1, 1, 1, 0) {}
     753             :   };
     754             :   BitcastWordToTaggedOperator kBitcastWordToTagged;
     755             : 
     756           0 :   struct BitcastTaggedToWordOperator : public Operator {
     757       28719 :     BitcastTaggedToWordOperator()
     758             :         : Operator(IrOpcode::kBitcastTaggedToWord,
     759             :                    Operator::kEliminatable | Operator::kNoWrite,
     760       28719 :                    "BitcastTaggedToWord", 1, 1, 1, 1, 1, 0) {}
     761             :   };
     762             :   BitcastTaggedToWordOperator kBitcastTaggedToWord;
     763             : 
     764           0 :   struct BitcastMaybeObjectToWordOperator : public Operator {
     765       28719 :     BitcastMaybeObjectToWordOperator()
     766             :         : Operator(IrOpcode::kBitcastTaggedToWord,
     767             :                    Operator::kEliminatable | Operator::kNoWrite,
     768       28719 :                    "BitcastMaybeObjectToWord", 1, 1, 1, 1, 1, 0) {}
     769             :   };
     770             :   BitcastMaybeObjectToWordOperator kBitcastMaybeObjectToWord;
     771             : 
     772           0 :   struct TaggedPoisonOnSpeculation : public Operator {
     773       28719 :     TaggedPoisonOnSpeculation()
     774             :         : Operator(IrOpcode::kTaggedPoisonOnSpeculation,
     775             :                    Operator::kEliminatable | Operator::kNoWrite,
     776       28719 :                    "TaggedPoisonOnSpeculation", 1, 1, 1, 1, 1, 0) {}
     777             :   };
     778             :   TaggedPoisonOnSpeculation kTaggedPoisonOnSpeculation;
     779             : 
     780           0 :   struct Word32PoisonOnSpeculation : public Operator {
     781       28719 :     Word32PoisonOnSpeculation()
     782             :         : Operator(IrOpcode::kWord32PoisonOnSpeculation,
     783             :                    Operator::kEliminatable | Operator::kNoWrite,
     784       28719 :                    "Word32PoisonOnSpeculation", 1, 1, 1, 1, 1, 0) {}
     785             :   };
     786             :   Word32PoisonOnSpeculation kWord32PoisonOnSpeculation;
     787             : 
     788           0 :   struct Word64PoisonOnSpeculation : public Operator {
     789       28719 :     Word64PoisonOnSpeculation()
     790             :         : Operator(IrOpcode::kWord64PoisonOnSpeculation,
     791             :                    Operator::kEliminatable | Operator::kNoWrite,
     792       28719 :                    "Word64PoisonOnSpeculation", 1, 1, 1, 1, 1, 0) {}
     793             :   };
     794             :   Word64PoisonOnSpeculation kWord64PoisonOnSpeculation;
     795             : 
     796           0 :   struct DebugAbortOperator : public Operator {
     797       28719 :     DebugAbortOperator()
     798             :         : Operator(IrOpcode::kDebugAbort, Operator::kNoThrow, "DebugAbort", 1,
     799       28719 :                    1, 1, 0, 1, 0) {}
     800             :   };
     801             :   DebugAbortOperator kDebugAbort;
     802             : 
     803           0 :   struct DebugBreakOperator : public Operator {
     804       28719 :     DebugBreakOperator()
     805             :         : Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0,
     806       28719 :                    1, 1, 0, 1, 0) {}
     807             :   };
     808             :   DebugBreakOperator kDebugBreak;
     809             : 
     810           0 :   struct UnsafePointerAddOperator final : public Operator {
     811       28719 :     UnsafePointerAddOperator()
     812             :         : Operator(IrOpcode::kUnsafePointerAdd, Operator::kKontrol,
     813       28719 :                    "UnsafePointerAdd", 2, 1, 1, 1, 1, 0) {}
     814             :   };
     815             :   UnsafePointerAddOperator kUnsafePointerAdd;
     816             : };
     817             : 
     818           0 : struct CommentOperator : public Operator1<const char*> {
     819           4 :   explicit CommentOperator(const char* msg)
     820             :       : Operator1<const char*>(IrOpcode::kComment, Operator::kNoThrow,
     821           4 :                                "Comment", 0, 1, 1, 0, 1, 0, msg) {}
     822             : };
     823             : 
     824             : namespace {
     825     5184985 : DEFINE_LAZY_LEAKY_OBJECT_GETTER(MachineOperatorGlobalCache,
     826             :                                 GetMachineOperatorGlobalCache)
     827             : }
     828             : 
     829     5156151 : MachineOperatorBuilder::MachineOperatorBuilder(
     830             :     Zone* zone, MachineRepresentation word, Flags flags,
     831             :     AlignmentRequirements alignmentRequirements)
     832             :     : zone_(zone),
     833     5156151 :       cache_(*GetMachineOperatorGlobalCache()),
     834             :       word_(word),
     835             :       flags_(flags),
     836    10312319 :       alignment_requirements_(alignmentRequirements) {
     837             :   DCHECK(word == MachineRepresentation::kWord32 ||
     838             :          word == MachineRepresentation::kWord64);
     839     5156168 : }
     840             : 
     841           2 : const Operator* MachineOperatorBuilder::UnalignedLoad(LoadRepresentation rep) {
     842             : #define LOAD(Type)                       \
     843             :   if (rep == MachineType::Type()) {      \
     844             :     return &cache_.kUnalignedLoad##Type; \
     845             :   }
     846          18 :   MACHINE_TYPE_LIST(LOAD)
     847             : #undef LOAD
     848           0 :   UNREACHABLE();
     849             : }
     850             : 
     851           2 : const Operator* MachineOperatorBuilder::UnalignedStore(
     852             :     UnalignedStoreRepresentation rep) {
     853           2 :   switch (rep) {
     854             : #define STORE(kRep)                 \
     855             :   case MachineRepresentation::kRep: \
     856             :     return &cache_.kUnalignedStore##kRep;
     857           0 :     MACHINE_REPRESENTATION_LIST(STORE)
     858             : #undef STORE
     859             :     case MachineRepresentation::kBit:
     860             :     case MachineRepresentation::kNone:
     861             :       break;
     862             :   }
     863           0 :   UNREACHABLE();
     864             : }
     865             : 
     866             : #define PURE(Name, properties, value_input_count, control_input_count, \
     867             :              output_count)                                             \
     868             :   const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; }
     869    14075459 : MACHINE_PURE_OP_LIST(PURE)
     870             : #undef PURE
     871             : 
     872             : #define PURE(Name, properties, value_input_count, control_input_count, \
     873             :              output_count)                                             \
     874             :   const OptionalOperator MachineOperatorBuilder::Name() {              \
     875             :     return OptionalOperator(flags_ & k##Name, &cache_.k##Name);        \
     876             :   }
     877      303474 : PURE_OPTIONAL_OP_LIST(PURE)
     878             : #undef PURE
     879             : 
     880             : #define OVERFLOW_OP(Name, properties) \
     881             :   const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; }
     882      354520 : OVERFLOW_OP_LIST(OVERFLOW_OP)
     883             : #undef OVERFLOW_OP
     884             : 
     885     8115449 : const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) {
     886             : #define LOAD(Type)                  \
     887             :   if (rep == MachineType::Type()) { \
     888             :     return &cache_.kLoad##Type;     \
     889             :   }
     890    96324865 :     MACHINE_TYPE_LIST(LOAD)
     891             : #undef LOAD
     892           0 :   UNREACHABLE();
     893             : }
     894             : 
     895        1269 : const Operator* MachineOperatorBuilder::PoisonedLoad(LoadRepresentation rep) {
     896             : #define LOAD(Type)                      \
     897             :   if (rep == MachineType::Type()) {     \
     898             :     return &cache_.kPoisonedLoad##Type; \
     899             :   }
     900       13329 :   MACHINE_TYPE_LIST(LOAD)
     901             : #undef LOAD
     902           0 :   UNREACHABLE();
     903             : }
     904             : 
     905       93697 : const Operator* MachineOperatorBuilder::ProtectedLoad(LoadRepresentation rep) {
     906             : #define LOAD(Type)                       \
     907             :   if (rep == MachineType::Type()) {      \
     908             :     return &cache_.kProtectedLoad##Type; \
     909             :   }
     910      807385 :   MACHINE_TYPE_LIST(LOAD)
     911             : #undef LOAD
     912           0 :   UNREACHABLE();
     913             : }
     914             : 
     915      366541 : const Operator* MachineOperatorBuilder::StackSlot(int size, int alignment) {
     916             :   DCHECK_LE(0, size);
     917             :   DCHECK(alignment == 0 || alignment == 4 || alignment == 8 || alignment == 16);
     918             : #define CASE_CACHED_SIZE(Size, Alignment)                          \
     919             :   if (size == Size && alignment == Alignment) {                    \
     920             :     return &cache_.kStackSlotOfSize##Size##OfAlignment##Alignment; \
     921             :   }
     922             : 
     923      366541 :   STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(CASE_CACHED_SIZE)
     924             : 
     925             : #undef CASE_CACHED_SIZE
     926      728753 :   return new (zone_) StackSlotOperator(size, alignment);
     927             : }
     928             : 
     929          18 : const Operator* MachineOperatorBuilder::StackSlot(MachineRepresentation rep,
     930             :                                                   int alignment) {
     931          18 :   return StackSlot(1 << ElementSizeLog2Of(rep), alignment);
     932             : }
     933             : 
     934     4335072 : const Operator* MachineOperatorBuilder::Store(StoreRepresentation store_rep) {
     935     4335072 :   switch (store_rep.representation()) {
     936             : #define STORE(kRep)                                         \
     937             :   case MachineRepresentation::kRep:                         \
     938             :     switch (store_rep.write_barrier_kind()) {               \
     939             :       case kNoWriteBarrier:                                 \
     940             :         return &cache_.k##Store##kRep##NoWriteBarrier;      \
     941             :       case kMapWriteBarrier:                                \
     942             :         return &cache_.k##Store##kRep##MapWriteBarrier;     \
     943             :       case kPointerWriteBarrier:                            \
     944             :         return &cache_.k##Store##kRep##PointerWriteBarrier; \
     945             :       case kFullWriteBarrier:                               \
     946             :         return &cache_.k##Store##kRep##FullWriteBarrier;    \
     947             :     }                                                       \
     948             :     break;
     949       12303 :     MACHINE_REPRESENTATION_LIST(STORE)
     950             : #undef STORE
     951             :     case MachineRepresentation::kBit:
     952             :     case MachineRepresentation::kNone:
     953             :       break;
     954             :   }
     955          17 :   UNREACHABLE();
     956             : }
     957             : 
     958      143835 : const Operator* MachineOperatorBuilder::ProtectedStore(
     959             :     MachineRepresentation rep) {
     960      143835 :   switch (rep) {
     961             : #define STORE(kRep)                       \
     962             :   case MachineRepresentation::kRep:       \
     963             :     return &cache_.kProtectedStore##kRep; \
     964             :     break;
     965         252 :     MACHINE_REPRESENTATION_LIST(STORE)
     966             : #undef STORE
     967             :     case MachineRepresentation::kBit:
     968             :     case MachineRepresentation::kNone:
     969             :       break;
     970             :   }
     971           0 :   UNREACHABLE();
     972             : }
     973             : 
     974        6841 : const Operator* MachineOperatorBuilder::UnsafePointerAdd() {
     975        6841 :   return &cache_.kUnsafePointerAdd;
     976             : }
     977             : 
     978      394153 : const Operator* MachineOperatorBuilder::BitcastWordToTagged() {
     979      394153 :   return &cache_.kBitcastWordToTagged;
     980             : }
     981             : 
     982     1012316 : const Operator* MachineOperatorBuilder::BitcastTaggedToWord() {
     983     1012316 :   return &cache_.kBitcastTaggedToWord;
     984             : }
     985             : 
     986       24868 : const Operator* MachineOperatorBuilder::BitcastMaybeObjectToWord() {
     987       24868 :   return &cache_.kBitcastMaybeObjectToWord;
     988             : }
     989             : 
     990           0 : const Operator* MachineOperatorBuilder::DebugAbort() {
     991           0 :   return &cache_.kDebugAbort;
     992             : }
     993             : 
     994      141528 : const Operator* MachineOperatorBuilder::DebugBreak() {
     995      141528 :   return &cache_.kDebugBreak;
     996             : }
     997             : 
     998           4 : const Operator* MachineOperatorBuilder::Comment(const char* msg) {
     999           8 :   return new (zone_) CommentOperator(msg);
    1000             : }
    1001             : 
    1002        2128 : const Operator* MachineOperatorBuilder::Word32AtomicLoad(
    1003             :     LoadRepresentation rep) {
    1004             : #define LOAD(Type)                          \
    1005             :   if (rep == MachineType::Type()) {         \
    1006             :     return &cache_.kWord32AtomicLoad##Type; \
    1007             :   }
    1008        4437 :   ATOMIC_TYPE_LIST(LOAD)
    1009             : #undef LOAD
    1010           0 :   UNREACHABLE();
    1011             : }
    1012             : 
    1013        1901 : const Operator* MachineOperatorBuilder::Word32AtomicStore(
    1014             :     MachineRepresentation rep) {
    1015             : #define STORE(kRep)                          \
    1016             :   if (rep == MachineRepresentation::kRep) {  \
    1017             :     return &cache_.kWord32AtomicStore##kRep; \
    1018             :   }
    1019        1901 :   ATOMIC_REPRESENTATION_LIST(STORE)
    1020             : #undef STORE
    1021           0 :   UNREACHABLE();
    1022             : }
    1023             : 
    1024        2267 : const Operator* MachineOperatorBuilder::Word32AtomicExchange(MachineType type) {
    1025             : #define EXCHANGE(kType)                          \
    1026             :   if (type == MachineType::kType()) {            \
    1027             :     return &cache_.kWord32AtomicExchange##kType; \
    1028             :   }
    1029        4641 :   ATOMIC_TYPE_LIST(EXCHANGE)
    1030             : #undef EXCHANGE
    1031           0 :   UNREACHABLE();
    1032             : }
    1033             : 
    1034         403 : const Operator* MachineOperatorBuilder::Word32AtomicCompareExchange(
    1035             :     MachineType type) {
    1036             : #define COMPARE_EXCHANGE(kType)                         \
    1037             :   if (type == MachineType::kType()) {                   \
    1038             :     return &cache_.kWord32AtomicCompareExchange##kType; \
    1039             :   }
    1040        1326 :   ATOMIC_TYPE_LIST(COMPARE_EXCHANGE)
    1041             : #undef COMPARE_EXCHANGE
    1042           0 :   UNREACHABLE();
    1043             : }
    1044             : 
    1045        2587 : const Operator* MachineOperatorBuilder::Word32AtomicAdd(MachineType type) {
    1046             : #define ADD(kType)                          \
    1047             :   if (type == MachineType::kType()) {       \
    1048             :     return &cache_.kWord32AtomicAdd##kType; \
    1049             :   }
    1050        5247 :   ATOMIC_TYPE_LIST(ADD)
    1051             : #undef ADD
    1052           0 :   UNREACHABLE();
    1053             : }
    1054             : 
    1055        1640 : const Operator* MachineOperatorBuilder::Word32AtomicSub(MachineType type) {
    1056             : #define SUB(kType)                          \
    1057             :   if (type == MachineType::kType()) {       \
    1058             :     return &cache_.kWord32AtomicSub##kType; \
    1059             :   }
    1060        3728 :   ATOMIC_TYPE_LIST(SUB)
    1061             : #undef SUB
    1062           0 :   UNREACHABLE();
    1063             : }
    1064             : 
    1065        2432 : const Operator* MachineOperatorBuilder::Word32AtomicAnd(MachineType type) {
    1066             : #define AND(kType)                          \
    1067             :   if (type == MachineType::kType()) {       \
    1068             :     return &cache_.kWord32AtomicAnd##kType; \
    1069             :   }
    1070        5010 :   ATOMIC_TYPE_LIST(AND)
    1071             : #undef AND
    1072           0 :   UNREACHABLE();
    1073             : }
    1074             : 
    1075        2174 : const Operator* MachineOperatorBuilder::Word32AtomicOr(MachineType type) {
    1076             : #define OR(kType)                          \
    1077             :   if (type == MachineType::kType()) {      \
    1078             :     return &cache_.kWord32AtomicOr##kType; \
    1079             :   }
    1080        4266 :   ATOMIC_TYPE_LIST(OR)
    1081             : #undef OR
    1082           0 :   UNREACHABLE();
    1083             : }
    1084             : 
    1085        2218 : const Operator* MachineOperatorBuilder::Word32AtomicXor(MachineType type) {
    1086             : #define XOR(kType)                          \
    1087             :   if (type == MachineType::kType()) {       \
    1088             :     return &cache_.kWord32AtomicXor##kType; \
    1089             :   }
    1090        4588 :   ATOMIC_TYPE_LIST(XOR)
    1091             : #undef XOR
    1092           0 :   UNREACHABLE();
    1093             : }
    1094             : 
    1095        1686 : const Operator* MachineOperatorBuilder::Word64AtomicLoad(
    1096             :     LoadRepresentation rep) {
    1097             : #define LOAD(Type)                          \
    1098             :   if (rep == MachineType::Type()) {         \
    1099             :     return &cache_.kWord64AtomicLoad##Type; \
    1100             :   }
    1101        3944 :   ATOMIC_U64_TYPE_LIST(LOAD)
    1102             : #undef LOAD
    1103           0 :   UNREACHABLE();
    1104             : }
    1105             : 
    1106        1968 : const Operator* MachineOperatorBuilder::Word64AtomicStore(
    1107             :     MachineRepresentation rep) {
    1108             : #define STORE(kRep)                          \
    1109             :   if (rep == MachineRepresentation::kRep) {  \
    1110             :     return &cache_.kWord64AtomicStore##kRep; \
    1111             :   }
    1112        1968 :   ATOMIC64_REPRESENTATION_LIST(STORE)
    1113             : #undef STORE
    1114           0 :   UNREACHABLE();
    1115             : }
    1116             : 
    1117        1928 : const Operator* MachineOperatorBuilder::Word64AtomicAdd(MachineType type) {
    1118             : #define ADD(kType)                          \
    1119             :   if (type == MachineType::kType()) {       \
    1120             :     return &cache_.kWord64AtomicAdd##kType; \
    1121             :   }
    1122        4464 :   ATOMIC_U64_TYPE_LIST(ADD)
    1123             : #undef ADD
    1124           0 :   UNREACHABLE();
    1125             : }
    1126             : 
    1127        2543 : const Operator* MachineOperatorBuilder::Word64AtomicSub(MachineType type) {
    1128             : #define SUB(kType)                          \
    1129             :   if (type == MachineType::kType()) {       \
    1130             :     return &cache_.kWord64AtomicSub##kType; \
    1131             :   }
    1132        5036 :   ATOMIC_U64_TYPE_LIST(SUB)
    1133             : #undef SUB
    1134           0 :   UNREACHABLE();
    1135             : }
    1136             : 
    1137        2177 : const Operator* MachineOperatorBuilder::Word64AtomicAnd(MachineType type) {
    1138             : #define AND(kType)                          \
    1139             :   if (type == MachineType::kType()) {       \
    1140             :     return &cache_.kWord64AtomicAnd##kType; \
    1141             :   }
    1142        4817 :   ATOMIC_U64_TYPE_LIST(AND)
    1143             : #undef AND
    1144           0 :   UNREACHABLE();
    1145             : }
    1146             : 
    1147        2409 : const Operator* MachineOperatorBuilder::Word64AtomicOr(MachineType type) {
    1148             : #define OR(kType)                          \
    1149             :   if (type == MachineType::kType()) {      \
    1150             :     return &cache_.kWord64AtomicOr##kType; \
    1151             :   }
    1152        5116 :   ATOMIC_U64_TYPE_LIST(OR)
    1153             : #undef OR
    1154           0 :   UNREACHABLE();
    1155             : }
    1156             : 
    1157        2403 : const Operator* MachineOperatorBuilder::Word64AtomicXor(MachineType type) {
    1158             : #define XOR(kType)                          \
    1159             :   if (type == MachineType::kType()) {       \
    1160             :     return &cache_.kWord64AtomicXor##kType; \
    1161             :   }
    1162        5247 :   ATOMIC_U64_TYPE_LIST(XOR)
    1163             : #undef XOR
    1164           0 :   UNREACHABLE();
    1165             : }
    1166             : 
    1167        2768 : const Operator* MachineOperatorBuilder::Word64AtomicExchange(MachineType type) {
    1168             : #define EXCHANGE(kType)                          \
    1169             :   if (type == MachineType::kType()) {            \
    1170             :     return &cache_.kWord64AtomicExchange##kType; \
    1171             :   }
    1172        5494 :   ATOMIC_U64_TYPE_LIST(EXCHANGE)
    1173             : #undef EXCHANGE
    1174           0 :   UNREACHABLE();
    1175             : }
    1176             : 
    1177         220 : const Operator* MachineOperatorBuilder::Word64AtomicCompareExchange(
    1178             :     MachineType type) {
    1179             : #define COMPARE_EXCHANGE(kType)                         \
    1180             :   if (type == MachineType::kType()) {                   \
    1181             :     return &cache_.kWord64AtomicCompareExchange##kType; \
    1182             :   }
    1183         754 :   ATOMIC_U64_TYPE_LIST(COMPARE_EXCHANGE)
    1184             : #undef COMPARE_EXCHANGE
    1185           0 :   UNREACHABLE();
    1186             : }
    1187             : 
    1188           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairLoad() {
    1189           0 :   return &cache_.kWord32AtomicPairLoad;
    1190             : }
    1191             : 
    1192           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairStore() {
    1193           0 :   return &cache_.kWord32AtomicPairStore;
    1194             : }
    1195             : 
    1196           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairAdd() {
    1197           0 :   return &cache_.kWord32AtomicPairAdd;
    1198             : }
    1199             : 
    1200           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairSub() {
    1201           0 :   return &cache_.kWord32AtomicPairSub;
    1202             : }
    1203             : 
    1204           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairAnd() {
    1205           0 :   return &cache_.kWord32AtomicPairAnd;
    1206             : }
    1207             : 
    1208           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairOr() {
    1209           0 :   return &cache_.kWord32AtomicPairOr;
    1210             : }
    1211             : 
    1212           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairXor() {
    1213           0 :   return &cache_.kWord32AtomicPairXor;
    1214             : }
    1215             : 
    1216           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairExchange() {
    1217           0 :   return &cache_.kWord32AtomicPairExchange;
    1218             : }
    1219             : 
    1220           0 : const Operator* MachineOperatorBuilder::Word32AtomicPairCompareExchange() {
    1221           0 :   return &cache_.kWord32AtomicPairCompareExchange;
    1222             : }
    1223             : 
    1224         856 : const Operator* MachineOperatorBuilder::TaggedPoisonOnSpeculation() {
    1225         856 :   return &cache_.kTaggedPoisonOnSpeculation;
    1226             : }
    1227             : 
    1228           0 : const Operator* MachineOperatorBuilder::Word32PoisonOnSpeculation() {
    1229           0 :   return &cache_.kWord32PoisonOnSpeculation;
    1230             : }
    1231             : 
    1232           0 : const Operator* MachineOperatorBuilder::Word64PoisonOnSpeculation() {
    1233           0 :   return &cache_.kWord64PoisonOnSpeculation;
    1234             : }
    1235             : 
    1236             : #define SIMD_LANE_OPS(Type, lane_count)                                     \
    1237             :   const Operator* MachineOperatorBuilder::Type##ExtractLane(                \
    1238             :       int32_t lane_index) {                                                 \
    1239             :     DCHECK(0 <= lane_index && lane_index < lane_count);                     \
    1240             :     return new (zone_)                                                      \
    1241             :         Operator1<int32_t>(IrOpcode::k##Type##ExtractLane, Operator::kPure, \
    1242             :                            "Extract lane", 1, 0, 0, 1, 0, 0, lane_index);   \
    1243             :   }                                                                         \
    1244             :   const Operator* MachineOperatorBuilder::Type##ReplaceLane(                \
    1245             :       int32_t lane_index) {                                                 \
    1246             :     DCHECK(0 <= lane_index && lane_index < lane_count);                     \
    1247             :     return new (zone_)                                                      \
    1248             :         Operator1<int32_t>(IrOpcode::k##Type##ReplaceLane, Operator::kPure, \
    1249             :                            "Replace lane", 2, 0, 0, 1, 0, 0, lane_index);   \
    1250             :   }
    1251        8440 : SIMD_LANE_OP_LIST(SIMD_LANE_OPS)
    1252             : #undef SIMD_LANE_OPS
    1253             : 
    1254             : #define SIMD_SHIFT_OPS(format, bits)                                           \
    1255             :   const Operator* MachineOperatorBuilder::I##format##Shl(int32_t shift) {      \
    1256             :     DCHECK(0 <= shift && shift < bits);                                        \
    1257             :     return new (zone_)                                                         \
    1258             :         Operator1<int32_t>(IrOpcode::kI##format##Shl, Operator::kPure,         \
    1259             :                            "Shift left", 1, 0, 0, 1, 0, 0, shift);             \
    1260             :   }                                                                            \
    1261             :   const Operator* MachineOperatorBuilder::I##format##ShrS(int32_t shift) {     \
    1262             :     DCHECK(0 < shift && shift <= bits);                                        \
    1263             :     return new (zone_)                                                         \
    1264             :         Operator1<int32_t>(IrOpcode::kI##format##ShrS, Operator::kPure,        \
    1265             :                            "Arithmetic shift right", 1, 0, 0, 1, 0, 0, shift); \
    1266             :   }                                                                            \
    1267             :   const Operator* MachineOperatorBuilder::I##format##ShrU(int32_t shift) {     \
    1268             :     DCHECK(0 <= shift && shift < bits);                                        \
    1269             :     return new (zone_)                                                         \
    1270             :         Operator1<int32_t>(IrOpcode::kI##format##ShrU, Operator::kPure,        \
    1271             :                            "Shift right", 1, 0, 0, 1, 0, 0, shift);            \
    1272             :   }
    1273        2544 : SIMD_FORMAT_LIST(SIMD_SHIFT_OPS)
    1274             : #undef SIMD_SHIFT_OPS
    1275             : 
    1276       14800 : const Operator* MachineOperatorBuilder::S8x16Shuffle(
    1277             :     const uint8_t shuffle[16]) {
    1278       14800 :   uint8_t* array = zone_->NewArray<uint8_t>(16);
    1279             :   memcpy(array, shuffle, 16);
    1280             :   return new (zone_)
    1281             :       Operator1<uint8_t*>(IrOpcode::kS8x16Shuffle, Operator::kPure, "Shuffle",
    1282       29600 :                           2, 0, 0, 1, 0, 0, array);
    1283             : }
    1284             : 
    1285             : #undef PURE_BINARY_OP_LIST_32
    1286             : #undef PURE_BINARY_OP_LIST_64
    1287             : #undef MACHINE_PURE_OP_LIST
    1288             : #undef PURE_OPTIONAL_OP_LIST
    1289             : #undef OVERFLOW_OP_LIST
    1290             : #undef MACHINE_TYPE_LIST
    1291             : #undef MACHINE_REPRESENTATION_LIST
    1292             : #undef ATOMIC_TYPE_LIST
    1293             : #undef ATOMIC_U64_TYPE_LIST
    1294             : #undef ATOMIC_U32_TYPE_LIST
    1295             : #undef ATOMIC_REPRESENTATION_LIST
    1296             : #undef ATOMIC64_REPRESENTATION_LIST
    1297             : #undef SIMD_LANE_OP_LIST
    1298             : #undef SIMD_FORMAT_LIST
    1299             : #undef STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST
    1300             : 
    1301             : }  // namespace compiler
    1302             : }  // namespace internal
    1303             : }  // namespace v8

Generated by: LCOV version 1.10