LCOV - code coverage report
Current view: top level - src/compiler - raw-machine-assembler.h (source / functions) Hit Total Coverage
Test: app.info Lines: 381 412 92.5 %
Date: 2019-01-20 Functions: 185 196 94.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             : #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_
       6             : #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_
       7             : 
       8             : #include "src/assembler.h"
       9             : #include "src/compiler/access-builder.h"
      10             : #include "src/compiler/common-operator.h"
      11             : #include "src/compiler/graph.h"
      12             : #include "src/compiler/linkage.h"
      13             : #include "src/compiler/machine-operator.h"
      14             : #include "src/compiler/node.h"
      15             : #include "src/compiler/operator.h"
      16             : #include "src/compiler/simplified-operator.h"
      17             : #include "src/globals.h"
      18             : #include "src/heap/factory.h"
      19             : #include "src/isolate.h"
      20             : 
      21             : namespace v8 {
      22             : namespace internal {
      23             : namespace compiler {
      24             : 
      25             : class BasicBlock;
      26             : class RawMachineLabel;
      27             : class Schedule;
      28             : 
      29             : 
      30             : // The RawMachineAssembler produces a low-level IR graph. All nodes are wired
      31             : // into a graph and also placed into a schedule immediately, hence subsequent
      32             : // code generation can happen without the need for scheduling.
      33             : //
      34             : // In order to create a schedule on-the-fly, the assembler keeps track of basic
      35             : // blocks by having one current basic block being populated and by referencing
      36             : // other basic blocks through the use of labels.
      37             : //
      38             : // Also note that the generated graph is only valid together with the generated
      39             : // schedule, using one without the other is invalid as the graph is inherently
      40             : // non-schedulable due to missing control and effect dependencies.
      41             : class V8_EXPORT_PRIVATE RawMachineAssembler {
      42             :  public:
      43             :   RawMachineAssembler(
      44             :       Isolate* isolate, Graph* graph, CallDescriptor* call_descriptor,
      45             :       MachineRepresentation word = MachineType::PointerRepresentation(),
      46             :       MachineOperatorBuilder::Flags flags =
      47             :           MachineOperatorBuilder::Flag::kNoFlags,
      48             :       MachineOperatorBuilder::AlignmentRequirements alignment_requirements =
      49             :           MachineOperatorBuilder::AlignmentRequirements::
      50             :               FullUnalignedAccessSupport(),
      51             :       PoisoningMitigationLevel poisoning_level =
      52             :           PoisoningMitigationLevel::kPoisonCriticalOnly);
      53             :   ~RawMachineAssembler() = default;
      54             : 
      55             :   Isolate* isolate() const { return isolate_; }
      56             :   Graph* graph() const { return graph_; }
      57    10564516 :   Zone* zone() const { return graph()->zone(); }
      58             :   MachineOperatorBuilder* machine() { return &machine_; }
      59             :   CommonOperatorBuilder* common() { return &common_; }
      60             :   SimplifiedOperatorBuilder* simplified() { return &simplified_; }
      61             :   CallDescriptor* call_descriptor() const { return call_descriptor_; }
      62             :   PoisoningMitigationLevel poisoning_level() const { return poisoning_level_; }
      63             : 
      64             :   // Finalizes the schedule and exports it to be used for code generation. Note
      65             :   // that this RawMachineAssembler becomes invalid after export.
      66             :   Schedule* Export();
      67             :   // Finalizes the schedule and transforms it into a graph that's suitable for
      68             :   // it to be used for Turbofan optimization and re-scheduling. Note that this
      69             :   // RawMachineAssembler becomes invalid after export.
      70             :   Graph* ExportForOptimization();
      71             : 
      72             :   // ===========================================================================
      73             :   // The following utility methods create new nodes with specific operators and
      74             :   // place them into the current basic block. They don't perform control flow,
      75             :   // hence will not switch the current basic block.
      76             : 
      77             :   Node* NullConstant();
      78             :   Node* UndefinedConstant();
      79             : 
      80             :   // Constants.
      81             :   Node* PointerConstant(void* value) {
      82      189116 :     return IntPtrConstant(reinterpret_cast<intptr_t>(value));
      83             :   }
      84             :   Node* IntPtrConstant(intptr_t value) {
      85             :     // TODO(dcarney): mark generated code as unserializable if value != 0.
      86             :     return kSystemPointerSize == 8 ? Int64Constant(value)
      87     4190658 :                                    : Int32Constant(static_cast<int>(value));
      88             :   }
      89             :   Node* RelocatableIntPtrConstant(intptr_t value, RelocInfo::Mode rmode);
      90     1914663 :   Node* Int32Constant(int32_t value) {
      91     3829326 :     return AddNode(common()->Int32Constant(value));
      92             :   }
      93          20 :   Node* StackSlot(MachineRepresentation rep, int alignment = 0) {
      94          40 :     return AddNode(machine()->StackSlot(rep, alignment));
      95             :   }
      96     4352390 :   Node* Int64Constant(int64_t value) {
      97     8704780 :     return AddNode(common()->Int64Constant(value));
      98             :   }
      99         215 :   Node* NumberConstant(double value) {
     100         430 :     return AddNode(common()->NumberConstant(value));
     101             :   }
     102       10008 :   Node* Float32Constant(float value) {
     103       20016 :     return AddNode(common()->Float32Constant(value));
     104             :   }
     105       28176 :   Node* Float64Constant(double value) {
     106       56352 :     return AddNode(common()->Float64Constant(value));
     107             :   }
     108      762365 :   Node* HeapConstant(Handle<HeapObject> object) {
     109     1524730 :     return AddNode(common()->HeapConstant(object));
     110             :   }
     111      221045 :   Node* ExternalConstant(ExternalReference address) {
     112      442090 :     return AddNode(common()->ExternalConstant(address));
     113             :   }
     114             :   Node* RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) {
     115             :     return AddNode(common()->RelocatableInt32Constant(value, rmode));
     116             :   }
     117           0 :   Node* RelocatableInt64Constant(int64_t value, RelocInfo::Mode rmode) {
     118           0 :     return AddNode(common()->RelocatableInt64Constant(value, rmode));
     119             :   }
     120             : 
     121      258284 :   Node* Projection(int index, Node* a) {
     122      516568 :     return AddNode(common()->Projection(index), a);
     123             :   }
     124             : 
     125             :   // Memory Operations.
     126       74462 :   Node* Load(MachineType rep, Node* base,
     127             :              LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
     128       74462 :     return Load(rep, base, IntPtrConstant(0), needs_poisoning);
     129             :   }
     130     1654759 :   Node* Load(MachineType rep, Node* base, Node* index,
     131             :              LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
     132     1654759 :     const Operator* op = machine()->Load(rep);
     133     1654759 :     CHECK_NE(PoisoningMitigationLevel::kPoisonAll, poisoning_level_);
     134     1654759 :     if (needs_poisoning == LoadSensitivity::kCritical &&
     135             :         poisoning_level_ == PoisoningMitigationLevel::kPoisonCriticalOnly) {
     136        1266 :       op = machine()->PoisonedLoad(rep);
     137             :     }
     138     1654759 :     return AddNode(op, base, index);
     139             :   }
     140      160799 :   Node* Store(MachineRepresentation rep, Node* base, Node* value,
     141             :               WriteBarrierKind write_barrier) {
     142      321598 :     return Store(rep, base, IntPtrConstant(0), value, write_barrier);
     143             :   }
     144      438304 :   Node* Store(MachineRepresentation rep, Node* base, Node* index, Node* value,
     145             :               WriteBarrierKind write_barrier) {
     146             :     return AddNode(machine()->Store(StoreRepresentation(rep, write_barrier)),
     147      876608 :                    base, index, value);
     148             :   }
     149      249458 :   void OptimizedStoreField(MachineRepresentation rep, Node* object, int offset,
     150             :                            Node* value, WriteBarrierKind write_barrier) {
     151             :     AddNode(simplified()->StoreField(FieldAccess(
     152             :                 BaseTaggedness::kTaggedBase, offset, MaybeHandle<Name>(),
     153             :                 MaybeHandle<Map>(), Type::Any(),
     154             :                 MachineType::TypeForRepresentation(rep), write_barrier)),
     155      748374 :             object, value);
     156      249458 :   }
     157       10715 :   void OptimizedStoreMap(Node* object, Node* value) {
     158       21430 :     AddNode(simplified()->StoreField(AccessBuilder::ForMap()), object, value);
     159       10715 :   }
     160           0 :   Node* Retain(Node* value) { return AddNode(common()->Retain(), value); }
     161             : 
     162             :   Node* OptimizedAllocate(Node* size, PretenureFlag pretenure);
     163             : 
     164             :   // Unaligned memory operations
     165             :   Node* UnalignedLoad(MachineType type, Node* base) {
     166             :     return UnalignedLoad(type, base, IntPtrConstant(0));
     167             :   }
     168       11675 :   Node* UnalignedLoad(MachineType type, Node* base, Node* index) {
     169       23350 :     if (machine()->UnalignedLoadSupported(type.representation())) {
     170       23350 :       return AddNode(machine()->Load(type), base, index);
     171             :     } else {
     172           0 :       return AddNode(machine()->UnalignedLoad(type), base, index);
     173             :     }
     174             :   }
     175          40 :   Node* UnalignedStore(MachineRepresentation rep, Node* base, Node* value) {
     176          40 :     return UnalignedStore(rep, base, IntPtrConstant(0), value);
     177             :   }
     178        3700 :   Node* UnalignedStore(MachineRepresentation rep, Node* base, Node* index,
     179             :                        Node* value) {
     180        3700 :     if (machine()->UnalignedStoreSupported(rep)) {
     181             :       return AddNode(machine()->Store(StoreRepresentation(
     182             :                          rep, WriteBarrierKind::kNoWriteBarrier)),
     183        7400 :                      base, index, value);
     184             :     } else {
     185             :       return AddNode(
     186             :           machine()->UnalignedStore(UnalignedStoreRepresentation(rep)), base,
     187           0 :           index, value);
     188             :     }
     189             :   }
     190             : 
     191             :   // Atomic memory operations.
     192         448 :   Node* AtomicLoad(MachineType type, Node* base, Node* index) {
     193         448 :     if (type.representation() == MachineRepresentation::kWord64) {
     194         112 :       if (machine()->Is64()) {
     195         224 :         return AddNode(machine()->Word64AtomicLoad(type), base, index);
     196             :       } else {
     197           0 :         return AddNode(machine()->Word32AtomicPairLoad(), base, index);
     198             :       }
     199             :     }
     200         672 :     return AddNode(machine()->Word32AtomicLoad(type), base, index);
     201             :   }
     202             : 
     203             : #if defined(V8_TARGET_BIG_ENDIAN)
     204             : #define VALUE_HALVES value_high, value
     205             : #else
     206             : #define VALUE_HALVES value, value_high
     207             : #endif
     208             : 
     209         224 :   Node* AtomicStore(MachineRepresentation rep, Node* base, Node* index,
     210             :                     Node* value, Node* value_high) {
     211         224 :     if (rep == MachineRepresentation::kWord64) {
     212          56 :       if (machine()->Is64()) {
     213             :         DCHECK_NULL(value_high);
     214         112 :         return AddNode(machine()->Word64AtomicStore(rep), base, index, value);
     215             :       } else {
     216             :         return AddNode(machine()->Word32AtomicPairStore(), base, index,
     217           0 :                        VALUE_HALVES);
     218             :       }
     219             :     }
     220             :     DCHECK_NULL(value_high);
     221         336 :     return AddNode(machine()->Word32AtomicStore(rep), base, index, value);
     222             :   }
     223             : #define ATOMIC_FUNCTION(name)                                               \
     224             :   Node* Atomic##name(MachineType rep, Node* base, Node* index, Node* value, \
     225             :                      Node* value_high) {                                    \
     226             :     if (rep.representation() == MachineRepresentation::kWord64) {           \
     227             :       if (machine()->Is64()) {                                              \
     228             :         DCHECK_NULL(value_high);                                            \
     229             :         return AddNode(machine()->Word64Atomic##name(rep), base, index,     \
     230             :                        value);                                              \
     231             :       } else {                                                              \
     232             :         return AddNode(machine()->Word32AtomicPair##name(), base, index,    \
     233             :                        VALUE_HALVES);                                       \
     234             :       }                                                                     \
     235             :     }                                                                       \
     236             :     DCHECK_NULL(value_high);                                                \
     237             :     return AddNode(machine()->Word32Atomic##name(rep), base, index, value); \
     238             :   }
     239        1008 :   ATOMIC_FUNCTION(Exchange);
     240        1008 :   ATOMIC_FUNCTION(Add);
     241        1008 :   ATOMIC_FUNCTION(Sub);
     242        1008 :   ATOMIC_FUNCTION(And);
     243        1008 :   ATOMIC_FUNCTION(Or);
     244        1008 :   ATOMIC_FUNCTION(Xor);
     245             : #undef ATOMIC_FUNCTION
     246             : #undef VALUE_HALVES
     247             : 
     248         448 :   Node* AtomicCompareExchange(MachineType rep, Node* base, Node* index,
     249             :                               Node* old_value, Node* old_value_high,
     250             :                               Node* new_value, Node* new_value_high) {
     251         448 :     if (rep.representation() == MachineRepresentation::kWord64) {
     252         112 :       if (machine()->Is64()) {
     253             :         DCHECK_NULL(old_value_high);
     254             :         DCHECK_NULL(new_value_high);
     255             :         return AddNode(machine()->Word64AtomicCompareExchange(rep), base, index,
     256         224 :                        old_value, new_value);
     257             :       } else {
     258             :         return AddNode(machine()->Word32AtomicPairCompareExchange(), base,
     259             :                        index, old_value, old_value_high, new_value,
     260           0 :                        new_value_high);
     261             :       }
     262             :     }
     263             :     DCHECK_NULL(old_value_high);
     264             :     DCHECK_NULL(new_value_high);
     265             :     return AddNode(machine()->Word32AtomicCompareExchange(rep), base, index,
     266         672 :                    old_value, new_value);
     267             :   }
     268             : 
     269           1 :   Node* SpeculationFence() {
     270           2 :     return AddNode(machine()->SpeculationFence().op());
     271             :   }
     272             : 
     273             :   // Arithmetic Operations.
     274      298458 :   Node* WordAnd(Node* a, Node* b) {
     275      596916 :     return AddNode(machine()->WordAnd(), a, b);
     276             :   }
     277       76660 :   Node* WordOr(Node* a, Node* b) { return AddNode(machine()->WordOr(), a, b); }
     278           6 :   Node* WordXor(Node* a, Node* b) {
     279          12 :     return AddNode(machine()->WordXor(), a, b);
     280             :   }
     281      399481 :   Node* WordShl(Node* a, Node* b) {
     282      798962 :     return AddNode(machine()->WordShl(), a, b);
     283             :   }
     284       21890 :   Node* WordShr(Node* a, Node* b) {
     285       43780 :     return AddNode(machine()->WordShr(), a, b);
     286             :   }
     287      157911 :   Node* WordSar(Node* a, Node* b) {
     288      315822 :     return AddNode(machine()->WordSar(), a, b);
     289             :   }
     290           0 :   Node* WordRor(Node* a, Node* b) {
     291           0 :     return AddNode(machine()->WordRor(), a, b);
     292             :   }
     293      701305 :   Node* WordEqual(Node* a, Node* b) {
     294     1402610 :     return AddNode(machine()->WordEqual(), a, b);
     295             :   }
     296      102618 :   Node* WordNotEqual(Node* a, Node* b) {
     297      102618 :     return Word32BinaryNot(WordEqual(a, b));
     298             :   }
     299           0 :   Node* WordNot(Node* a) {
     300           0 :     if (machine()->Is32()) {
     301           0 :       return Word32BitwiseNot(a);
     302             :     } else {
     303           0 :       return Word64Not(a);
     304             :     }
     305             :   }
     306             : 
     307      136064 :   Node* Word32And(Node* a, Node* b) {
     308      272128 :     return AddNode(machine()->Word32And(), a, b);
     309             :   }
     310       29309 :   Node* Word32Or(Node* a, Node* b) {
     311       58618 :     return AddNode(machine()->Word32Or(), a, b);
     312             :   }
     313        4465 :   Node* Word32Xor(Node* a, Node* b) {
     314        8930 :     return AddNode(machine()->Word32Xor(), a, b);
     315             :   }
     316       10603 :   Node* Word32Shl(Node* a, Node* b) {
     317       21206 :     return AddNode(machine()->Word32Shl(), a, b);
     318             :   }
     319       41692 :   Node* Word32Shr(Node* a, Node* b) {
     320       83384 :     return AddNode(machine()->Word32Shr(), a, b);
     321             :   }
     322        1094 :   Node* Word32Sar(Node* a, Node* b) {
     323        2188 :     return AddNode(machine()->Word32Sar(), a, b);
     324             :   }
     325         497 :   Node* Word32Ror(Node* a, Node* b) {
     326         994 :     return AddNode(machine()->Word32Ror(), a, b);
     327             :   }
     328         124 :   Node* Word32Clz(Node* a) { return AddNode(machine()->Word32Clz(), a); }
     329      494648 :   Node* Word32Equal(Node* a, Node* b) {
     330      989296 :     return AddNode(machine()->Word32Equal(), a, b);
     331             :   }
     332       83157 :   Node* Word32NotEqual(Node* a, Node* b) {
     333       83157 :     return Word32BinaryNot(Word32Equal(a, b));
     334             :   }
     335        1073 :   Node* Word32BitwiseNot(Node* a) { return Word32Xor(a, Int32Constant(-1)); }
     336      195235 :   Node* Word32BinaryNot(Node* a) { return Word32Equal(a, Int32Constant(0)); }
     337             : 
     338          16 :   Node* Word64And(Node* a, Node* b) {
     339          32 :     return AddNode(machine()->Word64And(), a, b);
     340             :   }
     341           1 :   Node* Word64Or(Node* a, Node* b) {
     342           2 :     return AddNode(machine()->Word64Or(), a, b);
     343             :   }
     344           1 :   Node* Word64Xor(Node* a, Node* b) {
     345           2 :     return AddNode(machine()->Word64Xor(), a, b);
     346             :   }
     347         104 :   Node* Word64Shl(Node* a, Node* b) {
     348         208 :     return AddNode(machine()->Word64Shl(), a, b);
     349             :   }
     350          27 :   Node* Word64Shr(Node* a, Node* b) {
     351          54 :     return AddNode(machine()->Word64Shr(), a, b);
     352             :   }
     353           3 :   Node* Word64Sar(Node* a, Node* b) {
     354           6 :     return AddNode(machine()->Word64Sar(), a, b);
     355             :   }
     356           0 :   Node* Word64Ror(Node* a, Node* b) {
     357           0 :     return AddNode(machine()->Word64Ror(), a, b);
     358             :   }
     359          10 :   Node* Word64Clz(Node* a) { return AddNode(machine()->Word64Clz(), a); }
     360       12603 :   Node* Word64Equal(Node* a, Node* b) {
     361       25206 :     return AddNode(machine()->Word64Equal(), a, b);
     362             :   }
     363          30 :   Node* Word64NotEqual(Node* a, Node* b) {
     364          30 :     return Word32BinaryNot(Word64Equal(a, b));
     365             :   }
     366           0 :   Node* Word64Not(Node* a) { return Word64Xor(a, Int64Constant(-1)); }
     367             : 
     368       52263 :   Node* Int32Add(Node* a, Node* b) {
     369      104526 :     return AddNode(machine()->Int32Add(), a, b);
     370             :   }
     371       17410 :   Node* Int32AddWithOverflow(Node* a, Node* b) {
     372       34820 :     return AddNode(machine()->Int32AddWithOverflow(), a, b);
     373             :   }
     374       17682 :   Node* Int32Sub(Node* a, Node* b) {
     375       35364 :     return AddNode(machine()->Int32Sub(), a, b);
     376             :   }
     377       17410 :   Node* Int32SubWithOverflow(Node* a, Node* b) {
     378       34820 :     return AddNode(machine()->Int32SubWithOverflow(), a, b);
     379             :   }
     380       36972 :   Node* Int32Mul(Node* a, Node* b) {
     381       73944 :     return AddNode(machine()->Int32Mul(), a, b);
     382             :   }
     383           8 :   Node* Int32MulHigh(Node* a, Node* b) {
     384          16 :     return AddNode(machine()->Int32MulHigh(), a, b);
     385             :   }
     386       18250 :   Node* Int32MulWithOverflow(Node* a, Node* b) {
     387       36500 :     return AddNode(machine()->Int32MulWithOverflow(), a, b);
     388             :   }
     389        1493 :   Node* Int32Div(Node* a, Node* b) {
     390        2986 :     return AddNode(machine()->Int32Div(), a, b);
     391             :   }
     392        2084 :   Node* Int32Mod(Node* a, Node* b) {
     393        4168 :     return AddNode(machine()->Int32Mod(), a, b);
     394             :   }
     395       33264 :   Node* Int32LessThan(Node* a, Node* b) {
     396       66528 :     return AddNode(machine()->Int32LessThan(), a, b);
     397             :   }
     398       24483 :   Node* Int32LessThanOrEqual(Node* a, Node* b) {
     399       48966 :     return AddNode(machine()->Int32LessThanOrEqual(), a, b);
     400             :   }
     401          12 :   Node* Uint32Div(Node* a, Node* b) {
     402          24 :     return AddNode(machine()->Uint32Div(), a, b);
     403             :   }
     404        8727 :   Node* Uint32LessThan(Node* a, Node* b) {
     405       17454 :     return AddNode(machine()->Uint32LessThan(), a, b);
     406             :   }
     407       13242 :   Node* Uint32LessThanOrEqual(Node* a, Node* b) {
     408       26484 :     return AddNode(machine()->Uint32LessThanOrEqual(), a, b);
     409             :   }
     410          12 :   Node* Uint32Mod(Node* a, Node* b) {
     411          24 :     return AddNode(machine()->Uint32Mod(), a, b);
     412             :   }
     413           6 :   Node* Uint32MulHigh(Node* a, Node* b) {
     414          12 :     return AddNode(machine()->Uint32MulHigh(), a, b);
     415             :   }
     416        5070 :   Node* Int32GreaterThan(Node* a, Node* b) { return Int32LessThan(b, a); }
     417             :   Node* Int32GreaterThanOrEqual(Node* a, Node* b) {
     418       15644 :     return Int32LessThanOrEqual(b, a);
     419             :   }
     420         122 :   Node* Uint32GreaterThan(Node* a, Node* b) { return Uint32LessThan(b, a); }
     421             :   Node* Uint32GreaterThanOrEqual(Node* a, Node* b) {
     422        4744 :     return Uint32LessThanOrEqual(b, a);
     423             :   }
     424           5 :   Node* Int32Neg(Node* a) { return Int32Sub(Int32Constant(0), a); }
     425             : 
     426      618367 :   Node* Int64Add(Node* a, Node* b) {
     427     1236734 :     return AddNode(machine()->Int64Add(), a, b);
     428             :   }
     429       38390 :   Node* Int64AddWithOverflow(Node* a, Node* b) {
     430       76780 :     return AddNode(machine()->Int64AddWithOverflow(), a, b);
     431             :   }
     432      102252 :   Node* Int64Sub(Node* a, Node* b) {
     433      204504 :     return AddNode(machine()->Int64Sub(), a, b);
     434             :   }
     435       36318 :   Node* Int64SubWithOverflow(Node* a, Node* b) {
     436       72636 :     return AddNode(machine()->Int64SubWithOverflow(), a, b);
     437             :   }
     438       34925 :   Node* Int64Mul(Node* a, Node* b) {
     439       69850 :     return AddNode(machine()->Int64Mul(), a, b);
     440             :   }
     441         449 :   Node* Int64Div(Node* a, Node* b) {
     442         898 :     return AddNode(machine()->Int64Div(), a, b);
     443             :   }
     444             :   Node* Int64Mod(Node* a, Node* b) {
     445             :     return AddNode(machine()->Int64Mod(), a, b);
     446             :   }
     447             :   Node* Int64Neg(Node* a) { return Int64Sub(Int64Constant(0), a); }
     448       46153 :   Node* Int64LessThan(Node* a, Node* b) {
     449       92306 :     return AddNode(machine()->Int64LessThan(), a, b);
     450             :   }
     451       16218 :   Node* Int64LessThanOrEqual(Node* a, Node* b) {
     452       32436 :     return AddNode(machine()->Int64LessThanOrEqual(), a, b);
     453             :   }
     454       41650 :   Node* Uint64LessThan(Node* a, Node* b) {
     455       83300 :     return AddNode(machine()->Uint64LessThan(), a, b);
     456             :   }
     457       41862 :   Node* Uint64LessThanOrEqual(Node* a, Node* b) {
     458       83724 :     return AddNode(machine()->Uint64LessThanOrEqual(), a, b);
     459             :   }
     460       27125 :   Node* Int64GreaterThan(Node* a, Node* b) { return Int64LessThan(b, a); }
     461             :   Node* Int64GreaterThanOrEqual(Node* a, Node* b) {
     462        5915 :     return Int64LessThanOrEqual(b, a);
     463             :   }
     464        4144 :   Node* Uint64GreaterThan(Node* a, Node* b) { return Uint64LessThan(b, a); }
     465             :   Node* Uint64GreaterThanOrEqual(Node* a, Node* b) {
     466       28537 :     return Uint64LessThanOrEqual(b, a);
     467             :   }
     468             :   Node* Uint64Div(Node* a, Node* b) {
     469             :     return AddNode(machine()->Uint64Div(), a, b);
     470             :   }
     471             :   Node* Uint64Mod(Node* a, Node* b) {
     472             :     return AddNode(machine()->Uint64Mod(), a, b);
     473             :   }
     474             :   Node* Int32PairAdd(Node* a_low, Node* a_high, Node* b_low, Node* b_high) {
     475             :     return AddNode(machine()->Int32PairAdd(), a_low, a_high, b_low, b_high);
     476             :   }
     477             :   Node* Int32PairSub(Node* a_low, Node* a_high, Node* b_low, Node* b_high) {
     478             :     return AddNode(machine()->Int32PairSub(), a_low, a_high, b_low, b_high);
     479             :   }
     480             :   Node* Int32PairMul(Node* a_low, Node* a_high, Node* b_low, Node* b_high) {
     481             :     return AddNode(machine()->Int32PairMul(), a_low, a_high, b_low, b_high);
     482             :   }
     483             :   Node* Word32PairShl(Node* low_word, Node* high_word, Node* shift) {
     484             :     return AddNode(machine()->Word32PairShl(), low_word, high_word, shift);
     485             :   }
     486             :   Node* Word32PairShr(Node* low_word, Node* high_word, Node* shift) {
     487             :     return AddNode(machine()->Word32PairShr(), low_word, high_word, shift);
     488             :   }
     489             :   Node* Word32PairSar(Node* low_word, Node* high_word, Node* shift) {
     490             :     return AddNode(machine()->Word32PairSar(), low_word, high_word, shift);
     491             :   }
     492             : 
     493             : #define INTPTR_BINOP(prefix, name)                           \
     494             :   Node* IntPtr##name(Node* a, Node* b) {                     \
     495             :     return kSystemPointerSize == 8 ? prefix##64##name(a, b)  \
     496             :                                    : prefix##32##name(a, b); \
     497             :   }
     498             : 
     499      616646 :   INTPTR_BINOP(Int, Add);
     500        4765 :   INTPTR_BINOP(Int, AddWithOverflow);
     501      100591 :   INTPTR_BINOP(Int, Sub);
     502        2693 :   INTPTR_BINOP(Int, SubWithOverflow);
     503       34355 :   INTPTR_BINOP(Int, Mul);
     504         449 :   INTPTR_BINOP(Int, Div);
     505       19028 :   INTPTR_BINOP(Int, LessThan);
     506       10303 :   INTPTR_BINOP(Int, LessThanOrEqual);
     507        7396 :   INTPTR_BINOP(Word, Equal);
     508          30 :   INTPTR_BINOP(Word, NotEqual);
     509             :   INTPTR_BINOP(Int, GreaterThanOrEqual);
     510             :   INTPTR_BINOP(Int, GreaterThan);
     511             : 
     512             : #undef INTPTR_BINOP
     513             : 
     514             : #define UINTPTR_BINOP(prefix, name)                          \
     515             :   Node* UintPtr##name(Node* a, Node* b) {                    \
     516             :     return kSystemPointerSize == 8 ? prefix##64##name(a, b)  \
     517             :                                    : prefix##32##name(a, b); \
     518             :   }
     519             : 
     520       37506 :   UINTPTR_BINOP(Uint, LessThan);
     521       13325 :   UINTPTR_BINOP(Uint, LessThanOrEqual);
     522             :   UINTPTR_BINOP(Uint, GreaterThanOrEqual);
     523             :   UINTPTR_BINOP(Uint, GreaterThan);
     524             : 
     525             : #undef UINTPTR_BINOP
     526             : 
     527           0 :   Node* Int32AbsWithOverflow(Node* a) {
     528           0 :     return AddNode(machine()->Int32AbsWithOverflow().op(), a);
     529             :   }
     530             : 
     531           0 :   Node* Int64AbsWithOverflow(Node* a) {
     532           0 :     return AddNode(machine()->Int64AbsWithOverflow().op(), a);
     533             :   }
     534             : 
     535             :   Node* IntPtrAbsWithOverflow(Node* a) {
     536             :     return kSystemPointerSize == 8 ? Int64AbsWithOverflow(a)
     537           0 :                                    : Int32AbsWithOverflow(a);
     538             :   }
     539             : 
     540        1585 :   Node* Float32Add(Node* a, Node* b) {
     541        3170 :     return AddNode(machine()->Float32Add(), a, b);
     542             :   }
     543        2820 :   Node* Float32Sub(Node* a, Node* b) {
     544        5640 :     return AddNode(machine()->Float32Sub(), a, b);
     545             :   }
     546         580 :   Node* Float32Mul(Node* a, Node* b) {
     547        1160 :     return AddNode(machine()->Float32Mul(), a, b);
     548             :   }
     549          10 :   Node* Float32Div(Node* a, Node* b) {
     550          20 :     return AddNode(machine()->Float32Div(), a, b);
     551             :   }
     552          14 :   Node* Float32Abs(Node* a) { return AddNode(machine()->Float32Abs(), a); }
     553             :   Node* Float32Neg(Node* a) { return AddNode(machine()->Float32Neg(), a); }
     554             :   Node* Float32Sqrt(Node* a) { return AddNode(machine()->Float32Sqrt(), a); }
     555           0 :   Node* Float32Equal(Node* a, Node* b) {
     556           0 :     return AddNode(machine()->Float32Equal(), a, b);
     557             :   }
     558             :   Node* Float32NotEqual(Node* a, Node* b) {
     559             :     return Word32BinaryNot(Float32Equal(a, b));
     560             :   }
     561           5 :   Node* Float32LessThan(Node* a, Node* b) {
     562          10 :     return AddNode(machine()->Float32LessThan(), a, b);
     563             :   }
     564           0 :   Node* Float32LessThanOrEqual(Node* a, Node* b) {
     565           0 :     return AddNode(machine()->Float32LessThanOrEqual(), a, b);
     566             :   }
     567           0 :   Node* Float32GreaterThan(Node* a, Node* b) { return Float32LessThan(b, a); }
     568             :   Node* Float32GreaterThanOrEqual(Node* a, Node* b) {
     569           0 :     return Float32LessThanOrEqual(b, a);
     570             :   }
     571           5 :   Node* Float32Max(Node* a, Node* b) {
     572          10 :     return AddNode(machine()->Float32Max(), a, b);
     573             :   }
     574           5 :   Node* Float32Min(Node* a, Node* b) {
     575          10 :     return AddNode(machine()->Float32Min(), a, b);
     576             :   }
     577        7322 :   Node* Float64Add(Node* a, Node* b) {
     578       14644 :     return AddNode(machine()->Float64Add(), a, b);
     579             :   }
     580        5156 :   Node* Float64Sub(Node* a, Node* b) {
     581       10312 :     return AddNode(machine()->Float64Sub(), a, b);
     582             :   }
     583        2380 :   Node* Float64Mul(Node* a, Node* b) {
     584        4760 :     return AddNode(machine()->Float64Mul(), a, b);
     585             :   }
     586         740 :   Node* Float64Div(Node* a, Node* b) {
     587        1480 :     return AddNode(machine()->Float64Div(), a, b);
     588             :   }
     589         531 :   Node* Float64Mod(Node* a, Node* b) {
     590        1062 :     return AddNode(machine()->Float64Mod(), a, b);
     591             :   }
     592          66 :   Node* Float64Max(Node* a, Node* b) {
     593         132 :     return AddNode(machine()->Float64Max(), a, b);
     594             :   }
     595          66 :   Node* Float64Min(Node* a, Node* b) {
     596         132 :     return AddNode(machine()->Float64Min(), a, b);
     597             :   }
     598       15358 :   Node* Float64Abs(Node* a) { return AddNode(machine()->Float64Abs(), a); }
     599         404 :   Node* Float64Neg(Node* a) { return AddNode(machine()->Float64Neg(), a); }
     600         122 :   Node* Float64Acos(Node* a) { return AddNode(machine()->Float64Acos(), a); }
     601         122 :   Node* Float64Acosh(Node* a) { return AddNode(machine()->Float64Acosh(), a); }
     602         122 :   Node* Float64Asin(Node* a) { return AddNode(machine()->Float64Asin(), a); }
     603         122 :   Node* Float64Asinh(Node* a) { return AddNode(machine()->Float64Asinh(), a); }
     604         122 :   Node* Float64Atan(Node* a) { return AddNode(machine()->Float64Atan(), a); }
     605         122 :   Node* Float64Atanh(Node* a) { return AddNode(machine()->Float64Atanh(), a); }
     606          61 :   Node* Float64Atan2(Node* a, Node* b) {
     607         122 :     return AddNode(machine()->Float64Atan2(), a, b);
     608             :   }
     609         122 :   Node* Float64Cbrt(Node* a) { return AddNode(machine()->Float64Cbrt(), a); }
     610         122 :   Node* Float64Cos(Node* a) { return AddNode(machine()->Float64Cos(), a); }
     611         122 :   Node* Float64Cosh(Node* a) { return AddNode(machine()->Float64Cosh(), a); }
     612         122 :   Node* Float64Exp(Node* a) { return AddNode(machine()->Float64Exp(), a); }
     613         122 :   Node* Float64Expm1(Node* a) { return AddNode(machine()->Float64Expm1(), a); }
     614         122 :   Node* Float64Log(Node* a) { return AddNode(machine()->Float64Log(), a); }
     615         122 :   Node* Float64Log1p(Node* a) { return AddNode(machine()->Float64Log1p(), a); }
     616         122 :   Node* Float64Log10(Node* a) { return AddNode(machine()->Float64Log10(), a); }
     617         122 :   Node* Float64Log2(Node* a) { return AddNode(machine()->Float64Log2(), a); }
     618         112 :   Node* Float64Pow(Node* a, Node* b) {
     619         224 :     return AddNode(machine()->Float64Pow(), a, b);
     620             :   }
     621         122 :   Node* Float64Sin(Node* a) { return AddNode(machine()->Float64Sin(), a); }
     622         122 :   Node* Float64Sinh(Node* a) { return AddNode(machine()->Float64Sinh(), a); }
     623         112 :   Node* Float64Sqrt(Node* a) { return AddNode(machine()->Float64Sqrt(), a); }
     624         122 :   Node* Float64Tan(Node* a) { return AddNode(machine()->Float64Tan(), a); }
     625         122 :   Node* Float64Tanh(Node* a) { return AddNode(machine()->Float64Tanh(), a); }
     626       22624 :   Node* Float64Equal(Node* a, Node* b) {
     627       45248 :     return AddNode(machine()->Float64Equal(), a, b);
     628             :   }
     629         752 :   Node* Float64NotEqual(Node* a, Node* b) {
     630         752 :     return Word32BinaryNot(Float64Equal(a, b));
     631             :   }
     632       15532 :   Node* Float64LessThan(Node* a, Node* b) {
     633       31064 :     return AddNode(machine()->Float64LessThan(), a, b);
     634             :   }
     635        5256 :   Node* Float64LessThanOrEqual(Node* a, Node* b) {
     636       10512 :     return AddNode(machine()->Float64LessThanOrEqual(), a, b);
     637             :   }
     638        3808 :   Node* Float64GreaterThan(Node* a, Node* b) { return Float64LessThan(b, a); }
     639             :   Node* Float64GreaterThanOrEqual(Node* a, Node* b) {
     640        3703 :     return Float64LessThanOrEqual(b, a);
     641             :   }
     642             : 
     643             :   // Conversions.
     644      677116 :   Node* BitcastTaggedToWord(Node* a) {
     645     1354232 :       return AddNode(machine()->BitcastTaggedToWord(), a);
     646             :   }
     647       26325 :   Node* BitcastMaybeObjectToWord(Node* a) {
     648       52650 :       return AddNode(machine()->BitcastMaybeObjectToWord(), a);
     649             :   }
     650       22286 :   Node* BitcastWordToTagged(Node* a) {
     651       44572 :     return AddNode(machine()->BitcastWordToTagged(), a);
     652             :   }
     653      494828 :   Node* BitcastWordToTaggedSigned(Node* a) {
     654      989656 :       return AddNode(machine()->BitcastWordToTaggedSigned(), a);
     655             :   }
     656        8477 :   Node* TruncateFloat64ToWord32(Node* a) {
     657       16954 :     return AddNode(machine()->TruncateFloat64ToWord32(), a);
     658             :   }
     659        2887 :   Node* ChangeFloat32ToFloat64(Node* a) {
     660        5774 :     return AddNode(machine()->ChangeFloat32ToFloat64(), a);
     661             :   }
     662       60493 :   Node* ChangeInt32ToFloat64(Node* a) {
     663      120986 :     return AddNode(machine()->ChangeInt32ToFloat64(), a);
     664             :   }
     665           5 :   Node* ChangeInt64ToFloat64(Node* a) {
     666          10 :     return AddNode(machine()->ChangeInt64ToFloat64(), a);
     667             :   }
     668        5000 :   Node* ChangeUint32ToFloat64(Node* a) {
     669       10000 :     return AddNode(machine()->ChangeUint32ToFloat64(), a);
     670             :   }
     671          25 :   Node* ChangeFloat64ToInt32(Node* a) {
     672          50 :     return AddNode(machine()->ChangeFloat64ToInt32(), a);
     673             :   }
     674           5 :   Node* ChangeFloat64ToInt64(Node* a) {
     675          10 :     return AddNode(machine()->ChangeFloat64ToInt64(), a);
     676             :   }
     677         122 :   Node* ChangeFloat64ToUint32(Node* a) {
     678         244 :     return AddNode(machine()->ChangeFloat64ToUint32(), a);
     679             :   }
     680        1904 :   Node* ChangeFloat64ToUint64(Node* a) {
     681        3808 :     return AddNode(machine()->ChangeFloat64ToUint64(), a);
     682             :   }
     683             :   Node* TruncateFloat64ToUint32(Node* a) {
     684             :     return AddNode(machine()->TruncateFloat64ToUint32(), a);
     685             :   }
     686         285 :   Node* TruncateFloat32ToInt32(Node* a) {
     687         570 :     return AddNode(machine()->TruncateFloat32ToInt32(), a);
     688             :   }
     689           5 :   Node* TruncateFloat32ToUint32(Node* a) {
     690          10 :     return AddNode(machine()->TruncateFloat32ToUint32(), a);
     691             :   }
     692          10 :   Node* TryTruncateFloat32ToInt64(Node* a) {
     693          20 :     return AddNode(machine()->TryTruncateFloat32ToInt64(), a);
     694             :   }
     695          10 :   Node* TryTruncateFloat64ToInt64(Node* a) {
     696          20 :     return AddNode(machine()->TryTruncateFloat64ToInt64(), a);
     697             :   }
     698          10 :   Node* TryTruncateFloat32ToUint64(Node* a) {
     699          20 :     return AddNode(machine()->TryTruncateFloat32ToUint64(), a);
     700             :   }
     701          10 :   Node* TryTruncateFloat64ToUint64(Node* a) {
     702          20 :     return AddNode(machine()->TryTruncateFloat64ToUint64(), a);
     703             :   }
     704       98463 :   Node* ChangeInt32ToInt64(Node* a) {
     705      196926 :     return AddNode(machine()->ChangeInt32ToInt64(), a);
     706             :   }
     707      114172 :   Node* ChangeUint32ToUint64(Node* a) {
     708      228344 :     return AddNode(machine()->ChangeUint32ToUint64(), a);
     709             :   }
     710        2546 :   Node* TruncateFloat64ToFloat32(Node* a) {
     711        5092 :     return AddNode(machine()->TruncateFloat64ToFloat32(), a);
     712             :   }
     713      152623 :   Node* TruncateInt64ToInt32(Node* a) {
     714      305246 :     return AddNode(machine()->TruncateInt64ToInt32(), a);
     715             :   }
     716       13745 :   Node* RoundFloat64ToInt32(Node* a) {
     717       27490 :     return AddNode(machine()->RoundFloat64ToInt32(), a);
     718             :   }
     719         397 :   Node* RoundInt32ToFloat32(Node* a) {
     720         794 :     return AddNode(machine()->RoundInt32ToFloat32(), a);
     721             :   }
     722           5 :   Node* RoundInt64ToFloat32(Node* a) {
     723          10 :     return AddNode(machine()->RoundInt64ToFloat32(), a);
     724             :   }
     725        1191 :   Node* RoundInt64ToFloat64(Node* a) {
     726        2382 :     return AddNode(machine()->RoundInt64ToFloat64(), a);
     727             :   }
     728           5 :   Node* RoundUint32ToFloat32(Node* a) {
     729          10 :     return AddNode(machine()->RoundUint32ToFloat32(), a);
     730             :   }
     731           5 :   Node* RoundUint64ToFloat32(Node* a) {
     732          10 :     return AddNode(machine()->RoundUint64ToFloat32(), a);
     733             :   }
     734        1741 :   Node* RoundUint64ToFloat64(Node* a) {
     735        3482 :     return AddNode(machine()->RoundUint64ToFloat64(), a);
     736             :   }
     737          61 :   Node* BitcastFloat32ToInt32(Node* a) {
     738         122 :     return AddNode(machine()->BitcastFloat32ToInt32(), a);
     739             :   }
     740           5 :   Node* BitcastFloat64ToInt64(Node* a) {
     741          10 :     return AddNode(machine()->BitcastFloat64ToInt64(), a);
     742             :   }
     743          61 :   Node* BitcastInt32ToFloat32(Node* a) {
     744         122 :     return AddNode(machine()->BitcastInt32ToFloat32(), a);
     745             :   }
     746           5 :   Node* BitcastInt64ToFloat64(Node* a) {
     747          10 :     return AddNode(machine()->BitcastInt64ToFloat64(), a);
     748             :   }
     749           5 :   Node* Float32RoundDown(Node* a) {
     750          10 :     return AddNode(machine()->Float32RoundDown().op(), a);
     751             :   }
     752         120 :   Node* Float64RoundDown(Node* a) {
     753         240 :     return AddNode(machine()->Float64RoundDown().op(), a);
     754             :   }
     755           5 :   Node* Float32RoundUp(Node* a) {
     756          10 :     return AddNode(machine()->Float32RoundUp().op(), a);
     757             :   }
     758         115 :   Node* Float64RoundUp(Node* a) {
     759         230 :     return AddNode(machine()->Float64RoundUp().op(), a);
     760             :   }
     761           5 :   Node* Float32RoundTruncate(Node* a) {
     762          10 :     return AddNode(machine()->Float32RoundTruncate().op(), a);
     763             :   }
     764         340 :   Node* Float64RoundTruncate(Node* a) {
     765         680 :     return AddNode(machine()->Float64RoundTruncate().op(), a);
     766             :   }
     767           0 :   Node* Float64RoundTiesAway(Node* a) {
     768           0 :     return AddNode(machine()->Float64RoundTiesAway().op(), a);
     769             :   }
     770           5 :   Node* Float32RoundTiesEven(Node* a) {
     771          10 :     return AddNode(machine()->Float32RoundTiesEven().op(), a);
     772             :   }
     773         390 :   Node* Float64RoundTiesEven(Node* a) {
     774         780 :     return AddNode(machine()->Float64RoundTiesEven().op(), a);
     775             :   }
     776             :   Node* Word32ReverseBytes(Node* a) {
     777             :     return AddNode(machine()->Word32ReverseBytes(), a);
     778             :   }
     779             :   Node* Word64ReverseBytes(Node* a) {
     780             :     return AddNode(machine()->Word64ReverseBytes(), a);
     781             :   }
     782             : 
     783             :   // Float64 bit operations.
     784          61 :   Node* Float64ExtractLowWord32(Node* a) {
     785         122 :     return AddNode(machine()->Float64ExtractLowWord32(), a);
     786             :   }
     787        5457 :   Node* Float64ExtractHighWord32(Node* a) {
     788       10914 :     return AddNode(machine()->Float64ExtractHighWord32(), a);
     789             :   }
     790          61 :   Node* Float64InsertLowWord32(Node* a, Node* b) {
     791         122 :     return AddNode(machine()->Float64InsertLowWord32(), a, b);
     792             :   }
     793          61 :   Node* Float64InsertHighWord32(Node* a, Node* b) {
     794         122 :     return AddNode(machine()->Float64InsertHighWord32(), a, b);
     795             :   }
     796        2647 :   Node* Float64SilenceNaN(Node* a) {
     797        5294 :     return AddNode(machine()->Float64SilenceNaN(), a);
     798             :   }
     799             : 
     800             :   // Stack operations.
     801       38308 :   Node* LoadStackPointer() { return AddNode(machine()->LoadStackPointer()); }
     802       14038 :   Node* LoadFramePointer() { return AddNode(machine()->LoadFramePointer()); }
     803       28501 :   Node* LoadParentFramePointer() {
     804       57002 :     return AddNode(machine()->LoadParentFramePointer());
     805             :   }
     806             : 
     807             :   // Parameters.
     808             :   Node* TargetParameter();
     809             :   Node* Parameter(size_t index);
     810             : 
     811             :   // Pointer utilities.
     812        7755 :   Node* LoadFromPointer(void* address, MachineType rep, int32_t offset = 0) {
     813       15510 :     return Load(rep, PointerConstant(address), Int32Constant(offset));
     814             :   }
     815      129925 :   Node* StoreToPointer(void* address, MachineRepresentation rep, Node* node) {
     816      129925 :     return Store(rep, PointerConstant(address), node, kNoWriteBarrier);
     817             :   }
     818          95 :   Node* UnalignedLoadFromPointer(void* address, MachineType rep,
     819             :                                  int32_t offset = 0) {
     820         190 :     return UnalignedLoad(rep, PointerConstant(address), Int32Constant(offset));
     821             :   }
     822          40 :   Node* UnalignedStoreToPointer(void* address, MachineRepresentation rep,
     823             :                                 Node* node) {
     824          40 :     return UnalignedStore(rep, PointerConstant(address), node);
     825             :   }
     826          55 :   Node* StringConstant(const char* string) {
     827         110 :     return HeapConstant(isolate()->factory()->InternalizeUtf8String(string));
     828             :   }
     829             : 
     830       19112 :   Node* TaggedPoisonOnSpeculation(Node* value) {
     831       19112 :     if (poisoning_level_ != PoisoningMitigationLevel::kDontPoison) {
     832        1712 :       return AddNode(machine()->TaggedPoisonOnSpeculation(), value);
     833             :     }
     834             :     return value;
     835             :   }
     836             : 
     837       46536 :   Node* WordPoisonOnSpeculation(Node* value) {
     838       46536 :     if (poisoning_level_ != PoisoningMitigationLevel::kDontPoison) {
     839           0 :       return AddNode(machine()->WordPoisonOnSpeculation(), value);
     840             :     }
     841             :     return value;
     842             :   }
     843             : 
     844             :   // Call a given call descriptor and the given arguments.
     845             :   // The call target is passed as part of the {inputs} array.
     846             :   Node* CallN(CallDescriptor* call_descriptor, int input_count,
     847             :               Node* const* inputs);
     848             : 
     849             :   // Call a given call descriptor and the given arguments and frame-state.
     850             :   // The call target and frame state are passed as part of the {inputs} array.
     851             :   Node* CallNWithFrameState(CallDescriptor* call_descriptor, int input_count,
     852             :                             Node* const* inputs);
     853             : 
     854             :   // Tail call a given call descriptor and the given arguments.
     855             :   // The call target is passed as part of the {inputs} array.
     856             :   Node* TailCallN(CallDescriptor* call_descriptor, int input_count,
     857             :                   Node* const* inputs);
     858             : 
     859             :   // Call to a C function with zero arguments.
     860             :   Node* CallCFunction0(MachineType return_type, Node* function);
     861             :   // Call to a C function with one parameter.
     862             :   Node* CallCFunction1(MachineType return_type, MachineType arg0_type,
     863             :                        Node* function, Node* arg0);
     864             :   // Call to a C function with one argument, while saving/restoring caller
     865             :   // registers.
     866             :   Node* CallCFunction1WithCallerSavedRegisters(
     867             :       MachineType return_type, MachineType arg0_type, Node* function,
     868             :       Node* arg0, SaveFPRegsMode mode = kSaveFPRegs);
     869             :   // Call to a C function with two arguments.
     870             :   Node* CallCFunction2(MachineType return_type, MachineType arg0_type,
     871             :                        MachineType arg1_type, Node* function, Node* arg0,
     872             :                        Node* arg1);
     873             :   // Call to a C function with three arguments.
     874             :   Node* CallCFunction3(MachineType return_type, MachineType arg0_type,
     875             :                        MachineType arg1_type, MachineType arg2_type,
     876             :                        Node* function, Node* arg0, Node* arg1, Node* arg2);
     877             :   // Call to a C function with three arguments, while saving/restoring caller
     878             :   // registers.
     879             :   Node* CallCFunction3WithCallerSavedRegisters(
     880             :       MachineType return_type, MachineType arg0_type, MachineType arg1_type,
     881             :       MachineType arg2_type, Node* function, Node* arg0, Node* arg1, Node* arg2,
     882             :       SaveFPRegsMode mode = kSaveFPRegs);
     883             :   // Call to a C function with four arguments.
     884             :   Node* CallCFunction4(MachineType return_type, MachineType arg0_type,
     885             :                        MachineType arg1_type, MachineType arg2_type,
     886             :                        MachineType arg3_type, Node* function, Node* arg0,
     887             :                        Node* arg1, Node* arg2, Node* arg3);
     888             :   // Call to a C function with five arguments.
     889             :   Node* CallCFunction5(MachineType return_type, MachineType arg0_type,
     890             :                        MachineType arg1_type, MachineType arg2_type,
     891             :                        MachineType arg3_type, MachineType arg4_type,
     892             :                        Node* function, Node* arg0, Node* arg1, Node* arg2,
     893             :                        Node* arg3, Node* arg4);
     894             :   // Call to a C function with six arguments.
     895             :   Node* CallCFunction6(MachineType return_type, MachineType arg0_type,
     896             :                        MachineType arg1_type, MachineType arg2_type,
     897             :                        MachineType arg3_type, MachineType arg4_type,
     898             :                        MachineType arg5_type, Node* function, Node* arg0,
     899             :                        Node* arg1, Node* arg2, Node* arg3, Node* arg4,
     900             :                        Node* arg5);
     901             :   // Call to a C function with eight arguments.
     902             :   Node* CallCFunction8(MachineType return_type, MachineType arg0_type,
     903             :                        MachineType arg1_type, MachineType arg2_type,
     904             :                        MachineType arg3_type, MachineType arg4_type,
     905             :                        MachineType arg5_type, MachineType arg6_type,
     906             :                        MachineType arg7_type, Node* function, Node* arg0,
     907             :                        Node* arg1, Node* arg2, Node* arg3, Node* arg4,
     908             :                        Node* arg5, Node* arg6, Node* arg7);
     909             :   // Call to a C function with nine arguments.
     910             :   Node* CallCFunction9(MachineType return_type, MachineType arg0_type,
     911             :                        MachineType arg1_type, MachineType arg2_type,
     912             :                        MachineType arg3_type, MachineType arg4_type,
     913             :                        MachineType arg5_type, MachineType arg6_type,
     914             :                        MachineType arg7_type, MachineType arg8_type,
     915             :                        Node* function, Node* arg0, Node* arg1, Node* arg2,
     916             :                        Node* arg3, Node* arg4, Node* arg5, Node* arg6,
     917             :                        Node* arg7, Node* arg8);
     918             : 
     919             :   // ===========================================================================
     920             :   // The following utility methods deal with control flow, hence might switch
     921             :   // the current basic block or create new basic blocks for labels.
     922             : 
     923             :   // Control flow.
     924             :   void Goto(RawMachineLabel* label);
     925             :   void Branch(Node* condition, RawMachineLabel* true_val,
     926             :               RawMachineLabel* false_val);
     927             :   void Switch(Node* index, RawMachineLabel* default_label,
     928             :               const int32_t* case_values, RawMachineLabel** case_labels,
     929             :               size_t case_count);
     930             :   void Return(Node* value);
     931             :   void Return(Node* v1, Node* v2);
     932             :   void Return(Node* v1, Node* v2, Node* v3);
     933             :   void Return(Node* v1, Node* v2, Node* v3, Node* v4);
     934             :   void Return(int count, Node* v[]);
     935             :   void PopAndReturn(Node* pop, Node* value);
     936             :   void PopAndReturn(Node* pop, Node* v1, Node* v2);
     937             :   void PopAndReturn(Node* pop, Node* v1, Node* v2, Node* v3);
     938             :   void PopAndReturn(Node* pop, Node* v1, Node* v2, Node* v3, Node* v4);
     939             :   void Bind(RawMachineLabel* label);
     940             :   void Deoptimize(Node* state);
     941             :   void DebugAbort(Node* message);
     942             :   void DebugBreak();
     943             :   void Unreachable();
     944             :   void Comment(std::string msg);
     945             : 
     946             : #if DEBUG
     947             :   void Bind(RawMachineLabel* label, AssemblerDebugInfo info);
     948             :   void SetInitialDebugInformation(AssemblerDebugInfo info);
     949             :   void PrintCurrentBlock(std::ostream& os);
     950             : #endif  // DEBUG
     951             :   bool InsideBlock();
     952             : 
     953             :   // Add success / exception successor blocks and ends the current block ending
     954             :   // in a potentially throwing call node.
     955             :   void Continuations(Node* call, RawMachineLabel* if_success,
     956             :                      RawMachineLabel* if_exception);
     957             : 
     958             :   // Variables.
     959         192 :   Node* Phi(MachineRepresentation rep, Node* n1, Node* n2) {
     960         384 :     return AddNode(common()->Phi(rep, 2), n1, n2, graph()->start());
     961             :   }
     962             :   Node* Phi(MachineRepresentation rep, Node* n1, Node* n2, Node* n3) {
     963             :     return AddNode(common()->Phi(rep, 3), n1, n2, n3, graph()->start());
     964             :   }
     965             :   Node* Phi(MachineRepresentation rep, Node* n1, Node* n2, Node* n3, Node* n4) {
     966             :     return AddNode(common()->Phi(rep, 4), n1, n2, n3, n4, graph()->start());
     967             :   }
     968             :   Node* Phi(MachineRepresentation rep, int input_count, Node* const* inputs);
     969             :   void AppendPhiInput(Node* phi, Node* new_input);
     970             : 
     971             :   // ===========================================================================
     972             :   // The following generic node creation methods can be used for operators that
     973             :   // are not covered by the above utility methods. There should rarely be a need
     974             :   // to do that outside of testing though.
     975             : 
     976             :   Node* AddNode(const Operator* op, int input_count, Node* const* inputs);
     977             : 
     978             :   Node* AddNode(const Operator* op) {
     979     7410943 :     return AddNode(op, 0, static_cast<Node* const*>(nullptr));
     980             :   }
     981             : 
     982             :   template <class... TArgs>
     983             :   Node* AddNode(const Operator* op, Node* n1, TArgs... args) {
     984     8684038 :     Node* buffer[] = {n1, args...};
     985     8684038 :     return AddNode(op, sizeof...(args) + 1, buffer);
     986             :   }
     987             : 
     988             :  private:
     989             :   Node* MakeNode(const Operator* op, int input_count, Node* const* inputs);
     990             :   BasicBlock* Use(RawMachineLabel* label);
     991             :   BasicBlock* EnsureBlock(RawMachineLabel* label);
     992             :   BasicBlock* CurrentBlock();
     993             : 
     994             :   // A post-processing pass to add effect and control edges so that the graph
     995             :   // can be optimized and re-scheduled.
     996             :   // TODO(tebbi): Move this to a separate class.
     997             :   void MakeReschedulable();
     998             :   Node* CreateNodeFromPredecessors(const std::vector<BasicBlock*>& predecessors,
     999             :                                    const std::vector<Node*>& sidetable,
    1000             :                                    const Operator* op,
    1001             :                                    const std::vector<Node*>& additional_inputs);
    1002             :   void MakePhiBinary(Node* phi, int split_point, Node* left_control,
    1003             :                      Node* right_control);
    1004             :   void MarkControlDeferred(Node* control_input);
    1005             : 
    1006             :   Schedule* schedule() { return schedule_; }
    1007     1446700 :   size_t parameter_count() const { return call_descriptor_->ParameterCount(); }
    1008             : 
    1009             :   Isolate* isolate_;
    1010             :   Graph* graph_;
    1011             :   Schedule* schedule_;
    1012             :   MachineOperatorBuilder machine_;
    1013             :   CommonOperatorBuilder common_;
    1014             :   SimplifiedOperatorBuilder simplified_;
    1015             :   CallDescriptor* call_descriptor_;
    1016             :   Node* target_parameter_;
    1017             :   NodeVector parameters_;
    1018             :   BasicBlock* current_block_;
    1019             :   PoisoningMitigationLevel poisoning_level_;
    1020             : 
    1021             :   DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler);
    1022             : };
    1023             : 
    1024             : class V8_EXPORT_PRIVATE RawMachineLabel final {
    1025             :  public:
    1026             :   enum Type { kDeferred, kNonDeferred };
    1027             : 
    1028             :   explicit RawMachineLabel(Type type = kNonDeferred)
    1029     3464061 :       : deferred_(type == kDeferred) {}
    1030             :   ~RawMachineLabel();
    1031             : 
    1032             :   BasicBlock* block() const { return block_; }
    1033             : 
    1034             :  private:
    1035             :   BasicBlock* block_ = nullptr;
    1036             :   bool used_ = false;
    1037             :   bool bound_ = false;
    1038             :   bool deferred_;
    1039             :   friend class RawMachineAssembler;
    1040             :   DISALLOW_COPY_AND_ASSIGN(RawMachineLabel);
    1041             : };
    1042             : 
    1043             : }  // namespace compiler
    1044             : }  // namespace internal
    1045             : }  // namespace v8
    1046             : 
    1047             : #endif  // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_

Generated by: LCOV version 1.10