select-lowering.h 1023 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
// Copyright 2014 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_SELECT_LOWERING_H_
#define V8_COMPILER_SELECT_LOWERING_H_

#include "src/compiler/graph-reducer.h"

namespace v8 {
namespace internal {
namespace compiler {

14
// Forward declarations.
15
class JSGraphAssembler;
16

17
// Lowers Select nodes to diamonds.
18
class SelectLowering final : public Reducer {
19
 public:
20
  SelectLowering(JSGraphAssembler* graph_assembler, Graph* graph);
21
  ~SelectLowering() override;
22

23 24
  const char* reducer_name() const override { return "SelectLowering"; }

25
  Reduction Reduce(Node* node) override;
26 27

 private:
28 29
  Reduction LowerSelect(Node* node);

30
  JSGraphAssembler* gasm() const { return graph_assembler_; }
31
  Node* start() const { return start_; }
32

33
  JSGraphAssembler* graph_assembler_;
34
  Node* start_;
35 36 37 38 39 40 41
};

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

#endif  // V8_COMPILER_SELECT_LOWERING_H_