Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: src/types.h

Issue 170943005: Narrows predicate for type bounds (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 // Lower bounds are considered approximate, correct as necessary. 553 // Lower bounds are considered approximate, correct as necessary.
554 t = Type::Intersect(t, b.upper, region); 554 t = Type::Intersect(t, b.upper, region);
555 TypeHandle lower = Type::Union(b.lower, t, region); 555 TypeHandle lower = Type::Union(b.lower, t, region);
556 return BoundsImpl(lower, b.upper); 556 return BoundsImpl(lower, b.upper);
557 } 557 }
558 static BoundsImpl NarrowUpper(BoundsImpl b, TypeHandle t, Region* region) { 558 static BoundsImpl NarrowUpper(BoundsImpl b, TypeHandle t, Region* region) {
559 TypeHandle lower = Type::Intersect(b.lower, t, region); 559 TypeHandle lower = Type::Intersect(b.lower, t, region);
560 TypeHandle upper = Type::Intersect(b.upper, t, region); 560 TypeHandle upper = Type::Intersect(b.upper, t, region);
561 return BoundsImpl(lower, upper); 561 return BoundsImpl(lower, upper);
562 } 562 }
563
564 bool Narrows(BoundsImpl that) {
565 return that.lower->Is(this->lower) && this->upper->Is(that.upper);
566 }
563 }; 567 };
564 568
565 typedef BoundsImpl<ZoneTypeConfig> Bounds; 569 typedef BoundsImpl<ZoneTypeConfig> Bounds;
566 570
567 571
568 } } // namespace v8::internal 572 } } // namespace v8::internal
569 573
570 #endif // V8_TYPES_H_ 574 #endif // V8_TYPES_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698