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 #ifndef V8_ARM64_CPU_ARM64_H_ | 5 #ifndef V8_ARM64_CPU_ARM64_H_ |
6 #define V8_ARM64_CPU_ARM64_H_ | 6 #define V8_ARM64_CPU_ARM64_H_ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include "serialize.h" | 9 #include "serialize.h" |
10 #include "cpu.h" | 10 #include "cpu.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 | 15 |
16 // CpuFeatures keeps track of which features are supported by the target CPU. | 16 // CpuFeatures keeps track of which features are supported by the target CPU. |
17 // Supported features must be enabled by a CpuFeatureScope before use. | 17 // Supported features must be enabled by a CpuFeatureScope before use. |
18 class CpuFeatures : public AllStatic { | 18 class CpuFeatures : public AllStatic { |
19 public: | 19 public: |
20 // Detect features of the target CPU. Set safe defaults if the serializer | 20 // Detect features of the target CPU. Set safe defaults if the serializer |
21 // is enabled (snapshots must be portable). | 21 // is enabled (snapshots must be portable). |
22 static void Probe(bool serializer_enabled); | 22 static void Probe(bool serializer_enabled); |
23 | 23 |
24 // Check whether a feature is supported by the target CPU. | 24 // Check whether a feature is supported by the target CPU. |
25 static bool IsSupported(CpuFeature f) { | 25 static bool IsSupported(CpuFeature f) { |
26 ASSERT(initialized_); | 26 ASSERT(initialized_); |
27 return Check(f, supported_); | 27 return Check(f, supported_); |
28 }; | 28 } |
29 | 29 |
30 static bool IsSafeForSnapshot(Isolate* isolate, CpuFeature f) { | 30 static bool IsSafeForSnapshot(Isolate* isolate, CpuFeature f) { |
31 return IsSupported(f); | 31 return IsSupported(f); |
32 } | 32 } |
33 | 33 |
34 // I and D cache line size in bytes. | 34 // I and D cache line size in bytes. |
35 static unsigned dcache_line_size(); | 35 static unsigned dcache_line_size(); |
36 static unsigned icache_line_size(); | 36 static unsigned icache_line_size(); |
37 | 37 |
38 static unsigned supported_; | 38 static unsigned supported_; |
(...skipping 26 matching lines...) Expand all Loading... |
65 return 1u << f; | 65 return 1u << f; |
66 } | 66 } |
67 | 67 |
68 friend class PlatformFeatureScope; | 68 friend class PlatformFeatureScope; |
69 DISALLOW_COPY_AND_ASSIGN(CpuFeatures); | 69 DISALLOW_COPY_AND_ASSIGN(CpuFeatures); |
70 }; | 70 }; |
71 | 71 |
72 } } // namespace v8::internal | 72 } } // namespace v8::internal |
73 | 73 |
74 #endif // V8_ARM64_CPU_ARM64_H_ | 74 #endif // V8_ARM64_CPU_ARM64_H_ |
OLD | NEW |