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

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

Issue 1476763002: Make whether or not a Code object should be created by masm explicit (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
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 14 matching lines...) Expand all
25 #endif 25 #endif
26 26
27 27
28 UnaryMathFunctionWithIsolate CreateExpFunction(Isolate* isolate) { 28 UnaryMathFunctionWithIsolate CreateExpFunction(Isolate* isolate) {
29 size_t actual_size; 29 size_t actual_size;
30 byte* buffer = 30 byte* buffer =
31 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 31 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
32 if (buffer == nullptr) return nullptr; 32 if (buffer == nullptr) return nullptr;
33 ExternalReference::InitializeMathExpData(); 33 ExternalReference::InitializeMathExpData();
34 34
35 MacroAssembler masm(nullptr, buffer, static_cast<int>(actual_size)); 35 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), false);
36 36
37 { 37 {
38 DoubleRegister input = f12; 38 DoubleRegister input = f12;
39 DoubleRegister result = f0; 39 DoubleRegister result = f0;
40 DoubleRegister double_scratch1 = f4; 40 DoubleRegister double_scratch1 = f4;
41 DoubleRegister double_scratch2 = f6; 41 DoubleRegister double_scratch2 = f6;
42 Register temp1 = t0; 42 Register temp1 = t0;
43 Register temp2 = t1; 43 Register temp2 = t1;
44 Register temp3 = t2; 44 Register temp3 = t2;
45 45
(...skipping 29 matching lines...) Expand all
75 defined(_MIPS_ARCH_MIPS32RX) 75 defined(_MIPS_ARCH_MIPS32RX)
76 return stub; 76 return stub;
77 #else 77 #else
78 size_t actual_size; 78 size_t actual_size;
79 byte* buffer = 79 byte* buffer =
80 static_cast<byte*>(base::OS::Allocate(3 * KB, &actual_size, true)); 80 static_cast<byte*>(base::OS::Allocate(3 * KB, &actual_size, true));
81 if (buffer == NULL) return stub; 81 if (buffer == NULL) return stub;
82 82
83 // This code assumes that cache lines are 32 bytes and if the cache line is 83 // This code assumes that cache lines are 32 bytes and if the cache line is
84 // larger it will not work correctly. 84 // larger it will not work correctly.
85 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 85 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), false);
86 86
87 { 87 {
88 Label lastb, unaligned, aligned, chkw, 88 Label lastb, unaligned, aligned, chkw,
89 loop16w, chk1w, wordCopy_loop, skip_pref, lastbloop, 89 loop16w, chk1w, wordCopy_loop, skip_pref, lastbloop,
90 leave, ua_chk16w, ua_loop16w, ua_skip_pref, ua_chkw, 90 leave, ua_chk16w, ua_loop16w, ua_skip_pref, ua_chkw,
91 ua_chk1w, ua_wordCopy_loop, ua_smallCopy, ua_smallCopy_loop; 91 ua_chk1w, ua_wordCopy_loop, ua_smallCopy, ua_smallCopy_loop;
92 92
93 // The size of each prefetch. 93 // The size of each prefetch.
94 uint32_t pref_chunk = 32; 94 uint32_t pref_chunk = 32;
95 // The maximum size of a prefetch, it must not be less then pref_chunk. 95 // The maximum size of a prefetch, it must not be less then pref_chunk.
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 604
605 UnaryMathFunction CreateSqrtFunction() { 605 UnaryMathFunction CreateSqrtFunction() {
606 #if defined(USE_SIMULATOR) 606 #if defined(USE_SIMULATOR)
607 return &std::sqrt; 607 return &std::sqrt;
608 #else 608 #else
609 size_t actual_size; 609 size_t actual_size;
610 byte* buffer = 610 byte* buffer =
611 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 611 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
612 if (buffer == NULL) return &std::sqrt; 612 if (buffer == NULL) return &std::sqrt;
613 613
614 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 614 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), false);
615 615
616 __ MovFromFloatParameter(f12); 616 __ MovFromFloatParameter(f12);
617 __ sqrt_d(f0, f12); 617 __ sqrt_d(f0, f12);
618 __ MovToFloatResult(f0); 618 __ MovToFloatResult(f0);
619 __ Ret(); 619 __ Ret();
620 620
621 CodeDesc desc; 621 CodeDesc desc;
622 masm.GetCode(&desc); 622 masm.GetCode(&desc);
623 DCHECK(!RelocInfo::RequiresRelocation(desc)); 623 DCHECK(!RelocInfo::RequiresRelocation(desc));
624 624
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_MIPS 1265 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698