• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 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 
8 #include "src/base/macros.h"
9 #include "src/common/globals.h"
10 
11 namespace v8 {
12 namespace internal {
13 namespace compiler {
14 
15 // Forward declarations.
16 class Operator;
17 
18 class V8_EXPORT_PRIVATE OperatorProperties final {
19  public:
20   OperatorProperties(const OperatorProperties&) = delete;
21   OperatorProperties& operator=(const OperatorProperties&) = delete;
22 
23   static bool HasContextInput(const Operator* op);
GetContextInputCount(const Operator * op)24   static int GetContextInputCount(const Operator* op) {
25     return HasContextInput(op) ? 1 : 0;
26   }
27 
28   static bool NeedsExactContext(const Operator* op);
29 
30   static bool HasFrameStateInput(const Operator* op);
GetFrameStateInputCount(const Operator * op)31   static int GetFrameStateInputCount(const Operator* op) {
32     return HasFrameStateInput(op) ? 1 : 0;
33   }
34 
35   static int GetTotalInputCount(const Operator* op);
36 
37   static bool IsBasicBlockBegin(const Operator* op);
38 };
39 
40 }  // namespace compiler
41 }  // namespace internal
42 }  // namespace v8
43 
44 #endif  // V8_COMPILER_OPERATOR_PROPERTIES_H_
45