OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 28 matching lines...) Expand all Loading... |
39 // Implementation of CpuFeatures | 39 // Implementation of CpuFeatures |
40 | 40 |
41 | 41 |
42 #ifdef DEBUG | 42 #ifdef DEBUG |
43 bool CpuFeatures::initialized_ = false; | 43 bool CpuFeatures::initialized_ = false; |
44 #endif | 44 #endif |
45 uint64_t CpuFeatures::supported_ = CpuFeatures::kDefaultCpuFeatures; | 45 uint64_t CpuFeatures::supported_ = CpuFeatures::kDefaultCpuFeatures; |
46 uint64_t CpuFeatures::found_by_runtime_probing_ = 0; | 46 uint64_t CpuFeatures::found_by_runtime_probing_ = 0; |
47 | 47 |
48 | 48 |
| 49 ExternalReference ExternalReference::cpu_features() { |
| 50 ASSERT(CpuFeatures::initialized_); |
| 51 return ExternalReference(&CpuFeatures::supported_); |
| 52 } |
| 53 |
| 54 |
49 void CpuFeatures::Probe() { | 55 void CpuFeatures::Probe() { |
50 ASSERT(supported_ == CpuFeatures::kDefaultCpuFeatures); | 56 ASSERT(supported_ == CpuFeatures::kDefaultCpuFeatures); |
51 #ifdef DEBUG | 57 #ifdef DEBUG |
52 initialized_ = true; | 58 initialized_ = true; |
53 #endif | 59 #endif |
54 supported_ = kDefaultCpuFeatures; | 60 supported_ = kDefaultCpuFeatures; |
55 if (Serializer::enabled()) { | 61 if (Serializer::enabled()) { |
56 supported_ |= OS::CpuFeaturesImpliedByPlatform(); | 62 supported_ |= OS::CpuFeaturesImpliedByPlatform(); |
57 return; // No features if we might serialize. | 63 return; // No features if we might serialize. |
58 } | 64 } |
(...skipping 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3050 bool RelocInfo::IsCodedSpecially() { | 3056 bool RelocInfo::IsCodedSpecially() { |
3051 // The deserializer needs to know whether a pointer is specially coded. Being | 3057 // The deserializer needs to know whether a pointer is specially coded. Being |
3052 // specially coded on x64 means that it is a relative 32 bit address, as used | 3058 // specially coded on x64 means that it is a relative 32 bit address, as used |
3053 // by branch instructions. | 3059 // by branch instructions. |
3054 return (1 << rmode_) & kApplyMask; | 3060 return (1 << rmode_) & kApplyMask; |
3055 } | 3061 } |
3056 | 3062 |
3057 } } // namespace v8::internal | 3063 } } // namespace v8::internal |
3058 | 3064 |
3059 #endif // V8_TARGET_ARCH_X64 | 3065 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |