| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_NODE_H_ | 5 #ifndef V8_COMPILER_NODE_H_ |
| 6 #define V8_COMPILER_NODE_H_ | 6 #define V8_COMPILER_NODE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 IrOpcode::Value opcode() const { | 29 IrOpcode::Value opcode() const { |
| 30 DCHECK(op_->opcode() <= IrOpcode::kLast); | 30 DCHECK(op_->opcode() <= IrOpcode::kLast); |
| 31 return static_cast<IrOpcode::Value>(op_->opcode()); | 31 return static_cast<IrOpcode::Value>(op_->opcode()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 Bounds bounds() { return bounds_; } | 34 Bounds bounds() { return bounds_; } |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 Operator* op_; | 37 Operator* op_; |
| 38 Bounds bounds_; | 38 Bounds bounds_; |
| 39 explicit NodeData(Zone* zone) : bounds_(Bounds(Type::None(zone))) {} | 39 explicit NodeData(Zone* zone) {} |
| 40 | 40 |
| 41 friend class NodeProperties; | 41 friend class NodeProperties; |
| 42 void set_bounds(Bounds b) { bounds_ = b; } | 42 void set_bounds(Bounds b) { bounds_ = b; } |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // A Node is the basic primitive of an IR graph. In addition to the members | 45 // A Node is the basic primitive of an IR graph. In addition to the members |
| 46 // inherited from Vector, Nodes only contain a mutable Operator that may change | 46 // inherited from Vector, Nodes only contain a mutable Operator that may change |
| 47 // during compilation, e.g. during lowering passes. Other information that | 47 // during compilation, e.g. during lowering passes. Other information that |
| 48 // needs to be associated with Nodes during compilation must be stored | 48 // needs to be associated with Nodes during compilation must be stored |
| 49 // out-of-line indexed by the Node's id. | 49 // out-of-line indexed by the Node's id. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Helper to extract parameters from Operator1<*> nodes. | 87 // Helper to extract parameters from Operator1<*> nodes. |
| 88 template <typename T> | 88 template <typename T> |
| 89 static inline T OpParameter(Node* node) { | 89 static inline T OpParameter(Node* node) { |
| 90 return reinterpret_cast<Operator1<T>*>(node->op())->parameter(); | 90 return reinterpret_cast<Operator1<T>*>(node->op())->parameter(); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 } // namespace v8::internal::compiler | 94 } // namespace v8::internal::compiler |
| 95 | 95 |
| 96 #endif // V8_COMPILER_NODE_H_ | 96 #endif // V8_COMPILER_NODE_H_ |
| OLD | NEW |