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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 namespace v8 { | 50 namespace v8 { |
51 namespace internal { | 51 namespace internal { |
52 | 52 |
53 // CpuFeatures keeps track of which features are supported by the target CPU. | 53 // CpuFeatures keeps track of which features are supported by the target CPU. |
54 // Supported features must be enabled by a CpuFeatureScope before use. | 54 // Supported features must be enabled by a CpuFeatureScope before use. |
55 class CpuFeatures : public AllStatic { | 55 class CpuFeatures : public AllStatic { |
56 public: | 56 public: |
57 // Detect features of the target CPU. Set safe defaults if the serializer | 57 // Detect features of the target CPU. Set safe defaults if the serializer |
58 // is enabled (snapshots must be portable). | 58 // is enabled (snapshots must be portable). |
59 static void Probe(); | 59 static void Probe(bool serializer_enabled); |
60 | |
61 // A special case for printing target and features, which we want to do | |
62 // before initializing the isolate | |
63 static void SetHintCreatingSnapshot(); | |
64 static void ProbeWithoutIsolate(); | |
65 | 60 |
66 // Display target use when compiling. | 61 // Display target use when compiling. |
67 static void PrintTarget(); | 62 static void PrintTarget(); |
68 | 63 |
69 // Display features. | 64 // Display features. |
70 static void PrintFeatures(); | 65 static void PrintFeatures(); |
71 | 66 |
72 // Check whether a feature is supported by the target CPU. | 67 // Check whether a feature is supported by the target CPU. |
73 static bool IsSupported(CpuFeature f) { | 68 static bool IsSupported(CpuFeature f) { |
74 ASSERT(initialized_); | 69 ASSERT(initialized_); |
(...skipping 16 matching lines...) Expand all Loading... |
91 static bool VerifyCrossCompiling() { | 86 static bool VerifyCrossCompiling() { |
92 return cross_compile_ == 0; | 87 return cross_compile_ == 0; |
93 } | 88 } |
94 | 89 |
95 static bool VerifyCrossCompiling(CpuFeature f) { | 90 static bool VerifyCrossCompiling(CpuFeature f) { |
96 unsigned mask = flag2set(f); | 91 unsigned mask = flag2set(f); |
97 return cross_compile_ == 0 || | 92 return cross_compile_ == 0 || |
98 (cross_compile_ & mask) == mask; | 93 (cross_compile_ & mask) == mask; |
99 } | 94 } |
100 | 95 |
| 96 static bool SupportsCrankshaft() { return CpuFeatures::IsSupported(VFP3); } |
| 97 |
101 private: | 98 private: |
102 static void Probe(bool serializer_enabled); | |
103 static bool hint_creating_snapshot_; | |
104 | |
105 static bool Check(CpuFeature f, unsigned set) { | 99 static bool Check(CpuFeature f, unsigned set) { |
106 return (set & flag2set(f)) != 0; | 100 return (set & flag2set(f)) != 0; |
107 } | 101 } |
108 | 102 |
109 static unsigned flag2set(CpuFeature f) { | 103 static unsigned flag2set(CpuFeature f) { |
110 return 1u << f; | 104 return 1u << f; |
111 } | 105 } |
112 | 106 |
113 #ifdef DEBUG | 107 #ifdef DEBUG |
114 static bool initialized_; | 108 static bool initialized_; |
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 public: | 1691 public: |
1698 explicit EnsureSpace(Assembler* assembler) { | 1692 explicit EnsureSpace(Assembler* assembler) { |
1699 assembler->CheckBuffer(); | 1693 assembler->CheckBuffer(); |
1700 } | 1694 } |
1701 }; | 1695 }; |
1702 | 1696 |
1703 | 1697 |
1704 } } // namespace v8::internal | 1698 } } // namespace v8::internal |
1705 | 1699 |
1706 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1700 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |