Index: src/ia32/assembler-ia32.h |
diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h |
index 55eff931907b11e66d05c28c1c177fcc85590aa7..5c0928a5a9b6519f9a9f86bc5c318e48ef19b63f 100644 |
--- a/src/ia32/assembler-ia32.h |
+++ b/src/ia32/assembler-ia32.h |
@@ -535,6 +535,7 @@ class CpuFeatures : public AllStatic { |
// Check whether a feature is supported by the target CPU. |
static bool IsSupported(CpuFeature f) { |
ASSERT(initialized_); |
+ if ((force_feature_ & (static_cast<uint64_t>(1) << f)) != 0) return true; |
Sven Panne
2013/09/16 13:48:05
Lift out
static_cast<uint64_t>(1) << f
into a
|
if (f == SSE2 && !FLAG_enable_sse2) return false; |
if (f == SSE3 && !FLAG_enable_sse3) return false; |
if (f == SSE4_1 && !FLAG_enable_sse4_1) return false; |
@@ -550,13 +551,23 @@ class CpuFeatures : public AllStatic { |
static bool IsSafeForSnapshot(CpuFeature f) { |
return (IsSupported(f) && |
- (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f))); |
+ (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f))) || |
+ ((force_feature_ & (static_cast<uint64_t>(1) << f)) != 0); |
+ } |
+ |
+ static void ForceFeature(CpuFeature f) { |
Sven Panne
2013/09/16 13:48:05
I am not sure about the future use cases, perhaps
|
+ force_feature_ = force_feature_ | (static_cast<uint64_t>(1) << f); |
+ } |
+ |
+ static void ClearForcedFeatures() { |
+ force_feature_ = 0; |
} |
private: |
#ifdef DEBUG |
static bool initialized_; |
#endif |
+ static uint64_t force_feature_; |
static uint64_t supported_; |
static uint64_t found_by_runtime_probing_only_; |