Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 // CPU specific code for arm independent of OS goes here. | 5 // CPU specific code for arm independent of OS goes here. |
| 6 | 6 |
| 7 #include "v8.h" | 7 #include "v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_ARM64 | 9 #if V8_TARGET_ARCH_ARM64 |
| 10 | 10 |
| 11 #include "arm64/cpu-arm64.h" | 11 #include "arm64/cpu-arm64.h" |
| 12 #include "arm64/utils-arm64.h" | 12 #include "arm64/utils-arm64.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 #ifdef DEBUG | 17 #ifdef DEBUG |
| 18 bool CpuFeatures::initialized_ = false; | 18 bool CpuFeatures::initialized_ = false; |
| 19 #endif | 19 #endif |
| 20 unsigned CpuFeatures::supported_ = 0; | 20 unsigned CpuFeatures::supported_ = 0; |
| 21 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0; | |
| 21 unsigned CpuFeatures::cross_compile_ = 0; | 22 unsigned CpuFeatures::cross_compile_ = 0; |
| 22 | 23 |
| 23 | 24 |
| 24 class CacheLineSizes { | 25 class CacheLineSizes { |
| 25 public: | 26 public: |
| 26 CacheLineSizes() { | 27 CacheLineSizes() { |
| 27 #ifdef USE_SIMULATOR | 28 #ifdef USE_SIMULATOR |
| 28 cache_type_register_ = 0; | 29 cache_type_register_ = 0; |
| 29 #else | 30 #else |
| 30 // Copy the content of the cache type register to a core register. | 31 // Copy the content of the cache type register to a core register. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 [end] "r" (end) | 120 [end] "r" (end) |
| 120 // This code does not write to memory but without the dependency gcc might | 121 // This code does not write to memory but without the dependency gcc might |
| 121 // move this code before the code is generated. | 122 // move this code before the code is generated. |
| 122 : "cc", "memory" | 123 : "cc", "memory" |
| 123 ); // NOLINT | 124 ); // NOLINT |
| 124 #endif | 125 #endif |
| 125 } | 126 } |
| 126 | 127 |
| 127 | 128 |
| 128 void CpuFeatures::Probe(bool serializer_enabled) { | 129 void CpuFeatures::Probe(bool serializer_enabled) { |
| 129 // AArch64 has no configuration options, no further probing is required. | 130 ASSERT(supported_ == 0); |
| 130 supported_ = 0; | 131 |
| 132 if (serializer_enabled && FLAG_enable_always_align_csp) { | |
| 133 // Always align csp in snapshot code - this is safe and ensures that csp | |
| 134 // will always be aligned if it is enabled by probing at runtime. | |
| 135 supported_ |= | |
| 136 static_cast<uint64_t>(1) << ALWAYS_ALIGN_CSP; | |
|
jbramley
2014/05/06 14:02:30
Doesn't that fit on one line?
rmcilroy
2014/05/06 15:55:12
Done.
| |
| 137 } | |
| 138 | |
| 139 if (!serializer_enabled) { | |
| 140 CPU cpu; | |
| 141 // Always align csp on Nvidia cores. | |
| 142 if (cpu.implementer() == CPU::NVIDIA && FLAG_enable_always_align_csp) { | |
| 143 found_by_runtime_probing_only_ |= | |
| 144 static_cast<uint64_t>(1) << ALWAYS_ALIGN_CSP; | |
| 145 } | |
| 146 | |
| 147 supported_ |= found_by_runtime_probing_only_; | |
| 148 } | |
| 131 | 149 |
| 132 #ifdef DEBUG | 150 #ifdef DEBUG |
| 133 initialized_ = true; | 151 initialized_ = true; |
| 134 #endif | 152 #endif |
| 135 } | 153 } |
| 136 | 154 |
| 137 | 155 |
| 138 } } // namespace v8::internal | 156 } } // namespace v8::internal |
| 139 | 157 |
| 140 #endif // V8_TARGET_ARCH_ARM64 | 158 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |