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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 if (f == FPU && !FLAG_enable_fpu) return false; | 406 if (f == FPU && !FLAG_enable_fpu) return false; |
407 return (supported_ & (1u << f)) != 0; | 407 return (supported_ & (1u << f)) != 0; |
408 } | 408 } |
409 | 409 |
410 static bool IsFoundByRuntimeProbingOnly(CpuFeature f) { | 410 static bool IsFoundByRuntimeProbingOnly(CpuFeature f) { |
411 ASSERT(initialized_); | 411 ASSERT(initialized_); |
412 return (found_by_runtime_probing_only_ & | 412 return (found_by_runtime_probing_only_ & |
413 (static_cast<uint64_t>(1) << f)) != 0; | 413 (static_cast<uint64_t>(1) << f)) != 0; |
414 } | 414 } |
415 | 415 |
416 class TryForceFeatureScope BASE_EMBEDDED { | |
417 public: | |
418 explicit TryForceFeatureScope(CpuFeature f) | |
419 : old_supported_(CpuFeatures::supported_) { | |
420 if (CanForce()) { | |
421 CpuFeatures::supported_ |= (1u << f); | |
422 } | |
423 } | |
424 | |
425 ~TryForceFeatureScope() { | |
426 if (CanForce()) { | |
427 CpuFeatures::supported_ = old_supported_; | |
428 } | |
429 } | |
430 | |
431 private: | |
432 static bool CanForce() { | |
433 // It's only safe to temporarily force support of CPU features | |
434 // when there's only a single isolate, which is guaranteed when | |
435 // the serializer is enabled. | |
436 return Serializer::enabled(); | |
437 } | |
438 | |
439 const unsigned old_supported_; | |
440 }; | |
441 | |
442 private: | 416 private: |
443 #ifdef DEBUG | 417 #ifdef DEBUG |
444 static bool initialized_; | 418 static bool initialized_; |
445 #endif | 419 #endif |
446 static unsigned supported_; | 420 static unsigned supported_; |
447 static unsigned found_by_runtime_probing_only_; | 421 static unsigned found_by_runtime_probing_only_; |
448 | 422 |
449 friend class ExternalReference; | 423 friend class ExternalReference; |
450 DISALLOW_COPY_AND_ASSIGN(CpuFeatures); | 424 DISALLOW_COPY_AND_ASSIGN(CpuFeatures); |
451 }; | 425 }; |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 class EnsureSpace BASE_EMBEDDED { | 1203 class EnsureSpace BASE_EMBEDDED { |
1230 public: | 1204 public: |
1231 explicit EnsureSpace(Assembler* assembler) { | 1205 explicit EnsureSpace(Assembler* assembler) { |
1232 assembler->CheckBuffer(); | 1206 assembler->CheckBuffer(); |
1233 } | 1207 } |
1234 }; | 1208 }; |
1235 | 1209 |
1236 } } // namespace v8::internal | 1210 } } // namespace v8::internal |
1237 | 1211 |
1238 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1212 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |