Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / v8 / src / compiler / node-properties.h
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_NODE_PROPERTIES_H_
6 #define V8_COMPILER_NODE_PROPERTIES_H_
7
8 #include "src/v8.h"
9
10 #include "src/types.h"
11
12 namespace v8 {
13 namespace internal {
14 namespace compiler {
15
16 class Node;
17 class Operator;
18
19 // A facade that simplifies access to the different kinds of inputs to a node.
20 class NodeProperties {
21  public:
22   static inline Node* GetValueInput(Node* node, int index);
23   static inline Node* GetContextInput(Node* node);
24   static inline Node* GetEffectInput(Node* node, int index = 0);
25   static inline Node* GetControlInput(Node* node, int index = 0);
26
27   static inline bool IsValueEdge(Node::Edge edge);
28   static inline bool IsContextEdge(Node::Edge edge);
29   static inline bool IsEffectEdge(Node::Edge edge);
30   static inline bool IsControlEdge(Node::Edge edge);
31
32   static inline bool IsControl(Node* node);
33
34   static inline void ReplaceEffectInput(Node* node, Node* effect,
35                                         int index = 0);
36   static inline void RemoveNonValueInputs(Node* node);
37
38   static inline Bounds GetBounds(Node* node);
39   static inline void SetBounds(Node* node, Bounds bounds);
40
41   static inline int GetContextIndex(Node* node);
42
43   static inline int FirstValueIndex(Node* node);
44   static inline int FirstEffectIndex(Node* node);
45   static inline int FirstControlIndex(Node* node);
46   static inline int PastValueIndex(Node* node);
47   static inline int PastContextIndex(Node* node);
48   static inline int PastEffectIndex(Node* node);
49   static inline int PastControlIndex(Node* node);
50
51   static inline bool IsInputRange(Node::Edge edge, int first, int count);
52 };
53 }
54 }
55 }  // namespace v8::internal::compiler
56
57 #endif  // V8_COMPILER_NODE_PROPERTIES_H_