OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 return false; | 1078 return false; |
1079 } | 1079 } |
1080 } | 1080 } |
1081 | 1081 |
1082 Instruction* GetBlockStart(RpoNumber rpo) const; | 1082 Instruction* GetBlockStart(RpoNumber rpo) const; |
1083 | 1083 |
1084 typedef InstructionDeque::const_iterator const_iterator; | 1084 typedef InstructionDeque::const_iterator const_iterator; |
1085 const_iterator begin() const { return instructions_.begin(); } | 1085 const_iterator begin() const { return instructions_.begin(); } |
1086 const_iterator end() const { return instructions_.end(); } | 1086 const_iterator end() const { return instructions_.end(); } |
1087 const InstructionDeque& instructions() const { return instructions_; } | 1087 const InstructionDeque& instructions() const { return instructions_; } |
| 1088 int InstructionCount() const { |
| 1089 return static_cast<int>(instructions().size()); |
| 1090 } |
| 1091 int LastInstructionIndex() const { return InstructionCount() - 1; } |
1088 | 1092 |
1089 Instruction* InstructionAt(int index) const { | 1093 Instruction* InstructionAt(int index) const { |
1090 DCHECK(index >= 0); | 1094 DCHECK(index >= 0); |
1091 DCHECK(index < static_cast<int>(instructions_.size())); | 1095 DCHECK(index < static_cast<int>(instructions_.size())); |
1092 return instructions_[index]; | 1096 return instructions_[index]; |
1093 } | 1097 } |
1094 | 1098 |
1095 Isolate* isolate() const { return isolate_; } | 1099 Isolate* isolate() const { return isolate_; } |
1096 const ReferenceMapDeque* reference_maps() const { return &reference_maps_; } | 1100 const ReferenceMapDeque* reference_maps() const { return &reference_maps_; } |
1097 Zone* zone() const { return zone_; } | 1101 Zone* zone() const { return zone_; } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 | 1207 |
1204 | 1208 |
1205 std::ostream& operator<<(std::ostream& os, | 1209 std::ostream& operator<<(std::ostream& os, |
1206 const PrintableInstructionSequence& code); | 1210 const PrintableInstructionSequence& code); |
1207 | 1211 |
1208 } // namespace compiler | 1212 } // namespace compiler |
1209 } // namespace internal | 1213 } // namespace internal |
1210 } // namespace v8 | 1214 } // namespace v8 |
1211 | 1215 |
1212 #endif // V8_COMPILER_INSTRUCTION_H_ | 1216 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |