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 <memory> | 9 #include <memory> |
10 | 10 |
11 #include "src/arm/simulator-arm.h" | 11 #include "src/arm/simulator-arm.h" |
12 #include "src/codegen.h" | 12 #include "src/codegen.h" |
13 #include "src/macro-assembler.h" | 13 #include "src/macro-assembler.h" |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 | 18 |
19 #define __ masm. | 19 #define __ masm. |
20 | 20 |
21 #if defined(V8_HOST_ARCH_ARM) | 21 #if defined(V8_HOST_ARCH_ARM) |
22 MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate, | 22 MemCopyUint8Function CreateMemCopyUint8Function(Isolate* isolate, |
23 MemCopyUint8Function stub) { | 23 MemCopyUint8Function stub) { |
24 #if defined(USE_SIMULATOR) | 24 #if defined(USE_SIMULATOR) |
25 return stub; | 25 return stub; |
26 #else | 26 #else |
27 if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub; | |
28 size_t actual_size; | 27 size_t actual_size; |
29 byte* buffer = | 28 byte* buffer = |
30 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); | 29 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); |
31 if (buffer == nullptr) return stub; | 30 if (buffer == nullptr) return stub; |
32 | 31 |
33 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), | 32 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), |
34 CodeObjectRequired::kNo); | 33 CodeObjectRequired::kNo); |
35 | 34 |
36 Register dest = r0; | 35 Register dest = r0; |
37 Register src = r1; | 36 Register src = r1; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 #endif | 174 #endif |
176 } | 175 } |
177 | 176 |
178 | 177 |
179 // Convert 8 to 16. The number of character to copy must be at least 8. | 178 // Convert 8 to 16. The number of character to copy must be at least 8. |
180 MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( | 179 MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( |
181 Isolate* isolate, MemCopyUint16Uint8Function stub) { | 180 Isolate* isolate, MemCopyUint16Uint8Function stub) { |
182 #if defined(USE_SIMULATOR) | 181 #if defined(USE_SIMULATOR) |
183 return stub; | 182 return stub; |
184 #else | 183 #else |
185 if (!CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) return stub; | |
186 size_t actual_size; | 184 size_t actual_size; |
187 byte* buffer = | 185 byte* buffer = |
188 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); | 186 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); |
189 if (buffer == nullptr) return stub; | 187 if (buffer == nullptr) return stub; |
190 | 188 |
191 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), | 189 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), |
192 CodeObjectRequired::kNo); | 190 CodeObjectRequired::kNo); |
193 | 191 |
194 Register dest = r0; | 192 Register dest = r0; |
195 Register src = r1; | 193 Register src = r1; |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 800 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
803 patcher.masm()->emit_code_stub_address(stub); | 801 patcher.masm()->emit_code_stub_address(stub); |
804 } | 802 } |
805 } | 803 } |
806 | 804 |
807 | 805 |
808 } // namespace internal | 806 } // namespace internal |
809 } // namespace v8 | 807 } // namespace v8 |
810 | 808 |
811 #endif // V8_TARGET_ARCH_ARM | 809 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |