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

Side by Side Diff: src/arm/codegen-arm.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/arm/codegen-arm.h" 5 #include "src/arm/codegen-arm.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/arm/simulator-arm.h" 9 #include "src/arm/simulator-arm.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 15 matching lines...) Expand all
26 #endif 26 #endif
27 27
28 28
29 UnaryMathFunctionWithIsolate CreateExpFunction(Isolate* isolate) { 29 UnaryMathFunctionWithIsolate CreateExpFunction(Isolate* isolate) {
30 size_t actual_size; 30 size_t actual_size;
31 byte* buffer = 31 byte* buffer =
32 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 32 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
33 if (buffer == nullptr) return nullptr; 33 if (buffer == nullptr) return nullptr;
34 ExternalReference::InitializeMathExpData(); 34 ExternalReference::InitializeMathExpData();
35 35
36 MacroAssembler masm(nullptr, buffer, static_cast<int>(actual_size)); 36 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), false);
37 37
38 { 38 {
39 DwVfpRegister input = d0; 39 DwVfpRegister input = d0;
40 DwVfpRegister result = d1; 40 DwVfpRegister result = d1;
41 DwVfpRegister double_scratch1 = d2; 41 DwVfpRegister double_scratch1 = d2;
42 DwVfpRegister double_scratch2 = d3; 42 DwVfpRegister double_scratch2 = d3;
43 Register temp1 = r4; 43 Register temp1 = r4;
44 Register temp2 = r5; 44 Register temp2 = r5;
45 Register temp3 = r6; 45 Register temp3 = r6;
46 46
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub) { 81 MemCopyUint8Function CreateMemCopyUint8Function(MemCopyUint8Function stub) {
82 #if defined(USE_SIMULATOR) 82 #if defined(USE_SIMULATOR)
83 return stub; 83 return stub;
84 #else 84 #else
85 if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub; 85 if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub;
86 size_t actual_size; 86 size_t actual_size;
87 byte* buffer = 87 byte* buffer =
88 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 88 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
89 if (buffer == NULL) return stub; 89 if (buffer == NULL) return stub;
90 90
91 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 91 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), false);
92 92
93 Register dest = r0; 93 Register dest = r0;
94 Register src = r1; 94 Register src = r1;
95 Register chars = r2; 95 Register chars = r2;
96 Register temp1 = r3; 96 Register temp1 = r3;
97 Label less_4; 97 Label less_4;
98 98
99 if (CpuFeatures::IsSupported(NEON)) { 99 if (CpuFeatures::IsSupported(NEON)) {
100 Label loop, less_256, less_128, less_64, less_32, _16_or_less, _8_or_less; 100 Label loop, less_256, less_128, less_64, less_32, _16_or_less, _8_or_less;
101 Label size_less_than_8; 101 Label size_less_than_8;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 MemCopyUint16Uint8Function stub) { 238 MemCopyUint16Uint8Function stub) {
239 #if defined(USE_SIMULATOR) 239 #if defined(USE_SIMULATOR)
240 return stub; 240 return stub;
241 #else 241 #else
242 if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub; 242 if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub;
243 size_t actual_size; 243 size_t actual_size;
244 byte* buffer = 244 byte* buffer =
245 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 245 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
246 if (buffer == NULL) return stub; 246 if (buffer == NULL) return stub;
247 247
248 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 248 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), false);
249 249
250 Register dest = r0; 250 Register dest = r0;
251 Register src = r1; 251 Register src = r1;
252 Register chars = r2; 252 Register chars = r2;
253 if (CpuFeatures::IsSupported(NEON)) { 253 if (CpuFeatures::IsSupported(NEON)) {
254 Register temp = r3; 254 Register temp = r3;
255 Label loop; 255 Label loop;
256 256
257 __ bic(temp, chars, Operand(0x7)); 257 __ bic(temp, chars, Operand(0x7));
258 __ sub(chars, chars, Operand(temp)); 258 __ sub(chars, chars, Operand(temp));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 323
324 UnaryMathFunction CreateSqrtFunction() { 324 UnaryMathFunction CreateSqrtFunction() {
325 #if defined(USE_SIMULATOR) 325 #if defined(USE_SIMULATOR)
326 return &std::sqrt; 326 return &std::sqrt;
327 #else 327 #else
328 size_t actual_size; 328 size_t actual_size;
329 byte* buffer = 329 byte* buffer =
330 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); 330 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true));
331 if (buffer == NULL) return &std::sqrt; 331 if (buffer == NULL) return &std::sqrt;
332 332
333 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 333 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), false);
334 334
335 __ MovFromFloatParameter(d0); 335 __ MovFromFloatParameter(d0);
336 __ vsqrt(d0, d0); 336 __ vsqrt(d0, d0);
337 __ MovToFloatResult(d0); 337 __ MovToFloatResult(d0);
338 __ Ret(); 338 __ Ret();
339 339
340 CodeDesc desc; 340 CodeDesc desc;
341 masm.GetCode(&desc); 341 masm.GetCode(&desc);
342 DCHECK(!RelocInfo::RequiresRelocation(desc)); 342 DCHECK(!RelocInfo::RequiresRelocation(desc));
343 343
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 941 patcher.masm()->ldr(pc, MemOperand(pc, -4));
942 patcher.masm()->emit_code_stub_address(stub); 942 patcher.masm()->emit_code_stub_address(stub);
943 } 943 }
944 } 944 }
945 945
946 946
947 } // namespace internal 947 } // namespace internal
948 } // namespace v8 948 } // namespace v8
949 949
950 #endif // V8_TARGET_ARCH_ARM 950 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698