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