summaryrefslogtreecommitdiff
path: root/chromium/v8/src/compiler/scheduled-machine-lowering.h
blob: ca078a2a5345ac6577ce061f6703d680e6382616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_COMPILER_SCHEDULED_MACHINE_LOWERING_H_
#define V8_COMPILER_SCHEDULED_MACHINE_LOWERING_H_

#include "src/compiler/graph-assembler.h"
#include "src/compiler/memory-lowering.h"
#include "src/compiler/select-lowering.h"

namespace v8 {
namespace internal {
namespace compiler {

class NodeOriginTable;
class Schedule;
class SourcePositionTable;

// Performs machine lowering on an already scheduled graph.
class ScheduledMachineLowering final {
 public:
  ScheduledMachineLowering(JSGraph* js_graph, Schedule* schedule,
                           Zone* temp_zone,
                           SourcePositionTable* source_positions,
                           NodeOriginTable* node_origins,
                           PoisoningMitigationLevel poison_level);
  ~ScheduledMachineLowering() = default;

  void Run();

 private:
  bool LowerNode(Node* node);

  JSGraphAssembler* gasm() { return &graph_assembler_; }
  Schedule* schedule() { return schedule_; }

  Schedule* schedule_;
  JSGraphAssembler graph_assembler_;
  SelectLowering select_lowering_;
  MemoryLowering memory_lowering_;
  ZoneVector<Reducer*> reducers_;
  SourcePositionTable* source_positions_;
  NodeOriginTable* node_origins_;
};

}  // namespace compiler
}  // namespace internal
}  // namespace v8

#endif  // V8_COMPILER_SCHEDULED_MACHINE_LOWERING_H_