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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 StateValueList values_; | 1289 StateValueList values_; |
1290 MaybeHandle<SharedFunctionInfo> const shared_info_; | 1290 MaybeHandle<SharedFunctionInfo> const shared_info_; |
1291 FrameStateDescriptor* outer_state_; | 1291 FrameStateDescriptor* outer_state_; |
1292 }; | 1292 }; |
1293 | 1293 |
1294 // A deoptimization entry is a pair of the reason why we deoptimize and the | 1294 // A deoptimization entry is a pair of the reason why we deoptimize and the |
1295 // frame state descriptor that we have to go back to. | 1295 // frame state descriptor that we have to go back to. |
1296 class DeoptimizationEntry final { | 1296 class DeoptimizationEntry final { |
1297 public: | 1297 public: |
1298 DeoptimizationEntry() {} | 1298 DeoptimizationEntry() {} |
1299 DeoptimizationEntry(FrameStateDescriptor* descriptor, DeoptimizeReason reason) | 1299 DeoptimizationEntry(FrameStateDescriptor* descriptor, DeoptimizeKind kind, |
1300 : descriptor_(descriptor), reason_(reason) {} | 1300 DeoptimizeReason reason) |
| 1301 : descriptor_(descriptor), kind_(kind), reason_(reason) {} |
1301 | 1302 |
1302 FrameStateDescriptor* descriptor() const { return descriptor_; } | 1303 FrameStateDescriptor* descriptor() const { return descriptor_; } |
| 1304 DeoptimizeKind kind() const { return kind_; } |
1303 DeoptimizeReason reason() const { return reason_; } | 1305 DeoptimizeReason reason() const { return reason_; } |
1304 | 1306 |
1305 private: | 1307 private: |
1306 FrameStateDescriptor* descriptor_ = nullptr; | 1308 FrameStateDescriptor* descriptor_ = nullptr; |
| 1309 DeoptimizeKind kind_ = DeoptimizeKind::kEager; |
1307 DeoptimizeReason reason_ = DeoptimizeReason::kNoReason; | 1310 DeoptimizeReason reason_ = DeoptimizeReason::kNoReason; |
1308 }; | 1311 }; |
1309 | 1312 |
1310 typedef ZoneVector<DeoptimizationEntry> DeoptimizationVector; | 1313 typedef ZoneVector<DeoptimizationEntry> DeoptimizationVector; |
1311 | 1314 |
1312 class V8_EXPORT_PRIVATE PhiInstruction final | 1315 class V8_EXPORT_PRIVATE PhiInstruction final |
1313 : public NON_EXPORTED_BASE(ZoneObject) { | 1316 : public NON_EXPORTED_BASE(ZoneObject) { |
1314 public: | 1317 public: |
1315 typedef ZoneVector<InstructionOperand> Inputs; | 1318 typedef ZoneVector<InstructionOperand> Inputs; |
1316 | 1319 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 DCHECK(index >= 0); | 1559 DCHECK(index >= 0); |
1557 DCHECK(index < static_cast<int>(immediates_.size())); | 1560 DCHECK(index < static_cast<int>(immediates_.size())); |
1558 return immediates_[index]; | 1561 return immediates_[index]; |
1559 } | 1562 } |
1560 } | 1563 } |
1561 UNREACHABLE(); | 1564 UNREACHABLE(); |
1562 return Constant(static_cast<int32_t>(0)); | 1565 return Constant(static_cast<int32_t>(0)); |
1563 } | 1566 } |
1564 | 1567 |
1565 int AddDeoptimizationEntry(FrameStateDescriptor* descriptor, | 1568 int AddDeoptimizationEntry(FrameStateDescriptor* descriptor, |
1566 DeoptimizeReason reason); | 1569 DeoptimizeKind kind, DeoptimizeReason reason); |
1567 DeoptimizationEntry const& GetDeoptimizationEntry(int deoptimization_id); | 1570 DeoptimizationEntry const& GetDeoptimizationEntry(int deoptimization_id); |
1568 int GetDeoptimizationEntryCount() const { | 1571 int GetDeoptimizationEntryCount() const { |
1569 return static_cast<int>(deoptimization_entries_.size()); | 1572 return static_cast<int>(deoptimization_entries_.size()); |
1570 } | 1573 } |
1571 | 1574 |
1572 RpoNumber InputRpo(Instruction* instr, size_t index); | 1575 RpoNumber InputRpo(Instruction* instr, size_t index); |
1573 | 1576 |
1574 bool GetSourcePosition(const Instruction* instr, | 1577 bool GetSourcePosition(const Instruction* instr, |
1575 SourcePosition* result) const; | 1578 SourcePosition* result) const; |
1576 void SetSourcePosition(const Instruction* instr, SourcePosition value); | 1579 void SetSourcePosition(const Instruction* instr, SourcePosition value); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 }; | 1636 }; |
1634 | 1637 |
1635 V8_EXPORT_PRIVATE std::ostream& operator<<( | 1638 V8_EXPORT_PRIVATE std::ostream& operator<<( |
1636 std::ostream& os, const PrintableInstructionSequence& code); | 1639 std::ostream& os, const PrintableInstructionSequence& code); |
1637 | 1640 |
1638 } // namespace compiler | 1641 } // namespace compiler |
1639 } // namespace internal | 1642 } // namespace internal |
1640 } // namespace v8 | 1643 } // namespace v8 |
1641 | 1644 |
1642 #endif // V8_COMPILER_INSTRUCTION_H_ | 1645 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |