| 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 "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
| 9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
| 10 #include "src/types-inl.h" | 10 #include "src/types-inl.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // which specific applications of graphs and nodes can use to index auxiliary | 35 // which specific applications of graphs and nodes can use to index auxiliary |
| 36 // out-of-line data, especially transient data. | 36 // out-of-line data, especially transient data. |
| 37 // | 37 // |
| 38 // In addition Nodes only contain a mutable Operator that may change during | 38 // In addition Nodes only contain a mutable Operator that may change during |
| 39 // compilation, e.g. during lowering passes. Other information that needs to be | 39 // compilation, e.g. during lowering passes. Other information that needs to be |
| 40 // associated with Nodes during compilation must be stored out-of-line indexed | 40 // associated with Nodes during compilation must be stored out-of-line indexed |
| 41 // by the Node's id. | 41 // by the Node's id. |
| 42 class Node final { | 42 class Node final { |
| 43 public: | 43 public: |
| 44 static Node* New(Zone* zone, NodeId id, const Operator* op, int input_count, | 44 static Node* New(Zone* zone, NodeId id, const Operator* op, int input_count, |
| 45 Node** inputs, bool has_extensible_inputs); | 45 Node* const* inputs, bool has_extensible_inputs); |
| 46 static Node* Clone(Zone* zone, NodeId id, const Node* node); |
| 46 | 47 |
| 47 bool IsDead() const { return InputCount() > 0 && !InputAt(0); } | 48 bool IsDead() const { return InputCount() > 0 && !InputAt(0); } |
| 48 void Kill(); | 49 void Kill(); |
| 49 | 50 |
| 50 const Operator* op() const { return op_; } | 51 const Operator* op() const { return op_; } |
| 51 void set_op(const Operator* op) { op_ = op; } | 52 void set_op(const Operator* op) { op_ = op; } |
| 52 | 53 |
| 53 IrOpcode::Value opcode() const { | 54 IrOpcode::Value opcode() const { |
| 54 DCHECK(op_->opcode() <= IrOpcode::kLast); | 55 DCHECK(op_->opcode() <= IrOpcode::kLast); |
| 55 return static_cast<IrOpcode::Value>(op_->opcode()); | 56 return static_cast<IrOpcode::Value>(op_->opcode()); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 : reinterpret_cast<Use*>(inputs_.outline_); | 278 : reinterpret_cast<Use*>(inputs_.outline_); |
| 278 return &ptr[-1 - input_index]; | 279 return &ptr[-1 - input_index]; |
| 279 } | 280 } |
| 280 | 281 |
| 281 void AppendUse(Use* use); | 282 void AppendUse(Use* use); |
| 282 void RemoveUse(Use* use); | 283 void RemoveUse(Use* use); |
| 283 | 284 |
| 284 void* operator new(size_t, void* location) { return location; } | 285 void* operator new(size_t, void* location) { return location; } |
| 285 | 286 |
| 286 // Only NodeProperties should manipulate the bounds. | 287 // Only NodeProperties should manipulate the bounds. |
| 287 Bounds bounds() { return bounds_; } | 288 Bounds bounds() const { return bounds_; } |
| 288 void set_bounds(Bounds b) { bounds_ = b; } | 289 void set_bounds(Bounds b) { bounds_ = b; } |
| 289 | 290 |
| 290 // Only NodeMarkers should manipulate the marks on nodes. | 291 // Only NodeMarkers should manipulate the marks on nodes. |
| 291 Mark mark() { return mark_; } | 292 Mark mark() { return mark_; } |
| 292 void set_mark(Mark mark) { mark_ = mark; } | 293 void set_mark(Mark mark) { mark_ = mark; } |
| 293 | 294 |
| 294 inline bool has_inline_inputs() const { | 295 inline bool has_inline_inputs() const { |
| 295 return InlineCountField::decode(bit_field_) != kOutlineMarker; | 296 return InlineCountField::decode(bit_field_) != kOutlineMarker; |
| 296 } | 297 } |
| 297 | 298 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 } | 552 } |
| 552 | 553 |
| 553 | 554 |
| 554 Node::Uses::const_iterator Node::Uses::end() const { return const_iterator(); } | 555 Node::Uses::const_iterator Node::Uses::end() const { return const_iterator(); } |
| 555 | 556 |
| 556 } // namespace compiler | 557 } // namespace compiler |
| 557 } // namespace internal | 558 } // namespace internal |
| 558 } // namespace v8 | 559 } // namespace v8 |
| 559 | 560 |
| 560 #endif // V8_COMPILER_NODE_H_ | 561 #endif // V8_COMPILER_NODE_H_ |
| OLD | NEW |