blob: ca078a2a5345ac6577ce061f6703d680e6382616 [file] [log] [blame]
Rubin Xu7bc1b612021-02-16 09:38:50 +00001// 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
12namespace v8 {
13namespace internal {
14namespace compiler {
15
16class NodeOriginTable;
17class Schedule;
18class SourcePositionTable;
19
20// Performs machine lowering on an already scheduled graph.
21class 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
35 JSGraphAssembler* gasm() { return &graph_assembler_; }
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_