blob: e7ecd931ea8c3d6961f17d4b07d40cb1c4c2eeeb [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// Copyright 2013 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_OPERATOR_PROPERTIES_H_
6#define V8_COMPILER_OPERATOR_PROPERTIES_H_
7
Emily Bernierd0a1eb72015-03-24 16:35:39 -04008#include "src/base/macros.h"
9
Ben Murdochb8a8cc12014-11-26 15:28:44 +000010namespace v8 {
11namespace internal {
12namespace compiler {
13
Emily Bernierd0a1eb72015-03-24 16:35:39 -040014// Forward declarations.
Ben Murdochb8a8cc12014-11-26 15:28:44 +000015class Operator;
16
Emily Bernierd0a1eb72015-03-24 16:35:39 -040017
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000018class OperatorProperties final {
Ben Murdochb8a8cc12014-11-26 15:28:44 +000019 public:
Emily Bernierd0a1eb72015-03-24 16:35:39 -040020 static bool HasContextInput(const Operator* op);
Emily Bernierd0a1eb72015-03-24 16:35:39 -040021 static int GetContextInputCount(const Operator* op) {
22 return HasContextInput(op) ? 1 : 0;
23 }
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000024 static int GetFrameStateInputCount(const Operator* op);
25
Emily Bernierd0a1eb72015-03-24 16:35:39 -040026 static int GetTotalInputCount(const Operator* op);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000027
Emily Bernierd0a1eb72015-03-24 16:35:39 -040028 static bool IsBasicBlockBegin(const Operator* op);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000029
Emily Bernierd0a1eb72015-03-24 16:35:39 -040030 private:
31 DISALLOW_COPY_AND_ASSIGN(OperatorProperties);
Ben Murdochb8a8cc12014-11-26 15:28:44 +000032};
33
34} // namespace compiler
35} // namespace internal
36} // namespace v8
37
38#endif // V8_COMPILER_OPERATOR_PROPERTIES_H_