OLD | NEW |
(Empty) | |
| 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 bool HasValueInput(Node* node); |
| 23 static inline bool HasContextInput(Node* node); |
| 24 static inline bool HasEffectInput(Node* node); |
| 25 static inline bool HasControlInput(Node* node); |
| 26 |
| 27 static inline int GetValueInputCount(Node* node); |
| 28 static inline int GetContextInputCount(Node* node); |
| 29 static inline int GetEffectInputCount(Node* node); |
| 30 static inline int GetControlInputCount(Node* node); |
| 31 |
| 32 static inline Node* GetValueInput(Node* node, int index); |
| 33 static inline Node* GetContextInput(Node* node); |
| 34 static inline Node* GetEffectInput(Node* node, int index = 0); |
| 35 static inline Node* GetControlInput(Node* node, int index = 0); |
| 36 |
| 37 static inline bool HasValueOutput(Node* node); |
| 38 static inline bool HasEffectOutput(Node* node); |
| 39 static inline bool HasControlOutput(Node* node); |
| 40 |
| 41 static inline int GetValueOutputCount(Node* node); |
| 42 static inline int GetEffectOutputCount(Node* node); |
| 43 static inline int GetControlOutputCount(Node* node); |
| 44 |
| 45 static inline bool IsValueEdge(Node::Edge edge); |
| 46 static inline bool IsContextEdge(Node::Edge edge); |
| 47 static inline bool IsEffectEdge(Node::Edge edge); |
| 48 static inline bool IsControlEdge(Node::Edge edge); |
| 49 |
| 50 static inline bool IsControl(Node* node); |
| 51 static inline bool IsBasicBlockBegin(Node* node); |
| 52 |
| 53 static inline bool CanBeScheduled(Node* node); |
| 54 static inline bool HasFixedSchedulePosition(Node* node); |
| 55 static inline bool IsScheduleRoot(Node* node); |
| 56 |
| 57 static inline void ReplaceEffectInput(Node* node, Node* effect, |
| 58 int index = 0); |
| 59 static inline void RemoveNonValueInputs(Node* node); |
| 60 |
| 61 static inline Bounds GetBounds(Node* node); |
| 62 static inline void SetBounds(Node* node, Bounds bounds); |
| 63 |
| 64 static inline bool CanLazilyDeoptimize(Node* node); |
| 65 |
| 66 private: |
| 67 static inline int FirstValueIndex(Node* node); |
| 68 static inline int FirstContextIndex(Node* node); |
| 69 static inline int FirstEffectIndex(Node* node); |
| 70 static inline int FirstControlIndex(Node* node); |
| 71 static inline int PastValueIndex(Node* node); |
| 72 static inline int PastContextIndex(Node* node); |
| 73 static inline int PastEffectIndex(Node* node); |
| 74 static inline int PastControlIndex(Node* node); |
| 75 |
| 76 static inline bool IsInputRange(Node::Edge edge, int first, int count); |
| 77 }; |
| 78 } |
| 79 } |
| 80 } // namespace v8::internal::compiler |
| 81 |
| 82 #endif // V8_COMPILER_NODE_PROPERTIES_H_ |
OLD | NEW |