OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/mips/assembler-mips.h" | 10 #include "src/mips/assembler-mips.h" |
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 template <typename Func> | 1771 template <typename Func> |
1772 void MacroAssembler::GenerateSwitchTable(Register index, size_t case_count, | 1772 void MacroAssembler::GenerateSwitchTable(Register index, size_t case_count, |
1773 Func GetLabelFunction) { | 1773 Func GetLabelFunction) { |
1774 if (kArchVariant >= kMips32r6) { | 1774 if (kArchVariant >= kMips32r6) { |
1775 BlockTrampolinePoolFor(case_count + 5); | 1775 BlockTrampolinePoolFor(case_count + 5); |
1776 addiupc(at, 5); | 1776 addiupc(at, 5); |
1777 lsa(at, at, index, kPointerSizeLog2); | 1777 lsa(at, at, index, kPointerSizeLog2); |
1778 lw(at, MemOperand(at)); | 1778 lw(at, MemOperand(at)); |
1779 } else { | 1779 } else { |
1780 Label here; | 1780 Label here; |
1781 BlockTrampolinePoolFor(case_count + 6); | 1781 BlockTrampolinePoolFor(case_count + 10); |
| 1782 push(ra); |
1782 bal(&here); | 1783 bal(&here); |
1783 sll(at, index, kPointerSizeLog2); // Branch delay slot. | 1784 sll(at, index, kPointerSizeLog2); // Branch delay slot. |
1784 bind(&here); | 1785 bind(&here); |
1785 addu(at, at, ra); | 1786 addu(at, at, ra); |
1786 lw(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); | 1787 pop(ra); |
| 1788 lw(at, MemOperand(at, 6 * v8::internal::Assembler::kInstrSize)); |
1787 } | 1789 } |
1788 jr(at); | 1790 jr(at); |
1789 nop(); // Branch delay slot nop. | 1791 nop(); // Branch delay slot nop. |
1790 for (size_t index = 0; index < case_count; ++index) { | 1792 for (size_t index = 0; index < case_count; ++index) { |
1791 dd(GetLabelFunction(index)); | 1793 dd(GetLabelFunction(index)); |
1792 } | 1794 } |
1793 } | 1795 } |
1794 | 1796 |
1795 #ifdef GENERATED_CODE_COVERAGE | 1797 #ifdef GENERATED_CODE_COVERAGE |
1796 #define CODE_COVERAGE_STRINGIFY(x) #x | 1798 #define CODE_COVERAGE_STRINGIFY(x) #x |
1797 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1799 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1798 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1800 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1799 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1801 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1800 #else | 1802 #else |
1801 #define ACCESS_MASM(masm) masm-> | 1803 #define ACCESS_MASM(masm) masm-> |
1802 #endif | 1804 #endif |
1803 | 1805 |
1804 } // namespace internal | 1806 } // namespace internal |
1805 } // namespace v8 | 1807 } // namespace v8 |
1806 | 1808 |
1807 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1809 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |