1 // Copyright 2019 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_SCHEDULED_MACHINE_LOWERING_H_ 6 #define V8_COMPILER_SCHEDULED_MACHINE_LOWERING_H_ 7 8 #include "src/compiler/graph-assembler.h" 9 #include "src/compiler/memory-lowering.h" 10 #include "src/compiler/select-lowering.h" 11 12 namespace v8 { 13 namespace internal { 14 namespace compiler { 15 16 class NodeOriginTable; 17 class Schedule; 18 class SourcePositionTable; 19 20 // Performs machine lowering on an already scheduled graph. 21 class ScheduledMachineLowering final { 22 public: 23 ScheduledMachineLowering(JSGraph* js_graph, Schedule* schedule, 24 Zone* temp_zone, 25 SourcePositionTable* source_positions, 26 NodeOriginTable* node_origins, 27 PoisoningMitigationLevel poison_level); 28 ~ScheduledMachineLowering() = default; 29 30 void Run(); 31 32 private: 33 bool LowerNode(Node* node); 34 gasm()35 JSGraphAssembler* gasm() { return &graph_assembler_; } schedule()36 Schedule* schedule() { return schedule_; } 37 38 Schedule* schedule_; 39 JSGraphAssembler graph_assembler_; 40 SelectLowering select_lowering_; 41 MemoryLowering memory_lowering_; 42 ZoneVector<Reducer*> reducers_; 43 SourcePositionTable* source_positions_; 44 NodeOriginTable* node_origins_; 45 }; 46 47 } // namespace compiler 48 } // namespace internal 49 } // namespace v8 50 51 #endif // V8_COMPILER_SCHEDULED_MACHINE_LOWERING_H_ 52