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 "src/mips64/codegen-mips64.h" | 5 #include "src/mips64/codegen-mips64.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 temp1, temp2, temp3); | 51 temp1, temp2, temp3); |
52 __ Pop(temp3, temp2, temp1); | 52 __ Pop(temp3, temp2, temp1); |
53 __ MovToFloatResult(result); | 53 __ MovToFloatResult(result); |
54 __ Ret(); | 54 __ Ret(); |
55 } | 55 } |
56 | 56 |
57 CodeDesc desc; | 57 CodeDesc desc; |
58 masm.GetCode(&desc); | 58 masm.GetCode(&desc); |
59 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 59 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
60 | 60 |
61 CpuFeatures::FlushICache(buffer, actual_size); | 61 Assembler::FlushICache(isolate, buffer, actual_size); |
62 base::OS::ProtectCode(buffer, actual_size); | 62 base::OS::ProtectCode(buffer, actual_size); |
63 | 63 |
64 #if !defined(USE_SIMULATOR) | 64 #if !defined(USE_SIMULATOR) |
65 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); | 65 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); |
66 #else | 66 #else |
67 fast_exp_mips_machine_code = buffer; | 67 fast_exp_mips_machine_code = buffer; |
68 return &fast_exp_simulator; | 68 return &fast_exp_simulator; |
69 #endif | 69 #endif |
70 } | 70 } |
71 | 71 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 __ bne(a0, a3, &ua_smallCopy_loop); | 591 __ bne(a0, a3, &ua_smallCopy_loop); |
592 __ sb(v1, MemOperand(a0, -1)); // In delay slot. | 592 __ sb(v1, MemOperand(a0, -1)); // In delay slot. |
593 | 593 |
594 __ jr(ra); | 594 __ jr(ra); |
595 __ nop(); | 595 __ nop(); |
596 } | 596 } |
597 CodeDesc desc; | 597 CodeDesc desc; |
598 masm.GetCode(&desc); | 598 masm.GetCode(&desc); |
599 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 599 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
600 | 600 |
601 CpuFeatures::FlushICache(buffer, actual_size); | 601 Assembler::FlushICacheWithoutIsolate(buffer, actual_size); |
602 base::OS::ProtectCode(buffer, actual_size); | 602 base::OS::ProtectCode(buffer, actual_size); |
603 return FUNCTION_CAST<MemCopyUint8Function>(buffer); | 603 return FUNCTION_CAST<MemCopyUint8Function>(buffer); |
604 #endif | 604 #endif |
605 } | 605 } |
606 #endif | 606 #endif |
607 | 607 |
608 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) { | 608 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) { |
609 #if defined(USE_SIMULATOR) | 609 #if defined(USE_SIMULATOR) |
610 return nullptr; | 610 return nullptr; |
611 #else | 611 #else |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 } | 1231 } |
1232 | 1232 |
1233 | 1233 |
1234 void Code::PatchPlatformCodeAge(Isolate* isolate, | 1234 void Code::PatchPlatformCodeAge(Isolate* isolate, |
1235 byte* sequence, | 1235 byte* sequence, |
1236 Code::Age age, | 1236 Code::Age age, |
1237 MarkingParity parity) { | 1237 MarkingParity parity) { |
1238 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); | 1238 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); |
1239 if (age == kNoAgeCodeAge) { | 1239 if (age == kNoAgeCodeAge) { |
1240 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); | 1240 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); |
1241 CpuFeatures::FlushICache(sequence, young_length); | 1241 Assembler::FlushICache(isolate, sequence, young_length); |
1242 } else { | 1242 } else { |
1243 Code* stub = GetCodeAgeStub(isolate, age, parity); | 1243 Code* stub = GetCodeAgeStub(isolate, age, parity); |
1244 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); | 1244 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); |
1245 // Mark this code sequence for FindPlatformCodeAgeSequence(). | 1245 // Mark this code sequence for FindPlatformCodeAgeSequence(). |
1246 patcher.masm()->nop(Assembler::CODE_AGE_MARKER_NOP); | 1246 patcher.masm()->nop(Assembler::CODE_AGE_MARKER_NOP); |
1247 // Load the stub address to t9 and call it, | 1247 // Load the stub address to t9 and call it, |
1248 // GetCodeAgeAndParity() extracts the stub address from this instruction. | 1248 // GetCodeAgeAndParity() extracts the stub address from this instruction. |
1249 patcher.masm()->li( | 1249 patcher.masm()->li( |
1250 t9, | 1250 t9, |
1251 Operand(reinterpret_cast<uint64_t>(stub->instruction_start())), | 1251 Operand(reinterpret_cast<uint64_t>(stub->instruction_start())), |
1252 ADDRESS_LOAD); | 1252 ADDRESS_LOAD); |
1253 patcher.masm()->nop(); // Prevent jalr to jal optimization. | 1253 patcher.masm()->nop(); // Prevent jalr to jal optimization. |
1254 patcher.masm()->jalr(t9, a0); | 1254 patcher.masm()->jalr(t9, a0); |
1255 patcher.masm()->nop(); // Branch delay slot nop. | 1255 patcher.masm()->nop(); // Branch delay slot nop. |
1256 patcher.masm()->nop(); // Pad the empty space. | 1256 patcher.masm()->nop(); // Pad the empty space. |
1257 } | 1257 } |
1258 } | 1258 } |
1259 | 1259 |
1260 | 1260 |
1261 #undef __ | 1261 #undef __ |
1262 | 1262 |
1263 } // namespace internal | 1263 } // namespace internal |
1264 } // namespace v8 | 1264 } // namespace v8 |
1265 | 1265 |
1266 #endif // V8_TARGET_ARCH_MIPS64 | 1266 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |