Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 CpuFeatureScope::~CpuFeatureScope() { | 203 CpuFeatureScope::~CpuFeatureScope() { |
| 204 assembler_->set_enabled_cpu_features(old_enabled_); | 204 assembler_->set_enabled_cpu_features(old_enabled_); |
| 205 } | 205 } |
| 206 #endif | 206 #endif |
| 207 | 207 |
| 208 | 208 |
| 209 // ----------------------------------------------------------------------------- | 209 // ----------------------------------------------------------------------------- |
| 210 // Implementation of PlatformFeatureScope | |
| 211 | |
| 212 PlatformFeatureScope::PlatformFeatureScope(CpuFeature f) | |
| 213 : old_supported_(CpuFeatures::supported_), | |
| 214 old_found_by_runtime_probing_only_( | |
| 215 CpuFeatures::found_by_runtime_probing_only_) { | |
| 216 uint64_t mask = static_cast<uint64_t>(1) << f; | |
| 217 CpuFeatures::supported_ |= mask; | |
| 218 CpuFeatures::found_by_runtime_probing_only_ |= mask; | |
|
Sven Panne
2013/09/17 12:37:35
Huh? "... &= ~mask" seems to be more straightforwa
| |
| 219 CpuFeatures::found_by_runtime_probing_only_ ^= mask; | |
| 220 } | |
| 221 | |
| 222 | |
| 223 PlatformFeatureScope::~PlatformFeatureScope() { | |
| 224 CpuFeatures::supported_ = old_supported_; | |
| 225 CpuFeatures::found_by_runtime_probing_only_ = | |
| 226 old_found_by_runtime_probing_only_; | |
| 227 } | |
| 228 | |
| 229 | |
| 230 // ----------------------------------------------------------------------------- | |
| 210 // Implementation of Label | 231 // Implementation of Label |
| 211 | 232 |
| 212 int Label::pos() const { | 233 int Label::pos() const { |
| 213 if (pos_ < 0) return -pos_ - 1; | 234 if (pos_ < 0) return -pos_ - 1; |
| 214 if (pos_ > 0) return pos_ - 1; | 235 if (pos_ > 0) return pos_ - 1; |
| 215 UNREACHABLE(); | 236 UNREACHABLE(); |
| 216 return 0; | 237 return 0; |
| 217 } | 238 } |
| 218 | 239 |
| 219 | 240 |
| (...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1676 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1697 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
| 1677 state_.written_position = state_.current_position; | 1698 state_.written_position = state_.current_position; |
| 1678 written = true; | 1699 written = true; |
| 1679 } | 1700 } |
| 1680 | 1701 |
| 1681 // Return whether something was written. | 1702 // Return whether something was written. |
| 1682 return written; | 1703 return written; |
| 1683 } | 1704 } |
| 1684 | 1705 |
| 1685 } } // namespace v8::internal | 1706 } } // namespace v8::internal |
| OLD | NEW |