OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 static void union_set( | 487 static void union_set( |
488 i::Handle<Unioned> unioned, int i, i::Handle<Type> type) { | 488 i::Handle<Unioned> unioned, int i, i::Handle<Type> type) { |
489 ASSERT(!is_union(*type)); | 489 ASSERT(!is_union(*type)); |
490 unioned->set(i, *type); | 490 unioned->set(i, *type); |
491 } | 491 } |
492 static int union_length(i::Handle<Unioned> unioned) { | 492 static int union_length(i::Handle<Unioned> unioned) { |
493 return unioned->length(); | 493 return unioned->length(); |
494 } | 494 } |
495 }; | 495 }; |
496 | 496 |
497 typedef TypeImpl<ZoneTypeConfig> ZoneType; | 497 typedef TypeImpl<ZoneTypeConfig> Type; |
498 typedef TypeImpl<HeapTypeConfig> Type; | 498 typedef TypeImpl<HeapTypeConfig> HeapType; |
499 | 499 |
500 | 500 |
501 // A simple struct to represent a pair of lower/upper type bounds. | 501 // A simple struct to represent a pair of lower/upper type bounds. |
502 template<class Config> | 502 template<class Config> |
503 struct BoundsImpl { | 503 struct BoundsImpl { |
504 typedef TypeImpl<Config> Type; | 504 typedef TypeImpl<Config> Type; |
505 typedef typename Type::TypeHandle TypeHandle; | 505 typedef typename Type::TypeHandle TypeHandle; |
506 typedef typename Type::Region Region; | 506 typedef typename Type::Region Region; |
507 | 507 |
508 TypeHandle lower; | 508 TypeHandle lower; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 TypeHandle lower = Type::Union(b.lower, t, region); | 541 TypeHandle lower = Type::Union(b.lower, t, region); |
542 return BoundsImpl(lower, b.upper); | 542 return BoundsImpl(lower, b.upper); |
543 } | 543 } |
544 static BoundsImpl NarrowUpper(BoundsImpl b, TypeHandle t, Region* region) { | 544 static BoundsImpl NarrowUpper(BoundsImpl b, TypeHandle t, Region* region) { |
545 TypeHandle lower = Type::Intersect(b.lower, t, region); | 545 TypeHandle lower = Type::Intersect(b.lower, t, region); |
546 TypeHandle upper = Type::Intersect(b.upper, t, region); | 546 TypeHandle upper = Type::Intersect(b.upper, t, region); |
547 return BoundsImpl(lower, upper); | 547 return BoundsImpl(lower, upper); |
548 } | 548 } |
549 }; | 549 }; |
550 | 550 |
551 typedef BoundsImpl<ZoneTypeConfig> ZoneBounds; | 551 typedef BoundsImpl<ZoneTypeConfig> Bounds; |
552 typedef BoundsImpl<HeapTypeConfig> Bounds; | |
553 | 552 |
554 | 553 |
555 } } // namespace v8::internal | 554 } } // namespace v8::internal |
556 | 555 |
557 #endif // V8_TYPES_H_ | 556 #endif // V8_TYPES_H_ |
OLD | NEW |