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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 420 |
421 | 421 |
422 // CpuFeatures keeps track of which features are supported by the target CPU. | 422 // CpuFeatures keeps track of which features are supported by the target CPU. |
423 // Supported features must be enabled by a CpuFeatureScope before use. | 423 // Supported features must be enabled by a CpuFeatureScope before use. |
424 class CpuFeatures : public AllStatic { | 424 class CpuFeatures : public AllStatic { |
425 public: | 425 public: |
426 // Detect features of the target CPU. Set safe defaults if the serializer | 426 // Detect features of the target CPU. Set safe defaults if the serializer |
427 // is enabled (snapshots must be portable). | 427 // is enabled (snapshots must be portable). |
428 static void Probe(); | 428 static void Probe(); |
429 | 429 |
| 430 // A special case for printing target and features, which we want to do |
| 431 // before initializing the isolate |
| 432 static void SetHintCreatingSnapshot(); |
| 433 static void ProbeWithoutIsolate(); |
| 434 |
430 // Check whether a feature is supported by the target CPU. | 435 // Check whether a feature is supported by the target CPU. |
431 static bool IsSupported(CpuFeature f) { | 436 static bool IsSupported(CpuFeature f) { |
432 ASSERT(initialized_); | 437 ASSERT(initialized_); |
433 return Check(f, supported_); | 438 return Check(f, supported_); |
434 } | 439 } |
435 | 440 |
436 static bool IsFoundByRuntimeProbingOnly(CpuFeature f) { | 441 static bool IsFoundByRuntimeProbingOnly(CpuFeature f) { |
437 ASSERT(initialized_); | 442 ASSERT(initialized_); |
438 return Check(f, found_by_runtime_probing_only_); | 443 return Check(f, found_by_runtime_probing_only_); |
439 } | 444 } |
440 | 445 |
441 static bool IsSafeForSnapshot(CpuFeature f) { | 446 static bool IsSafeForSnapshot(CpuFeature f) { |
442 return Check(f, cross_compile_) || | 447 return Check(f, cross_compile_) || |
443 (IsSupported(f) && | 448 (IsSupported(f) && |
444 (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f))); | 449 (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f))); |
445 } | 450 } |
446 | 451 |
447 static bool VerifyCrossCompiling() { | 452 static bool VerifyCrossCompiling() { |
448 return cross_compile_ == 0; | 453 return cross_compile_ == 0; |
449 } | 454 } |
450 | 455 |
451 static bool VerifyCrossCompiling(CpuFeature f) { | 456 static bool VerifyCrossCompiling(CpuFeature f) { |
452 unsigned mask = flag2set(f); | 457 unsigned mask = flag2set(f); |
453 return cross_compile_ == 0 || | 458 return cross_compile_ == 0 || |
454 (cross_compile_ & mask) == mask; | 459 (cross_compile_ & mask) == mask; |
455 } | 460 } |
456 | 461 |
457 private: | 462 private: |
| 463 static void Probe(bool serializer_enabled); |
| 464 static bool hint_creating_snapshot_; |
| 465 |
458 static bool Check(CpuFeature f, unsigned set) { | 466 static bool Check(CpuFeature f, unsigned set) { |
459 return (set & flag2set(f)) != 0; | 467 return (set & flag2set(f)) != 0; |
460 } | 468 } |
461 | 469 |
462 static unsigned flag2set(CpuFeature f) { | 470 static unsigned flag2set(CpuFeature f) { |
463 return 1u << f; | 471 return 1u << f; |
464 } | 472 } |
465 | 473 |
466 #ifdef DEBUG | 474 #ifdef DEBUG |
467 static bool initialized_; | 475 static bool initialized_; |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 class EnsureSpace BASE_EMBEDDED { | 1293 class EnsureSpace BASE_EMBEDDED { |
1286 public: | 1294 public: |
1287 explicit EnsureSpace(Assembler* assembler) { | 1295 explicit EnsureSpace(Assembler* assembler) { |
1288 assembler->CheckBuffer(); | 1296 assembler->CheckBuffer(); |
1289 } | 1297 } |
1290 }; | 1298 }; |
1291 | 1299 |
1292 } } // namespace v8::internal | 1300 } } // namespace v8::internal |
1293 | 1301 |
1294 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1302 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |