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/mips64/assembler-mips64.h" | 10 #include "src/mips64/assembler-mips64.h" |
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 6); | 1934 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 6); |
1935 // Opposite of Align(8) as we have odd number of instructions in this case. | 1935 // Opposite of Align(8) as we have odd number of instructions in this case. |
1936 if ((pc_offset() & 7) == 0) { | 1936 if ((pc_offset() & 7) == 0) { |
1937 nop(); | 1937 nop(); |
1938 } | 1938 } |
1939 addiupc(at, 5); | 1939 addiupc(at, 5); |
1940 dlsa(at, at, index, kPointerSizeLog2); | 1940 dlsa(at, at, index, kPointerSizeLog2); |
1941 ld(at, MemOperand(at)); | 1941 ld(at, MemOperand(at)); |
1942 } else { | 1942 } else { |
1943 Label here; | 1943 Label here; |
1944 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 7); | 1944 BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 11); |
1945 Align(8); | 1945 Align(8); |
| 1946 push(ra); |
1946 bal(&here); | 1947 bal(&here); |
1947 dsll(at, index, kPointerSizeLog2); // Branch delay slot. | 1948 dsll(at, index, kPointerSizeLog2); // Branch delay slot. |
1948 bind(&here); | 1949 bind(&here); |
1949 daddu(at, at, ra); | 1950 daddu(at, at, ra); |
1950 ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); | 1951 pop(ra); |
| 1952 ld(at, MemOperand(at, 6 * v8::internal::Assembler::kInstrSize)); |
1951 } | 1953 } |
1952 jr(at); | 1954 jr(at); |
1953 nop(); // Branch delay slot nop. | 1955 nop(); // Branch delay slot nop. |
1954 for (size_t index = 0; index < case_count; ++index) { | 1956 for (size_t index = 0; index < case_count; ++index) { |
1955 dd(GetLabelFunction(index)); | 1957 dd(GetLabelFunction(index)); |
1956 } | 1958 } |
1957 } | 1959 } |
1958 | 1960 |
1959 #ifdef GENERATED_CODE_COVERAGE | 1961 #ifdef GENERATED_CODE_COVERAGE |
1960 #define CODE_COVERAGE_STRINGIFY(x) #x | 1962 #define CODE_COVERAGE_STRINGIFY(x) #x |
1961 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1963 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1962 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1964 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1963 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1965 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1964 #else | 1966 #else |
1965 #define ACCESS_MASM(masm) masm-> | 1967 #define ACCESS_MASM(masm) masm-> |
1966 #endif | 1968 #endif |
1967 | 1969 |
1968 } // namespace internal | 1970 } // namespace internal |
1969 } // namespace v8 | 1971 } // namespace v8 |
1970 | 1972 |
1971 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1973 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |