11cb0ef41Sopenharmony_ci// Copyright 2014 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#ifndef V8_COMPILER_SELECT_LOWERING_H_ 61cb0ef41Sopenharmony_ci#define V8_COMPILER_SELECT_LOWERING_H_ 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci#include "src/compiler/graph-reducer.h" 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_cinamespace v8 { 111cb0ef41Sopenharmony_cinamespace internal { 121cb0ef41Sopenharmony_cinamespace compiler { 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci// Forward declarations. 151cb0ef41Sopenharmony_ciclass JSGraphAssembler; 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ci// Lowers Select nodes to diamonds. 181cb0ef41Sopenharmony_ciclass SelectLowering final : public Reducer { 191cb0ef41Sopenharmony_ci public: 201cb0ef41Sopenharmony_ci SelectLowering(JSGraphAssembler* graph_assembler, Graph* graph); 211cb0ef41Sopenharmony_ci ~SelectLowering() override; 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci const char* reducer_name() const override { return "SelectLowering"; } 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci Reduction Reduce(Node* node) override; 261cb0ef41Sopenharmony_ci 271cb0ef41Sopenharmony_ci private: 281cb0ef41Sopenharmony_ci Reduction LowerSelect(Node* node); 291cb0ef41Sopenharmony_ci 301cb0ef41Sopenharmony_ci JSGraphAssembler* gasm() const { return graph_assembler_; } 311cb0ef41Sopenharmony_ci Node* start() const { return start_; } 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ci JSGraphAssembler* graph_assembler_; 341cb0ef41Sopenharmony_ci Node* start_; 351cb0ef41Sopenharmony_ci}; 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci} // namespace compiler 381cb0ef41Sopenharmony_ci} // namespace internal 391cb0ef41Sopenharmony_ci} // namespace v8 401cb0ef41Sopenharmony_ci 411cb0ef41Sopenharmony_ci#endif // V8_COMPILER_SELECT_LOWERING_H_ 42