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 "handles.h" | 8 #include "handles.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // existing assumptions or tests. | 94 // existing assumptions or tests. |
95 // Consequently, do not use pointer equality for type tests, always use Is! | 95 // Consequently, do not use pointer equality for type tests, always use Is! |
96 // | 96 // |
97 // The NowIs operator implements state-sensitive subtying, as described above. | 97 // The NowIs operator implements state-sensitive subtying, as described above. |
98 // Any compilation decision based on such temporary properties requires runtime | 98 // Any compilation decision based on such temporary properties requires runtime |
99 // guarding! | 99 // guarding! |
100 // | 100 // |
101 // PROPERTIES | 101 // PROPERTIES |
102 // | 102 // |
103 // Various formal properties hold for constructors, operators, and predicates | 103 // Various formal properties hold for constructors, operators, and predicates |
104 // over types. For example, constructors are injective, subtyping is a complete | 104 // over types. For example, constructors are injective, subtyping is a partial |
105 // partial order, union and intersection satisfy the usual algebraic properties. | 105 // order, and union and intersection satisfy the usual algebraic properties. |
106 // | 106 // |
107 // See test/cctest/test-types.cc for a comprehensive executable specification, | 107 // See test/cctest/test-types.cc for a comprehensive executable specification, |
108 // especially with respect to the properties of the more exotic 'temporal' | 108 // especially with respect to the proeprties of the more exotic 'temporal' |
109 // constructors and predicates (those prefixed 'Now'). | 109 // constructors and predicates (those prefixed 'Now'). |
110 // | 110 // |
111 // IMPLEMENTATION | 111 // IMPLEMENTATION |
112 // | 112 // |
113 // Internally, all 'primitive' types, and their unions, are represented as | 113 // Internally, all 'primitive' types, and their unions, are represented as |
114 // bitsets. Class is a heap pointer to the respective map. Only Constant's, or | 114 // bitsets. Class is a heap pointer to the respective map. Only Constant's, or |
115 // unions containing Class'es or Constant's, currently require allocation. | 115 // unions containing Class'es or Constant's, currently require allocation. |
116 // Note that the bitset representation is closed under both Union and Intersect. | 116 // Note that the bitset representation is closed under both Union and Intersect. |
117 // | 117 // |
118 // There are two type representations, using different allocation: | 118 // There are two type representations, using different allocation: |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 bool Narrows(BoundsImpl that) { | 527 bool Narrows(BoundsImpl that) { |
528 return that.lower->Is(this->lower) && this->upper->Is(that.upper); | 528 return that.lower->Is(this->lower) && this->upper->Is(that.upper); |
529 } | 529 } |
530 }; | 530 }; |
531 | 531 |
532 typedef BoundsImpl<ZoneTypeConfig> Bounds; | 532 typedef BoundsImpl<ZoneTypeConfig> Bounds; |
533 | 533 |
534 } } // namespace v8::internal | 534 } } // namespace v8::internal |
535 | 535 |
536 #endif // V8_TYPES_H_ | 536 #endif // V8_TYPES_H_ |
OLD | NEW |