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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 assembler_->set_predictable_code_size(old_value_); | 184 assembler_->set_predictable_code_size(old_value_); |
185 } | 185 } |
186 | 186 |
187 | 187 |
188 // ----------------------------------------------------------------------------- | 188 // ----------------------------------------------------------------------------- |
189 // Implementation of CpuFeatureScope | 189 // Implementation of CpuFeatureScope |
190 | 190 |
191 #ifdef DEBUG | 191 #ifdef DEBUG |
192 CpuFeatureScope::CpuFeatureScope(AssemblerBase* assembler, CpuFeature f) | 192 CpuFeatureScope::CpuFeatureScope(AssemblerBase* assembler, CpuFeature f) |
193 : assembler_(assembler) { | 193 : assembler_(assembler) { |
194 ASSERT(CpuFeatures::IsSafeForSnapshot(f)); | 194 ASSERT(CpuFeatures::IsSafeForSnapshot(assembler_->isolate(), f)); |
195 old_enabled_ = assembler_->enabled_cpu_features(); | 195 old_enabled_ = assembler_->enabled_cpu_features(); |
196 uint64_t mask = static_cast<uint64_t>(1) << f; | 196 uint64_t mask = static_cast<uint64_t>(1) << f; |
197 // TODO(svenpanne) This special case below doesn't belong here! | 197 // TODO(svenpanne) This special case below doesn't belong here! |
198 #if V8_TARGET_ARCH_ARM | 198 #if V8_TARGET_ARCH_ARM |
199 // ARMv7 is implied by VFP3. | 199 // ARMv7 is implied by VFP3. |
200 if (f == VFP3) { | 200 if (f == VFP3) { |
201 mask |= static_cast<uint64_t>(1) << ARMv7; | 201 mask |= static_cast<uint64_t>(1) << ARMv7; |
202 } | 202 } |
203 #endif | 203 #endif |
204 assembler_->set_enabled_cpu_features(old_enabled_ | mask); | 204 assembler_->set_enabled_cpu_features(old_enabled_ | mask); |
205 } | 205 } |
206 | 206 |
207 | 207 |
208 CpuFeatureScope::~CpuFeatureScope() { | 208 CpuFeatureScope::~CpuFeatureScope() { |
209 assembler_->set_enabled_cpu_features(old_enabled_); | 209 assembler_->set_enabled_cpu_features(old_enabled_); |
210 } | 210 } |
211 #endif | 211 #endif |
212 | 212 |
213 | 213 |
214 // ----------------------------------------------------------------------------- | 214 // ----------------------------------------------------------------------------- |
215 // Implementation of PlatformFeatureScope | 215 // Implementation of PlatformFeatureScope |
216 | 216 |
217 PlatformFeatureScope::PlatformFeatureScope(Isolate* isolate, CpuFeature f) | 217 PlatformFeatureScope::PlatformFeatureScope(Isolate* isolate, CpuFeature f) |
218 : isolate_(isolate), old_cross_compile_(CpuFeatures::cross_compile_) { | 218 : isolate_(isolate), old_cross_compile_(CpuFeatures::cross_compile_) { |
219 // CpuFeatures is a global singleton, therefore this is only safe in | 219 // CpuFeatures is a global singleton, therefore this is only safe in |
220 // single threaded code. | 220 // single threaded code. |
221 ASSERT(Serializer::enabled()); | 221 ASSERT(Serializer::enabled(isolate)); |
222 uint64_t mask = static_cast<uint64_t>(1) << f; | 222 uint64_t mask = static_cast<uint64_t>(1) << f; |
223 CpuFeatures::cross_compile_ |= mask; | 223 CpuFeatures::cross_compile_ |= mask; |
224 USE(isolate_); | 224 USE(isolate_); |
225 } | 225 } |
226 | 226 |
227 | 227 |
228 PlatformFeatureScope::~PlatformFeatureScope() { | 228 PlatformFeatureScope::~PlatformFeatureScope() { |
229 CpuFeatures::cross_compile_ = old_cross_compile_; | 229 CpuFeatures::cross_compile_ = old_cross_compile_; |
230 } | 230 } |
231 | 231 |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 r2 = r2 - ad; | 1639 r2 = r2 - ad; |
1640 } | 1640 } |
1641 delta = ad - r2; | 1641 delta = ad - r2; |
1642 } while (q1 < delta || (q1 == delta && r1 == 0)); | 1642 } while (q1 < delta || (q1 == delta && r1 == 0)); |
1643 int32_t mul = static_cast<int32_t>(q2 + 1); | 1643 int32_t mul = static_cast<int32_t>(q2 + 1); |
1644 multiplier_ = (d < 0) ? -mul : mul; | 1644 multiplier_ = (d < 0) ? -mul : mul; |
1645 shift_ = p - 32; | 1645 shift_ = p - 32; |
1646 } | 1646 } |
1647 | 1647 |
1648 } } // namespace v8::internal | 1648 } } // namespace v8::internal |
OLD | NEW |