OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 | 6 |
7 #if defined(TARGET_ARCH_ARM64) | 7 #if defined(TARGET_ARCH_ARM64) |
8 | 8 |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/cpuinfo.h" | 10 #include "vm/cpuinfo.h" |
11 #include "vm/simulator.h" | 11 #include "vm/simulator.h" |
12 | 12 |
13 #if !defined(USING_SIMULATOR) | 13 #if !defined(USING_SIMULATOR) |
14 #include <sys/syscall.h> /* NOLINT */ | 14 #include <sys/syscall.h> /* NOLINT */ |
15 #include <unistd.h> /* NOLINT */ | 15 #include <unistd.h> /* NOLINT */ |
16 #endif | 16 #endif |
17 | 17 |
18 namespace dart { | 18 namespace dart { |
19 | 19 |
20 void CPU::FlushICache(uword start, uword size) { | 20 void CPU::FlushICache(uword start, uword size) { |
21 #if !defined(USING_SIMULATOR) | 21 #if TARGET_OS_IOS |
| 22 // Precompilation never patches code so there should be no I cache flushes. |
| 23 UNREACHABLE(); |
| 24 #endif |
| 25 |
| 26 #if !defined(USING_SIMULATOR) && !TARGET_OS_IOS |
22 // Nothing to do. Flushing no instructions. | 27 // Nothing to do. Flushing no instructions. |
23 if (size == 0) { | 28 if (size == 0) { |
24 return; | 29 return; |
25 } | 30 } |
26 | 31 |
27 // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android. | 32 // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android. |
28 // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/ | 33 // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/ |
29 #if defined(__linux__) || defined(ANDROID) | 34 #if defined(__linux__) || defined(ANDROID) |
30 extern void __clear_cache(char*, char*); | 35 extern void __clear_cache(char*, char*); |
31 char* beg = reinterpret_cast<char*>(start); | 36 char* beg = reinterpret_cast<char*>(start); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ASSERT(hardware_ != NULL); | 99 ASSERT(hardware_ != NULL); |
95 free(const_cast<char*>(hardware_)); | 100 free(const_cast<char*>(hardware_)); |
96 hardware_ = NULL; | 101 hardware_ = NULL; |
97 CpuInfo::Cleanup(); | 102 CpuInfo::Cleanup(); |
98 } | 103 } |
99 #endif // !defined(USING_SIMULATOR) | 104 #endif // !defined(USING_SIMULATOR) |
100 | 105 |
101 } // namespace dart | 106 } // namespace dart |
102 | 107 |
103 #endif // defined TARGET_ARCH_ARM64 | 108 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |