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

Side by Side Diff: src/types.h

Issue 1319703006: When typing phi nodes, weaken union of integer constants to a range. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed superfluous argument. Created 5 years, 3 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
OLDNEW
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/conversions.h" 8 #include "src/conversions.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // representation types initially include all semantic ranges. Representations 88 // representation types initially include all semantic ranges. Representations
89 // can then e.g. be narrowed for a given semantic type using intersection: 89 // can then e.g. be narrowed for a given semantic type using intersection:
90 // 90 //
91 // SignedSmall /\ TaggedInt (a 'smi') 91 // SignedSmall /\ TaggedInt (a 'smi')
92 // Number /\ TaggedPtr (a heap number) 92 // Number /\ TaggedPtr (a heap number)
93 // 93 //
94 // 94 //
95 // RANGE TYPES 95 // RANGE TYPES
96 // 96 //
97 // A range type represents a continuous integer interval by its minimum and 97 // A range type represents a continuous integer interval by its minimum and
98 // maximum value. Either value might be an infinity. 98 // maximum value. Either value may be an infinity, in which case that infinity
99 // itself is also included in the range. A range never contains NaN or -0.
99 // 100 //
100 // Constant(v) is considered a subtype of Range(x..y) if v happens to be an 101 // Constant(v) is considered a subtype of Range(x..y) if v happens to be an
101 // integer between x and y. 102 // integer between x and y.
102 // 103 //
103 // 104 //
104 // PREDICATES 105 // PREDICATES
105 // 106 //
106 // There are two main functions for testing types: 107 // There are two main functions for testing types:
107 // 108 //
108 // T1->Is(T2) -- tests whether T1 is included in T2 (i.e., T1 <= T2) 109 // T1->Is(T2) -- tests whether T1 is included in T2 (i.e., T1 <= T2)
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 ArrayType* AsArray() { return ArrayType::cast(this); } 507 ArrayType* AsArray() { return ArrayType::cast(this); }
507 FunctionType* AsFunction() { return FunctionType::cast(this); } 508 FunctionType* AsFunction() { return FunctionType::cast(this); }
508 509
509 // Minimum and maximum of a numeric type. 510 // Minimum and maximum of a numeric type.
510 // These functions do not distinguish between -0 and +0. If the type equals 511 // These functions do not distinguish between -0 and +0. If the type equals
511 // kNaN, they return NaN; otherwise kNaN is ignored. Only call these 512 // kNaN, they return NaN; otherwise kNaN is ignored. Only call these
512 // functions on subtypes of Number. 513 // functions on subtypes of Number.
513 double Min(); 514 double Min();
514 double Max(); 515 double Max();
515 516
516 // Extracts a range from the type. If the type is a range, it just 517 // Extracts a range from the type: if the type is a range or a union
517 // returns it; if it is a union, it returns the range component. 518 // containing a range, that range is returned; otherwise, NULL is returned.
518 // Note that it does not contain range for constants.
519 RangeType* GetRange(); 519 RangeType* GetRange();
520 520
521 int NumClasses(); 521 int NumClasses();
522 int NumConstants(); 522 int NumConstants();
523 523
524 template<class T> class Iterator; 524 template<class T> class Iterator;
525 Iterator<i::Map> Classes() { 525 Iterator<i::Map> Classes() {
526 if (this->IsBitset()) return Iterator<i::Map>(); 526 if (this->IsBitset()) return Iterator<i::Map>();
527 return Iterator<i::Map>(Config::handle(this)); 527 return Iterator<i::Map>(Config::handle(this));
528 } 528 }
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 bool Narrows(BoundsImpl that) { 1165 bool Narrows(BoundsImpl that) {
1166 return that.lower->Is(this->lower) && this->upper->Is(that.upper); 1166 return that.lower->Is(this->lower) && this->upper->Is(that.upper);
1167 } 1167 }
1168 }; 1168 };
1169 1169
1170 typedef BoundsImpl<ZoneTypeConfig> Bounds; 1170 typedef BoundsImpl<ZoneTypeConfig> Bounds;
1171 1171
1172 } } // namespace v8::internal 1172 } } // namespace v8::internal
1173 1173
1174 #endif // V8_TYPES_H_ 1174 #endif // V8_TYPES_H_
OLDNEW
« src/compiler/typer.cc ('K') | « src/compiler/typer.cc ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698