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 | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are 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 30 matching lines...) Expand all Loading... | |
| 41 #include "arm/assembler-arm-inl.h" | 41 #include "arm/assembler-arm-inl.h" |
| 42 #include "macro-assembler.h" | 42 #include "macro-assembler.h" |
| 43 #include "serialize.h" | 43 #include "serialize.h" |
| 44 | 44 |
| 45 namespace v8 { | 45 namespace v8 { |
| 46 namespace internal { | 46 namespace internal { |
| 47 | 47 |
| 48 #ifdef DEBUG | 48 #ifdef DEBUG |
| 49 bool CpuFeatures::initialized_ = false; | 49 bool CpuFeatures::initialized_ = false; |
| 50 #endif | 50 #endif |
| 51 bool CpuFeatures::hint_creating_snapshot_ = false; | |
| 52 unsigned CpuFeatures::supported_ = 0; | 51 unsigned CpuFeatures::supported_ = 0; |
| 53 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0; | 52 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0; |
| 54 unsigned CpuFeatures::cross_compile_ = 0; | 53 unsigned CpuFeatures::cross_compile_ = 0; |
| 55 unsigned CpuFeatures::cache_line_size_ = 64; | 54 unsigned CpuFeatures::cache_line_size_ = 64; |
| 56 | 55 |
| 57 | 56 |
| 58 ExternalReference ExternalReference::cpu_features() { | 57 ExternalReference ExternalReference::cpu_features() { |
| 59 ASSERT(CpuFeatures::initialized_); | 58 ASSERT(CpuFeatures::initialized_); |
| 60 return ExternalReference(&CpuFeatures::supported_); | 59 return ExternalReference(&CpuFeatures::supported_); |
| 61 } | 60 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 ASSERT(index >= 0 && index < NumAllocatableRegisters()); | 93 ASSERT(index >= 0 && index < NumAllocatableRegisters()); |
| 95 ASSERT(kScratchDoubleReg.code() - kDoubleRegZero.code() == | 94 ASSERT(kScratchDoubleReg.code() - kDoubleRegZero.code() == |
| 96 kNumReservedRegisters - 1); | 95 kNumReservedRegisters - 1); |
| 97 if (index >= kDoubleRegZero.code()) | 96 if (index >= kDoubleRegZero.code()) |
| 98 index += kNumReservedRegisters; | 97 index += kNumReservedRegisters; |
| 99 | 98 |
| 100 return VFPRegisters::Name(index, true); | 99 return VFPRegisters::Name(index, true); |
| 101 } | 100 } |
| 102 | 101 |
| 103 | 102 |
| 104 void CpuFeatures::SetHintCreatingSnapshot() { | |
| 105 hint_creating_snapshot_ = true; | |
| 106 } | |
| 107 | |
| 108 | |
| 109 void CpuFeatures::ProbeWithoutIsolate() { | |
| 110 Probe(hint_creating_snapshot_); | |
| 111 } | |
| 112 | |
| 113 | |
| 114 void CpuFeatures::Probe() { | |
| 115 // The Serializer can only be queried after isolate initialization. | |
| 116 Probe(Serializer::enabled()); | |
| 117 } | |
| 118 | |
| 119 | |
| 120 void CpuFeatures::Probe(bool serializer_enabled) { | 103 void CpuFeatures::Probe(bool serializer_enabled) { |
| 121 uint64_t standard_features = static_cast<unsigned>( | 104 uint64_t standard_features = static_cast<unsigned>( |
| 122 OS::CpuFeaturesImpliedByPlatform()) | CpuFeaturesImpliedByCompiler(); | 105 OS::CpuFeaturesImpliedByPlatform()) | CpuFeaturesImpliedByCompiler(); |
| 123 ASSERT(supported_ == 0 || | 106 ASSERT(supported_ == 0 || |
| 124 (supported_ & standard_features) == standard_features); | 107 (supported_ & standard_features) == standard_features); |
| 125 #ifdef DEBUG | 108 #ifdef DEBUG |
| 126 initialized_ = true; | 109 initialized_ = true; |
| 127 #endif | 110 #endif |
| 128 | 111 |
| 129 // Get the features implied by the OS and the compiler settings. This is the | 112 // Get the features implied by the OS and the compiler settings. This is the |
| 130 // minimal set of features which is also alowed for generated code in the | 113 // minimal set of features which is also alowed for generated code in the |
| 131 // snapshot. | 114 // snapshot. |
| 132 supported_ |= standard_features; | 115 supported_ |= standard_features; |
| 133 | 116 |
| 134 if (serializer_enabled) { | 117 if (serializer_enabled) { |
| 135 // No probing for features if we might serialize (generate snapshot). | 118 // No probing for features if we might serialize (generate snapshot). |
| 136 printf(" "); | |
| 137 PrintFeatures(); | |
|
vincent.belliard
2014/04/29 15:25:17
Why did you removed this display?
It was very usef
Sven Panne
2014/04/30 06:11:16
It is not done for other platforms, it is printed
| |
| 138 return; | 119 return; |
| 139 } | 120 } |
| 140 | 121 |
| 141 #ifndef __arm__ | 122 #ifndef __arm__ |
| 142 // For the simulator=arm build, use VFP when FLAG_enable_vfp3 is | 123 // For the simulator=arm build, use VFP when FLAG_enable_vfp3 is |
| 143 // enabled. VFPv3 implies ARMv7, see ARM DDI 0406B, page A1-6. | 124 // enabled. VFPv3 implies ARMv7, see ARM DDI 0406B, page A1-6. |
| 144 if (FLAG_enable_vfp3) { | 125 if (FLAG_enable_vfp3) { |
| 145 supported_ |= | 126 supported_ |= |
| 146 static_cast<uint64_t>(1) << VFP3 | | 127 static_cast<uint64_t>(1) << VFP3 | |
| 147 static_cast<uint64_t>(1) << ARMv7; | 128 static_cast<uint64_t>(1) << ARMv7; |
| (...skipping 3594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3742 ASSERT((index_64bit == count_of_64bit_) && | 3723 ASSERT((index_64bit == count_of_64bit_) && |
| 3743 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && | 3724 (index_code_ptr == (index_64bit + count_of_code_ptr_)) && |
| 3744 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && | 3725 (index_heap_ptr == (index_code_ptr + count_of_heap_ptr_)) && |
| 3745 (index_32bit == (index_heap_ptr + count_of_32bit_))); | 3726 (index_32bit == (index_heap_ptr + count_of_32bit_))); |
| 3746 } | 3727 } |
| 3747 | 3728 |
| 3748 | 3729 |
| 3749 } } // namespace v8::internal | 3730 } } // namespace v8::internal |
| 3750 | 3731 |
| 3751 #endif // V8_TARGET_ARCH_ARM | 3732 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |