| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 CpuFeatures::FlushICache(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 UnaryMathFunction CreateSqrtFunction() { | 608 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) { |
| 609 #if defined(USE_SIMULATOR) | 609 #if defined(USE_SIMULATOR) |
| 610 return &std::sqrt; | 610 return nullptr; |
| 611 #else | 611 #else |
| 612 size_t actual_size; | 612 size_t actual_size; |
| 613 byte* buffer = | 613 byte* buffer = |
| 614 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); | 614 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); |
| 615 if (buffer == NULL) return &std::sqrt; | 615 if (buffer == nullptr) return nullptr; |
| 616 | 616 |
| 617 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), | 617 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), |
| 618 CodeObjectRequired::kNo); | 618 CodeObjectRequired::kNo); |
| 619 | 619 |
| 620 __ MovFromFloatParameter(f12); | 620 __ MovFromFloatParameter(f12); |
| 621 __ sqrt_d(f0, f12); | 621 __ sqrt_d(f0, f12); |
| 622 __ MovToFloatResult(f0); | 622 __ MovToFloatResult(f0); |
| 623 __ Ret(); | 623 __ Ret(); |
| 624 | 624 |
| 625 CodeDesc desc; | 625 CodeDesc desc; |
| 626 masm.GetCode(&desc); | 626 masm.GetCode(&desc); |
| 627 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 627 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
| 628 | 628 |
| 629 CpuFeatures::FlushICache(buffer, actual_size); | 629 Assembler::FlushICache(isolate, buffer, actual_size); |
| 630 base::OS::ProtectCode(buffer, actual_size); | 630 base::OS::ProtectCode(buffer, actual_size); |
| 631 return FUNCTION_CAST<UnaryMathFunction>(buffer); | 631 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); |
| 632 #endif | 632 #endif |
| 633 } | 633 } |
| 634 | 634 |
| 635 #undef __ | 635 #undef __ |
| 636 | 636 |
| 637 | 637 |
| 638 // ------------------------------------------------------------------------- | 638 // ------------------------------------------------------------------------- |
| 639 // Platform-specific RuntimeCallHelper functions. | 639 // Platform-specific RuntimeCallHelper functions. |
| 640 | 640 |
| 641 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const { | 641 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const { |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 } | 1256 } |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 | 1259 |
| 1260 #undef __ | 1260 #undef __ |
| 1261 | 1261 |
| 1262 } // namespace internal | 1262 } // namespace internal |
| 1263 } // namespace v8 | 1263 } // namespace v8 |
| 1264 | 1264 |
| 1265 #endif // V8_TARGET_ARCH_MIPS64 | 1265 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |