OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 Label labels[kNumCases]; | 1882 Label labels[kNumCases]; |
1883 | 1883 |
1884 __ daddiu(sp, sp, -8); | 1884 __ daddiu(sp, sp, -8); |
1885 __ sd(ra, MemOperand(sp)); | 1885 __ sd(ra, MemOperand(sp)); |
1886 if ((assm.pc_offset() & 7) == 0) { | 1886 if ((assm.pc_offset() & 7) == 0) { |
1887 __ nop(); | 1887 __ nop(); |
1888 } | 1888 } |
1889 | 1889 |
1890 Label done; | 1890 Label done; |
1891 { | 1891 { |
| 1892 __ BlockTrampolinePoolFor(kNumCases * 2 + 7); |
1892 PredictableCodeSizeScope predictable( | 1893 PredictableCodeSizeScope predictable( |
1893 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); | 1894 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); |
1894 Label here; | 1895 Label here; |
1895 | 1896 |
1896 __ bal(&here); | 1897 __ bal(&here); |
1897 __ nop(); | 1898 __ nop(); |
1898 __ bind(&here); | 1899 __ bind(&here); |
1899 __ dsll(at, a0, 3); | 1900 __ dsll(at, a0, 3); |
1900 __ daddu(at, at, ra); | 1901 __ daddu(at, at, ra); |
1901 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); | 1902 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 __ ori(v0, v0, values[i] & 0xffff); | 1962 __ ori(v0, v0, values[i] & 0xffff); |
1962 __ b(&done); | 1963 __ b(&done); |
1963 __ nop(); | 1964 __ nop(); |
1964 } | 1965 } |
1965 | 1966 |
1966 if ((assm.pc_offset() & 7) == 0) { | 1967 if ((assm.pc_offset() & 7) == 0) { |
1967 __ nop(); | 1968 __ nop(); |
1968 } | 1969 } |
1969 __ bind(&dispatch); | 1970 __ bind(&dispatch); |
1970 { | 1971 { |
| 1972 __ BlockTrampolinePoolFor(kNumCases * 2 + 7); |
1971 PredictableCodeSizeScope predictable( | 1973 PredictableCodeSizeScope predictable( |
1972 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); | 1974 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); |
1973 Label here; | 1975 Label here; |
1974 | 1976 |
1975 __ bal(&here); | 1977 __ bal(&here); |
1976 __ nop(); | 1978 __ nop(); |
1977 __ bind(&here); | 1979 __ bind(&here); |
1978 __ dsll(at, a0, 3); | 1980 __ dsll(at, a0, 3); |
1979 __ daddu(at, at, ra); | 1981 __ daddu(at, at, ra); |
1980 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); | 1982 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 __ b(&done); | 2044 __ b(&done); |
2043 __ nop(); | 2045 __ nop(); |
2044 } | 2046 } |
2045 | 2047 |
2046 __ stop("chk"); | 2048 __ stop("chk"); |
2047 if ((assm.pc_offset() & 7) == 0) { | 2049 if ((assm.pc_offset() & 7) == 0) { |
2048 __ nop(); | 2050 __ nop(); |
2049 } | 2051 } |
2050 __ bind(&dispatch); | 2052 __ bind(&dispatch); |
2051 { | 2053 { |
| 2054 __ BlockTrampolinePoolFor(kNumCases * 2 + 7); |
2052 PredictableCodeSizeScope predictable( | 2055 PredictableCodeSizeScope predictable( |
2053 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); | 2056 &assm, (kNumCases * 2 + 7) * Assembler::kInstrSize); |
2054 Label here; | 2057 Label here; |
2055 | 2058 |
2056 __ bal(&here); | 2059 __ bal(&here); |
2057 __ nop(); | 2060 __ nop(); |
2058 __ bind(&here); | 2061 __ bind(&here); |
2059 __ dsll(at, a0, 3); | 2062 __ dsll(at, a0, 3); |
2060 __ daddu(at, at, ra); | 2063 __ daddu(at, at, ra); |
2061 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); | 2064 __ ld(at, MemOperand(at, 5 * Assembler::kInstrSize)); |
(...skipping 24 matching lines...) Expand all Loading... |
2086 ::printf("f(%d) = ", i); | 2089 ::printf("f(%d) = ", i); |
2087 result->Print(std::cout); | 2090 result->Print(std::cout); |
2088 ::printf("\n"); | 2091 ::printf("\n"); |
2089 #endif | 2092 #endif |
2090 CHECK(values[i].is_identical_to(result)); | 2093 CHECK(values[i].is_identical_to(result)); |
2091 } | 2094 } |
2092 } | 2095 } |
2093 | 2096 |
2094 | 2097 |
2095 #undef __ | 2098 #undef __ |
OLD | NEW |