OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #endif | 42 #endif |
43 unsigned CpuFeatures::supported_ = 0; | 43 unsigned CpuFeatures::supported_ = 0; |
44 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0; | 44 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0; |
45 unsigned CpuFeatures::cross_compile_ = 0; | 45 unsigned CpuFeatures::cross_compile_ = 0; |
46 | 46 |
47 // Initialise to smallest possible cache size. | 47 // Initialise to smallest possible cache size. |
48 unsigned CpuFeatures::dcache_line_size_ = 1; | 48 unsigned CpuFeatures::dcache_line_size_ = 1; |
49 unsigned CpuFeatures::icache_line_size_ = 1; | 49 unsigned CpuFeatures::icache_line_size_ = 1; |
50 | 50 |
51 | 51 |
52 void CPU::SetUp() { | |
53 CpuFeatures::Probe(); | |
54 } | |
55 | |
56 | |
57 bool CPU::SupportsCrankshaft() { | |
58 return true; | |
59 } | |
60 | |
61 | |
62 void CPU::FlushICache(void* address, size_t length) { | 52 void CPU::FlushICache(void* address, size_t length) { |
63 if (length == 0) { | 53 if (length == 0) { |
64 return; | 54 return; |
65 } | 55 } |
66 | 56 |
67 #ifdef USE_SIMULATOR | 57 #ifdef USE_SIMULATOR |
68 // TODO(all): consider doing some cache simulation to ensure every address | 58 // TODO(all): consider doing some cache simulation to ensure every address |
69 // run has been synced. | 59 // run has been synced. |
70 USE(address); | 60 USE(address); |
71 USE(length); | 61 USE(length); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 [isize] "r" (isize), | 122 [isize] "r" (isize), |
133 [end] "r" (end) | 123 [end] "r" (end) |
134 // This code does not write to memory but without the dependency gcc might | 124 // This code does not write to memory but without the dependency gcc might |
135 // move this code before the code is generated. | 125 // move this code before the code is generated. |
136 : "cc", "memory" | 126 : "cc", "memory" |
137 ); // NOLINT | 127 ); // NOLINT |
138 #endif | 128 #endif |
139 } | 129 } |
140 | 130 |
141 | 131 |
142 void CpuFeatures::Probe() { | 132 void CpuFeatures::Probe(bool serializer_enabled) { |
143 // Compute I and D cache line size. The cache type register holds | 133 // Compute I and D cache line size. The cache type register holds |
144 // information about the caches. | 134 // information about the caches. |
145 uint32_t cache_type_register = GetCacheType(); | 135 uint32_t cache_type_register = GetCacheType(); |
146 | 136 |
147 static const int kDCacheLineSizeShift = 16; | 137 static const int kDCacheLineSizeShift = 16; |
148 static const int kICacheLineSizeShift = 0; | 138 static const int kICacheLineSizeShift = 0; |
149 static const uint32_t kDCacheLineSizeMask = 0xf << kDCacheLineSizeShift; | 139 static const uint32_t kDCacheLineSizeMask = 0xf << kDCacheLineSizeShift; |
150 static const uint32_t kICacheLineSizeMask = 0xf << kICacheLineSizeShift; | 140 static const uint32_t kICacheLineSizeMask = 0xf << kICacheLineSizeShift; |
151 | 141 |
152 // The cache type register holds the size of the I and D caches as a power of | 142 // The cache type register holds the size of the I and D caches as a power of |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // Copy the content of the cache type register to a core register. | 180 // Copy the content of the cache type register to a core register. |
191 __asm__ __volatile__ ("mrs %[ctr], ctr_el0" // NOLINT | 181 __asm__ __volatile__ ("mrs %[ctr], ctr_el0" // NOLINT |
192 : [ctr] "=r" (cache_type_register)); | 182 : [ctr] "=r" (cache_type_register)); |
193 return cache_type_register; | 183 return cache_type_register; |
194 #endif | 184 #endif |
195 } | 185 } |
196 | 186 |
197 } } // namespace v8::internal | 187 } } // namespace v8::internal |
198 | 188 |
199 #endif // V8_TARGET_ARCH_ARM64 | 189 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |