Chromium Code Reviews| Index: src/arm/assembler-arm.h |
| =================================================================== |
| --- src/arm/assembler-arm.h (revision 3292) |
| +++ src/arm/assembler-arm.h (working copy) |
| @@ -435,16 +435,32 @@ |
| static bool IsSupported(Feature f) { |
| if (f == VFP3 && !FLAG_enable_vfp3) return false; |
| - return (supported_ & (static_cast<uint64_t>(1) << f)) != 0; |
| + return (supported_ & (1u << f)) != 0; |
| } |
| // Check whether a feature is currently enabled. |
| static bool IsEnabled(Feature f) { |
| - return (enabled_ & (static_cast<uint64_t>(1) << f)) != 0; |
| + return (enabled_ & (1u << f)) != 0; |
| } |
| + class Scope BASE_EMBEDDED { |
|
Mads Ager (chromium)
2009/11/12 13:25:24
Could you add the
// Enable a specified feature w
Erik Corry
2009/11/12 13:42:37
Done.
|
| +#ifdef DEBUG |
| + public: |
| + explicit Scope(Feature f) { |
| + ASSERT(CpuFeatures::IsSupported(f)); |
| + old_enabled_ = CpuFeatures::enabled_; |
| + CpuFeatures::enabled_ |= 1u << f; |
| + } |
| + ~Scope() { CpuFeatures::enabled_ = old_enabled_; } |
| + private: |
| + unsigned old_enabled_; |
| +#else |
| + public: |
| + explicit Scope(Feature f) {} |
| +#endif |
| + }; |
| private: |
| - static uint64_t supported_; |
| - static uint64_t enabled_; |
| + static unsigned supported_; |
| + static unsigned enabled_; |
| }; |