Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: src/mips/codegen-mips.cc

Issue 1473683004: Lazily initialize fast_sqrt() and pass an Isolate parameter to it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/mips/codegen-mips.h" 5 #include "src/mips/codegen-mips.h"
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 masm.GetCode(&desc); 597 masm.GetCode(&desc);
598 DCHECK(!RelocInfo::RequiresRelocation(desc)); 598 DCHECK(!RelocInfo::RequiresRelocation(desc));
599 599
600 CpuFeatures::FlushICache(buffer, actual_size); 600 CpuFeatures::FlushICache(buffer, actual_size);
601 base::OS::ProtectCode(buffer, actual_size); 601 base::OS::ProtectCode(buffer, actual_size);
602 return FUNCTION_CAST<MemCopyUint8Function>(buffer); 602 return FUNCTION_CAST<MemCopyUint8Function>(buffer);
603 #endif 603 #endif
604 } 604 }
605 #endif 605 #endif
606 606
607 UnaryMathFunction CreateSqrtFunction() { 607 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
608 #if defined(USE_SIMULATOR) 608 #if defined(USE_SIMULATOR)
609 return &std::sqrt; 609 return nullptr;
610 #else 610 #else
611 size_t actual_size; 611 size_t actual_size;
612 byte* buffer = 612 byte* buffer =
613 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 613 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
614 if (buffer == NULL) return &std::sqrt; 614 if (buffer == nullptr) return nullptr;
615 615
616 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), 616 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size),
617 CodeObjectRequired::kNo); 617 CodeObjectRequired::kNo);
618 618
619 __ MovFromFloatParameter(f12); 619 __ MovFromFloatParameter(f12);
620 __ sqrt_d(f0, f12); 620 __ sqrt_d(f0, f12);
621 __ MovToFloatResult(f0); 621 __ MovToFloatResult(f0);
622 __ Ret(); 622 __ Ret();
623 623
624 CodeDesc desc; 624 CodeDesc desc;
625 masm.GetCode(&desc); 625 masm.GetCode(&desc);
626 DCHECK(!RelocInfo::RequiresRelocation(desc)); 626 DCHECK(!RelocInfo::RequiresRelocation(desc));
627 627
628 CpuFeatures::FlushICache(buffer, actual_size); 628 Assembler::FlushICache(isolate, buffer, actual_size);
629 base::OS::ProtectCode(buffer, actual_size); 629 base::OS::ProtectCode(buffer, actual_size);
630 return FUNCTION_CAST<UnaryMathFunction>(buffer); 630 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
631 #endif 631 #endif
632 } 632 }
633 633
634 #undef __ 634 #undef __
635 635
636 636
637 // ------------------------------------------------------------------------- 637 // -------------------------------------------------------------------------
638 // Platform-specific RuntimeCallHelper functions. 638 // Platform-specific RuntimeCallHelper functions.
639 639
640 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const { 640 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 } 1259 }
1260 } 1260 }
1261 1261
1262 1262
1263 #undef __ 1263 #undef __
1264 1264
1265 } // namespace internal 1265 } // namespace internal
1266 } // namespace v8 1266 } // namespace v8
1267 1267
1268 #endif // V8_TARGET_ARCH_MIPS 1268 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698