Index: src/arm/assembler-arm.h |
diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h |
index 12cee5416fe6893dc2d1f2f570e9778ac5119649..6b00f32526af9d7c4bb02899b2103f24e180b75c 100644 |
--- a/src/arm/assembler-arm.h |
+++ b/src/arm/assembler-arm.h |
@@ -48,7 +48,7 @@ namespace v8 { |
namespace internal { |
// CpuFeatures keeps track of which features are supported by the target CPU. |
-// Supported features must be enabled by a Scope before use. |
+// Supported features must be enabled by a CpuFeatureScope before use. |
class CpuFeatures : public AllStatic { |
public: |
// Detect features of the target CPU. Set safe defaults if the serializer |
@@ -68,56 +68,11 @@ class CpuFeatures : public AllStatic { |
return (supported_ & (1u << f)) != 0; |
} |
-#ifdef DEBUG |
- // Check whether a feature is currently enabled. |
- static bool IsEnabled(CpuFeature f) { |
+ static bool IsFoundByRuntimeProbingOnly(CpuFeature f) { |
ASSERT(initialized_); |
- Isolate* isolate = Isolate::UncheckedCurrent(); |
- if (isolate == NULL) { |
- // When no isolate is available, work as if we're running in |
- // release mode. |
- return IsSupported(f); |
- } |
- unsigned enabled = static_cast<unsigned>(isolate->enabled_cpu_features()); |
- return (enabled & (1u << f)) != 0; |
+ return (found_by_runtime_probing_only_ & |
+ (static_cast<uint64_t>(1) << f)) != 0; |
} |
-#endif |
- |
- // Enable a specified feature within a scope. |
- class Scope BASE_EMBEDDED { |
-#ifdef DEBUG |
- |
- public: |
- explicit Scope(CpuFeature f) { |
- unsigned mask = 1u << f; |
- // VFP2 and ARMv7 are implied by VFP3. |
- if (f == VFP3) mask |= 1u << VFP2 | 1u << ARMv7; |
- ASSERT(CpuFeatures::IsSupported(f)); |
- ASSERT(!Serializer::enabled() || |
- (CpuFeatures::found_by_runtime_probing_ & mask) == 0); |
- isolate_ = Isolate::UncheckedCurrent(); |
- old_enabled_ = 0; |
- if (isolate_ != NULL) { |
- old_enabled_ = static_cast<unsigned>(isolate_->enabled_cpu_features()); |
- isolate_->set_enabled_cpu_features(old_enabled_ | mask); |
- } |
- } |
- ~Scope() { |
- ASSERT_EQ(Isolate::UncheckedCurrent(), isolate_); |
- if (isolate_ != NULL) { |
- isolate_->set_enabled_cpu_features(old_enabled_); |
- } |
- } |
- |
- private: |
- Isolate* isolate_; |
- unsigned old_enabled_; |
-#else |
- |
- public: |
- explicit Scope(CpuFeature f) {} |
-#endif |
- }; |
class TryForceFeatureScope BASE_EMBEDDED { |
public: |
@@ -150,7 +105,7 @@ class CpuFeatures : public AllStatic { |
static bool initialized_; |
#endif |
static unsigned supported_; |
- static unsigned found_by_runtime_probing_; |
+ static unsigned found_by_runtime_probing_only_; |
friend class ExternalReference; |
DISALLOW_COPY_AND_ASSIGN(CpuFeatures); |