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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 opcode_ = ArchOpcodeField::encode(kArchNop); | 805 opcode_ = ArchOpcodeField::encode(kArchNop); |
806 bit_field_ = 0; | 806 bit_field_ = 0; |
807 reference_map_ = nullptr; | 807 reference_map_ = nullptr; |
808 } | 808 } |
809 | 809 |
810 bool IsNop() const { | 810 bool IsNop() const { |
811 return arch_opcode() == kArchNop && InputCount() == 0 && | 811 return arch_opcode() == kArchNop && InputCount() == 0 && |
812 OutputCount() == 0 && TempCount() == 0; | 812 OutputCount() == 0 && TempCount() == 0; |
813 } | 813 } |
814 | 814 |
| 815 bool IsDeoptimizeCall() const { |
| 816 return arch_opcode() == ArchOpcode::kArchDeoptimize || |
| 817 FlagsModeField::decode(opcode()) == kFlags_deoptimize; |
| 818 } |
| 819 |
| 820 bool IsJump() const { return arch_opcode() == ArchOpcode::kArchJmp; } |
| 821 bool IsRet() const { return arch_opcode() == ArchOpcode::kArchRet; } |
| 822 bool IsTailCall() const { |
| 823 return arch_opcode() == ArchOpcode::kArchTailCallCodeObject || |
| 824 arch_opcode() == ArchOpcode::kArchTailCallCodeObjectFromJSFunction || |
| 825 arch_opcode() == ArchOpcode::kArchTailCallJSFunction || |
| 826 arch_opcode() == ArchOpcode::kArchTailCallJSFunctionFromJSFunction; |
| 827 } |
| 828 bool IsThrow() const { |
| 829 return arch_opcode() == ArchOpcode::kArchThrowTerminator; |
| 830 } |
| 831 |
815 enum GapPosition { | 832 enum GapPosition { |
816 START, | 833 START, |
817 END, | 834 END, |
818 FIRST_GAP_POSITION = START, | 835 FIRST_GAP_POSITION = START, |
819 LAST_GAP_POSITION = END | 836 LAST_GAP_POSITION = END |
820 }; | 837 }; |
821 | 838 |
822 ParallelMove* GetOrCreateParallelMove(GapPosition pos, Zone* zone) { | 839 ParallelMove* GetOrCreateParallelMove(GapPosition pos, Zone* zone) { |
823 if (parallel_moves_[pos] == nullptr) { | 840 if (parallel_moves_[pos] == nullptr) { |
824 parallel_moves_[pos] = new (zone) ParallelMove(zone); | 841 parallel_moves_[pos] = new (zone) ParallelMove(zone); |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 | 1405 |
1389 | 1406 |
1390 std::ostream& operator<<(std::ostream& os, | 1407 std::ostream& operator<<(std::ostream& os, |
1391 const PrintableInstructionSequence& code); | 1408 const PrintableInstructionSequence& code); |
1392 | 1409 |
1393 } // namespace compiler | 1410 } // namespace compiler |
1394 } // namespace internal | 1411 } // namespace internal |
1395 } // namespace v8 | 1412 } // namespace v8 |
1396 | 1413 |
1397 #endif // V8_COMPILER_INSTRUCTION_H_ | 1414 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |