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

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

Issue 2900683002: [compiler] Delay allocation of code-embedded heap numbers. (Closed)
Patch Set: Fix rebase. Created 3 years, 6 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/mips/assembler-mips.cc ('k') | src/mips64/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/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 <memory> 9 #include <memory>
10 10
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 __ lb(v1, MemOperand(a1)); 536 __ lb(v1, MemOperand(a1));
537 __ addiu(a0, a0, 1); 537 __ addiu(a0, a0, 1);
538 __ addiu(a1, a1, 1); 538 __ addiu(a1, a1, 1);
539 __ bne(a0, a3, &ua_smallCopy_loop); 539 __ bne(a0, a3, &ua_smallCopy_loop);
540 __ sb(v1, MemOperand(a0, -1)); // In delay slot. 540 __ sb(v1, MemOperand(a0, -1)); // In delay slot.
541 541
542 __ jr(ra); 542 __ jr(ra);
543 __ nop(); 543 __ nop();
544 } 544 }
545 CodeDesc desc; 545 CodeDesc desc;
546 masm.GetCode(&desc); 546 masm.GetCode(isolate, &desc);
547 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc)); 547 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
548 548
549 Assembler::FlushICache(isolate, buffer, actual_size); 549 Assembler::FlushICache(isolate, buffer, actual_size);
550 base::OS::ProtectCode(buffer, actual_size); 550 base::OS::ProtectCode(buffer, actual_size);
551 return FUNCTION_CAST<MemCopyUint8Function>(buffer); 551 return FUNCTION_CAST<MemCopyUint8Function>(buffer);
552 #endif 552 #endif
553 } 553 }
554 #endif 554 #endif
555 555
556 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) { 556 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) {
557 #if defined(USE_SIMULATOR) 557 #if defined(USE_SIMULATOR)
558 return nullptr; 558 return nullptr;
559 #else 559 #else
560 size_t actual_size; 560 size_t actual_size;
561 byte* buffer = 561 byte* buffer =
562 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 562 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
563 if (buffer == nullptr) return nullptr; 563 if (buffer == nullptr) return nullptr;
564 564
565 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), 565 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size),
566 CodeObjectRequired::kNo); 566 CodeObjectRequired::kNo);
567 567
568 __ MovFromFloatParameter(f12); 568 __ MovFromFloatParameter(f12);
569 __ sqrt_d(f0, f12); 569 __ sqrt_d(f0, f12);
570 __ MovToFloatResult(f0); 570 __ MovToFloatResult(f0);
571 __ Ret(); 571 __ Ret();
572 572
573 CodeDesc desc; 573 CodeDesc desc;
574 masm.GetCode(&desc); 574 masm.GetCode(isolate, &desc);
575 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc)); 575 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc));
576 576
577 Assembler::FlushICache(isolate, buffer, actual_size); 577 Assembler::FlushICache(isolate, buffer, actual_size);
578 base::OS::ProtectCode(buffer, actual_size); 578 base::OS::ProtectCode(buffer, actual_size);
579 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); 579 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer);
580 #endif 580 #endif
581 } 581 }
582 582
583 #undef __ 583 #undef __
584 584
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 } 770 }
771 } 771 }
772 772
773 773
774 #undef __ 774 #undef __
775 775
776 } // namespace internal 776 } // namespace internal
777 } // namespace v8 777 } // namespace v8
778 778
779 #endif // V8_TARGET_ARCH_MIPS 779 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | src/mips64/assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698