summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/operator-properties.h
blob: 47db81df9889431792d94f13991e2fab85671211 (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
// Copyright 2013 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_OPERATOR_PROPERTIES_H_
#define V8_COMPILER_OPERATOR_PROPERTIES_H_

#include "src/base/macros.h"
#include "src/common/globals.h"

namespace v8 {
namespace internal {
namespace compiler {

// Forward declarations.
class Operator;

class V8_EXPORT_PRIVATE OperatorProperties final {
 public:
  static bool HasContextInput(const Operator* op);
  static int GetContextInputCount(const Operator* op) {
    return HasContextInput(op) ? 1 : 0;
  }

  static bool NeedsExactContext(const Operator* op);

  static bool HasFrameStateInput(const Operator* op);
  static int GetFrameStateInputCount(const Operator* op) {
    return HasFrameStateInput(op) ? 1 : 0;
  }

  static int GetTotalInputCount(const Operator* op);

  static bool IsBasicBlockBegin(const Operator* op);

 private:
  DISALLOW_COPY_AND_ASSIGN(OperatorProperties);
};

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

#endif  // V8_COMPILER_OPERATOR_PROPERTIES_H_