| 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 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
| 10 | 10 |
| (...skipping 4874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4885 // for code aging to work properly. | 4885 // for code aging to work properly. |
| 4886 if (code_pre_aging) { | 4886 if (code_pre_aging) { |
| 4887 // Pre-age the code. | 4887 // Pre-age the code. |
| 4888 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); | 4888 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); |
| 4889 nop(Assembler::CODE_AGE_MARKER_NOP); | 4889 nop(Assembler::CODE_AGE_MARKER_NOP); |
| 4890 // Load the stub address to t9 and call it, | 4890 // Load the stub address to t9 and call it, |
| 4891 // GetCodeAgeAndParity() extracts the stub address from this instruction. | 4891 // GetCodeAgeAndParity() extracts the stub address from this instruction. |
| 4892 li(t9, | 4892 li(t9, |
| 4893 Operand(reinterpret_cast<uint32_t>(stub->instruction_start())), | 4893 Operand(reinterpret_cast<uint32_t>(stub->instruction_start())), |
| 4894 CONSTANT_SIZE); | 4894 CONSTANT_SIZE); |
| 4895 nop(); // Prevent jalr to jal optimization. | 4895 // Save the function's original return address. |
| 4896 jalr(t9, a0); | 4896 mov(at, ra); // This also prevents jalr->jal optimization. |
| 4897 jalr(t9); |
| 4897 nop(); // Branch delay slot nop. | 4898 nop(); // Branch delay slot nop. |
| 4898 nop(); // Pad the empty space. | 4899 nop(); // Pad the empty space. |
| 4899 } else { | 4900 } else { |
| 4900 Push(ra, fp, cp, a1); | 4901 Push(ra, fp, cp, a1); |
| 4901 nop(Assembler::CODE_AGE_SEQUENCE_NOP); | 4902 nop(Assembler::CODE_AGE_SEQUENCE_NOP); |
| 4902 // Adjust fp to point to caller's fp. | 4903 // Adjust fp to point to caller's fp. |
| 4903 Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 4904 Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 4904 } | 4905 } |
| 4905 } | 4906 } |
| 4906 | 4907 |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6126 if (mag.shift > 0) sra(result, result, mag.shift); | 6127 if (mag.shift > 0) sra(result, result, mag.shift); |
| 6127 srl(at, dividend, 31); | 6128 srl(at, dividend, 31); |
| 6128 Addu(result, result, Operand(at)); | 6129 Addu(result, result, Operand(at)); |
| 6129 } | 6130 } |
| 6130 | 6131 |
| 6131 | 6132 |
| 6132 } // namespace internal | 6133 } // namespace internal |
| 6133 } // namespace v8 | 6134 } // namespace v8 |
| 6134 | 6135 |
| 6135 #endif // V8_TARGET_ARCH_MIPS | 6136 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |