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

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

Issue 2732273003: Disentangle assembler from isolate. (Closed)
Patch Set: Address feedback. Created 3 years, 9 months 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/mips64/assembler-mips64-inl.h ('k') | src/mips64/macro-assembler-mips64.h » ('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/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 <memory> 9 #include <memory>
10 10
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 __ addiu(a0, a0, 1); 539 __ addiu(a0, a0, 1);
540 __ addiu(a1, a1, 1); 540 __ addiu(a1, a1, 1);
541 __ bne(a0, a3, &ua_smallCopy_loop); 541 __ bne(a0, a3, &ua_smallCopy_loop);
542 __ sb(v1, MemOperand(a0, -1)); // In delay slot. 542 __ sb(v1, MemOperand(a0, -1)); // In delay slot.
543 543
544 __ jr(ra); 544 __ jr(ra);
545 __ nop(); 545 __ nop();
546 } 546 }
547 CodeDesc desc; 547 CodeDesc desc;
548 masm.GetCode(&desc); 548 masm.GetCode(&desc);
549 DCHECK(!RelocInfo::RequiresRelocation(desc)); 549 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
550 550
551 Assembler::FlushICache(isolate, buffer, actual_size); 551 Assembler::FlushICache(isolate, buffer, actual_size);
552 base::OS::ProtectCode(buffer, actual_size); 552 base::OS::ProtectCode(buffer, actual_size);
553 return FUNCTION_CAST<MemCopyUint8Function>(buffer); 553 return FUNCTION_CAST<MemCopyUint8Function>(buffer);
554 #endif 554 #endif
555 } 555 }
556 #endif 556 #endif
557 557
558 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) { 558 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
559 #if defined(USE_SIMULATOR) 559 #if defined(USE_SIMULATOR)
560 return nullptr; 560 return nullptr;
561 #else 561 #else
562 size_t actual_size; 562 size_t actual_size;
563 byte* buffer = 563 byte* buffer =
564 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 564 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
565 if (buffer == nullptr) return nullptr; 565 if (buffer == nullptr) return nullptr;
566 566
567 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), 567 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size),
568 CodeObjectRequired::kNo); 568 CodeObjectRequired::kNo);
569 569
570 __ MovFromFloatParameter(f12); 570 __ MovFromFloatParameter(f12);
571 __ sqrt_d(f0, f12); 571 __ sqrt_d(f0, f12);
572 __ MovToFloatResult(f0); 572 __ MovToFloatResult(f0);
573 __ Ret(); 573 __ Ret();
574 574
575 CodeDesc desc; 575 CodeDesc desc;
576 masm.GetCode(&desc); 576 masm.GetCode(&desc);
577 DCHECK(!RelocInfo::RequiresRelocation(desc)); 577 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
578 578
579 Assembler::FlushICache(isolate, buffer, actual_size); 579 Assembler::FlushICache(isolate, buffer, actual_size);
580 base::OS::ProtectCode(buffer, actual_size); 580 base::OS::ProtectCode(buffer, actual_size);
581 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); 581 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
582 #endif 582 #endif
583 } 583 }
584 584
585 #undef __ 585 #undef __
586 586
587 587
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 } 774 }
775 } 775 }
776 776
777 777
778 #undef __ 778 #undef __
779 779
780 } // namespace internal 780 } // namespace internal
781 } // namespace v8 781 } // namespace v8
782 782
783 #endif // V8_TARGET_ARCH_MIPS64 783 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/assembler-mips64-inl.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698