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

Side by Side Diff: src/types.h

Issue 556733003: Make type bitsets explicitly unsigned (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | 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 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 #define MASK_BITSET_TYPE_LIST(V) \ 141 #define MASK_BITSET_TYPE_LIST(V) \
142 V(Representation, 0xff800000u) \ 142 V(Representation, 0xff800000u) \
143 V(Semantic, 0x007ffffeu) 143 V(Semantic, 0x007ffffeu)
144 144
145 #define REPRESENTATION(k) ((k) & BitsetType::kRepresentation) 145 #define REPRESENTATION(k) ((k) & BitsetType::kRepresentation)
146 #define SEMANTIC(k) ((k) & BitsetType::kSemantic) 146 #define SEMANTIC(k) ((k) & BitsetType::kSemantic)
147 147
148 #define REPRESENTATION_BITSET_TYPE_LIST(V) \ 148 #define REPRESENTATION_BITSET_TYPE_LIST(V) \
149 V(None, 0) \ 149 V(None, 0) \
150 V(UntaggedInt1, 1 << 23 | kSemantic) \ 150 V(UntaggedInt1, 1u << 23 | kSemantic) \
151 V(UntaggedInt8, 1 << 24 | kSemantic) \ 151 V(UntaggedInt8, 1u << 24 | kSemantic) \
152 V(UntaggedInt16, 1 << 25 | kSemantic) \ 152 V(UntaggedInt16, 1u << 25 | kSemantic) \
153 V(UntaggedInt32, 1 << 26 | kSemantic) \ 153 V(UntaggedInt32, 1u << 26 | kSemantic) \
154 V(UntaggedFloat32, 1 << 27 | kSemantic) \ 154 V(UntaggedFloat32, 1u << 27 | kSemantic) \
155 V(UntaggedFloat64, 1 << 28 | kSemantic) \ 155 V(UntaggedFloat64, 1u << 28 | kSemantic) \
156 V(UntaggedPtr, 1 << 29 | kSemantic) \ 156 V(UntaggedPtr, 1u << 29 | kSemantic) \
157 V(TaggedInt, 1 << 30 | kSemantic) \ 157 V(TaggedInt, 1u << 30 | kSemantic) \
158 V(TaggedPtr, 1 << 31 | kSemantic) \ 158 V(TaggedPtr, 1u << 31 | kSemantic) \
159 \ 159 \
160 V(UntaggedInt, kUntaggedInt1 | kUntaggedInt8 | \ 160 V(UntaggedInt, kUntaggedInt1 | kUntaggedInt8 | \
161 kUntaggedInt16 | kUntaggedInt32) \ 161 kUntaggedInt16 | kUntaggedInt32) \
162 V(UntaggedFloat, kUntaggedFloat32 | kUntaggedFloat64) \ 162 V(UntaggedFloat, kUntaggedFloat32 | kUntaggedFloat64) \
163 V(UntaggedNumber, kUntaggedInt | kUntaggedFloat) \ 163 V(UntaggedNumber, kUntaggedInt | kUntaggedFloat) \
164 V(Untagged, kUntaggedNumber | kUntaggedPtr) \ 164 V(Untagged, kUntaggedNumber | kUntaggedPtr) \
165 V(Tagged, kTaggedInt | kTaggedPtr) 165 V(Tagged, kTaggedInt | kTaggedPtr)
166 166
167 #define SEMANTIC_BITSET_TYPE_LIST(V) \ 167 #define SEMANTIC_BITSET_TYPE_LIST(V) \
168 V(Null, 1 << 1 | REPRESENTATION(kTaggedPtr)) \ 168 V(Null, 1u << 1 | REPRESENTATION(kTaggedPtr)) \
169 V(Undefined, 1 << 2 | REPRESENTATION(kTaggedPtr)) \ 169 V(Undefined, 1u << 2 | REPRESENTATION(kTaggedPtr)) \
170 V(Boolean, 1 << 3 | REPRESENTATION(kTaggedPtr)) \ 170 V(Boolean, 1u << 3 | REPRESENTATION(kTaggedPtr)) \
171 V(UnsignedSmall, 1 << 4 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 171 V(UnsignedSmall, 1u << 4 | REPRESENTATION(kTagged | kUntaggedNumber)) \
172 V(OtherSignedSmall, 1 << 5 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 172 V(OtherSignedSmall, 1u << 5 | REPRESENTATION(kTagged | kUntaggedNumber)) \
173 V(OtherUnsigned31, 1 << 6 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 173 V(OtherUnsigned31, 1u << 6 | REPRESENTATION(kTagged | kUntaggedNumber)) \
174 V(OtherUnsigned32, 1 << 7 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 174 V(OtherUnsigned32, 1u << 7 | REPRESENTATION(kTagged | kUntaggedNumber)) \
175 V(OtherSigned32, 1 << 8 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 175 V(OtherSigned32, 1u << 8 | REPRESENTATION(kTagged | kUntaggedNumber)) \
176 V(MinusZero, 1 << 9 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 176 V(MinusZero, 1u << 9 | REPRESENTATION(kTagged | kUntaggedNumber)) \
177 V(NaN, 1 << 10 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 177 V(NaN, 1u << 10 | REPRESENTATION(kTagged | kUntaggedNumber)) \
178 V(OtherNumber, 1 << 11 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 178 V(OtherNumber, 1u << 11 | REPRESENTATION(kTagged | kUntaggedNumber)) \
179 V(Symbol, 1 << 12 | REPRESENTATION(kTaggedPtr)) \ 179 V(Symbol, 1u << 12 | REPRESENTATION(kTaggedPtr)) \
180 V(InternalizedString, 1 << 13 | REPRESENTATION(kTaggedPtr)) \ 180 V(InternalizedString, 1u << 13 | REPRESENTATION(kTaggedPtr)) \
181 V(OtherString, 1 << 14 | REPRESENTATION(kTaggedPtr)) \ 181 V(OtherString, 1u << 14 | REPRESENTATION(kTaggedPtr)) \
182 V(Undetectable, 1 << 15 | REPRESENTATION(kTaggedPtr)) \ 182 V(Undetectable, 1u << 15 | REPRESENTATION(kTaggedPtr)) \
183 V(Array, 1 << 16 | REPRESENTATION(kTaggedPtr)) \ 183 V(Array, 1u << 16 | REPRESENTATION(kTaggedPtr)) \
184 V(Buffer, 1 << 17 | REPRESENTATION(kTaggedPtr)) \ 184 V(Buffer, 1u << 17 | REPRESENTATION(kTaggedPtr)) \
185 V(Function, 1 << 18 | REPRESENTATION(kTaggedPtr)) \ 185 V(Function, 1u << 18 | REPRESENTATION(kTaggedPtr)) \
186 V(RegExp, 1 << 19 | REPRESENTATION(kTaggedPtr)) \ 186 V(RegExp, 1u << 19 | REPRESENTATION(kTaggedPtr)) \
187 V(OtherObject, 1 << 20 | REPRESENTATION(kTaggedPtr)) \ 187 V(OtherObject, 1u << 20 | REPRESENTATION(kTaggedPtr)) \
188 V(Proxy, 1 << 21 | REPRESENTATION(kTaggedPtr)) \ 188 V(Proxy, 1u << 21 | REPRESENTATION(kTaggedPtr)) \
189 V(Internal, 1 << 22 | REPRESENTATION(kTagged | kUntagged)) \ 189 V(Internal, 1u << 22 | REPRESENTATION(kTagged | kUntagged)) \
190 \ 190 \
191 V(SignedSmall, kUnsignedSmall | kOtherSignedSmall) \ 191 V(SignedSmall, kUnsignedSmall | kOtherSignedSmall) \
192 V(Signed32, kSignedSmall | kOtherUnsigned31 | kOtherSigned32) \ 192 V(Signed32, kSignedSmall | kOtherUnsigned31 | kOtherSigned32) \
193 V(Unsigned32, kUnsignedSmall | kOtherUnsigned31 | kOtherUnsigned32) \ 193 V(Unsigned32, kUnsignedSmall | kOtherUnsigned31 | kOtherUnsigned32) \
194 V(Integral32, kSigned32 | kUnsigned32) \ 194 V(Integral32, kSigned32 | kUnsigned32) \
195 V(OrderedNumber, kIntegral32 | kMinusZero | kOtherNumber) \ 195 V(OrderedNumber, kIntegral32 | kMinusZero | kOtherNumber) \
196 V(Number, kOrderedNumber | kNaN) \ 196 V(Number, kOrderedNumber | kNaN) \
197 V(String, kInternalizedString | kOtherString) \ 197 V(String, kInternalizedString | kOtherString) \
198 V(UniqueName, kSymbol | kInternalizedString) \ 198 V(UniqueName, kSymbol | kInternalizedString) \
199 V(Name, kSymbol | kString) \ 199 V(Name, kSymbol | kString) \
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 bool Narrows(BoundsImpl that) { 994 bool Narrows(BoundsImpl that) {
995 return that.lower->Is(this->lower) && this->upper->Is(that.upper); 995 return that.lower->Is(this->lower) && this->upper->Is(that.upper);
996 } 996 }
997 }; 997 };
998 998
999 typedef BoundsImpl<ZoneTypeConfig> Bounds; 999 typedef BoundsImpl<ZoneTypeConfig> Bounds;
1000 1000
1001 } } // namespace v8::internal 1001 } } // namespace v8::internal
1002 1002
1003 #endif // V8_TYPES_H_ 1003 #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