OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_TYPES_H_ | 5 #ifndef V8_TYPES_H_ |
6 #define V8_TYPES_H_ | 6 #define V8_TYPES_H_ |
7 | 7 |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/ostreams.h" | 10 #include "src/ostreams.h" |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 UnionHandle unioned, int current_size, TypeHandle t, | 478 UnionHandle unioned, int current_size, TypeHandle t, |
479 TypeHandle other, bool is_intersect, Region* region); | 479 TypeHandle other, bool is_intersect, Region* region); |
480 }; | 480 }; |
481 | 481 |
482 | 482 |
483 // ----------------------------------------------------------------------------- | 483 // ----------------------------------------------------------------------------- |
484 // Bitset types (internal). | 484 // Bitset types (internal). |
485 | 485 |
486 template<class Config> | 486 template<class Config> |
487 class TypeImpl<Config>::BitsetType : public TypeImpl<Config> { | 487 class TypeImpl<Config>::BitsetType : public TypeImpl<Config> { |
488 protected: | 488 public: // protected: |
489 friend class TypeImpl<Config>; | 489 friend class TypeImpl<Config>; |
490 | 490 |
491 enum { | 491 enum { |
492 #define DECLARE_TYPE(type, value) k##type = (value), | 492 #define DECLARE_TYPE(type, value) k##type = (value), |
493 BITSET_TYPE_LIST(DECLARE_TYPE) | 493 BITSET_TYPE_LIST(DECLARE_TYPE) |
494 #undef DECLARE_TYPE | 494 #undef DECLARE_TYPE |
495 kUnusedEOL = 0 | 495 kUnusedEOL = 0 |
496 }; | 496 }; |
497 | 497 |
498 bitset Bitset() { return Config::as_bitset(this); } | 498 bitset Bitset() { return Config::as_bitset(this); } |
499 | 499 |
500 static TypeImpl* New(bitset bits) { | 500 static TypeImpl* New(bitset bits) { return Config::from_bitset(bits); } |
501 return static_cast<BitsetType*>(Config::from_bitset(bits)); | |
502 } | |
503 static TypeHandle New(bitset bits, Region* region) { | 501 static TypeHandle New(bitset bits, Region* region) { |
504 return Config::from_bitset(bits, region); | 502 return Config::from_bitset(bits, region); |
505 } | 503 } |
506 | 504 |
507 static bool IsInhabited(bitset bits) { | 505 static bool IsInhabited(bitset bits) { |
508 return (bits & kRepresentation) && (bits & kSemantic); | 506 return (bits & kRepresentation) && (bits & kSemantic); |
509 } | 507 } |
510 | 508 |
511 static bool Is(bitset bits1, bitset bits2) { | 509 static bool Is(bitset bits1, bitset bits2) { |
512 return (bits1 | bits2) == bits2; | 510 return (bits1 | bits2) == bits2; |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 bool Narrows(BoundsImpl that) { | 994 bool Narrows(BoundsImpl that) { |
997 return that.lower->Is(this->lower) && this->upper->Is(that.upper); | 995 return that.lower->Is(this->lower) && this->upper->Is(that.upper); |
998 } | 996 } |
999 }; | 997 }; |
1000 | 998 |
1001 typedef BoundsImpl<ZoneTypeConfig> Bounds; | 999 typedef BoundsImpl<ZoneTypeConfig> Bounds; |
1002 | 1000 |
1003 } } // namespace v8::internal | 1001 } } // namespace v8::internal |
1004 | 1002 |
1005 #endif // V8_TYPES_H_ | 1003 #endif // V8_TYPES_H_ |
OLD | NEW |