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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void set_op(const Operator* op) { op_ = op; } | 51 void set_op(const Operator* op) { op_ = op; } |
52 | 52 |
53 IrOpcode::Value opcode() const { | 53 IrOpcode::Value opcode() const { |
54 DCHECK(op_->opcode() <= IrOpcode::kLast); | 54 DCHECK(op_->opcode() <= IrOpcode::kLast); |
55 return static_cast<IrOpcode::Value>(op_->opcode()); | 55 return static_cast<IrOpcode::Value>(op_->opcode()); |
56 } | 56 } |
57 | 57 |
58 NodeId id() const { return id_; } | 58 NodeId id() const { return id_; } |
59 | 59 |
60 int InputCount() const { return input_count(); } | 60 int InputCount() const { return input_count(); } |
61 Node* InputAt(int index) const { return GetInputRecordPtr(index)->to; } | 61 Node* InputAt(int index) const { |
| 62 #if DEBUG |
| 63 if (index < 0 || index >= InputCount()) { |
| 64 V8_Fatal(__FILE__, __LINE__, "Node #%d:%s->InputAt(%d) out of bounds", |
| 65 id(), op()->mnemonic(), index); |
| 66 } |
| 67 #endif |
| 68 return GetInputRecordPtr(index)->to; |
| 69 } |
62 inline void ReplaceInput(int index, Node* new_to); | 70 inline void ReplaceInput(int index, Node* new_to); |
63 void AppendInput(Zone* zone, Node* new_to); | 71 void AppendInput(Zone* zone, Node* new_to); |
64 void InsertInput(Zone* zone, int index, Node* new_to); | 72 void InsertInput(Zone* zone, int index, Node* new_to); |
65 void RemoveInput(int index); | 73 void RemoveInput(int index); |
66 void NullAllInputs(); | 74 void NullAllInputs(); |
67 void TrimInputCount(int new_input_count); | 75 void TrimInputCount(int new_input_count); |
68 | 76 |
69 int UseCount() const; | 77 int UseCount() const; |
70 void ReplaceUses(Node* replace_to); | 78 void ReplaceUses(Node* replace_to); |
71 | 79 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 484 |
477 void Node::ReplaceInput(int index, Node* new_to) { | 485 void Node::ReplaceInput(int index, Node* new_to) { |
478 GetInputRecordPtr(index)->Update(new_to); | 486 GetInputRecordPtr(index)->Update(new_to); |
479 } | 487 } |
480 | 488 |
481 } // namespace compiler | 489 } // namespace compiler |
482 } // namespace internal | 490 } // namespace internal |
483 } // namespace v8 | 491 } // namespace v8 |
484 | 492 |
485 #endif // V8_COMPILER_NODE_H_ | 493 #endif // V8_COMPILER_NODE_H_ |
OLD | NEW |