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

Side by Side Diff: src/types.h

Issue 795993002: Introduce unsigned representation types (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/types.cc » ('j') | 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/conversions.h" 8 #include "src/conversions.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/handles.h" 10 #include "src/handles.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // - class HeapType (heap-allocated, for persistent types) 147 // - class HeapType (heap-allocated, for persistent types)
148 // 148 //
149 // Both provide the same API, and the Convert method can be used to interconvert 149 // Both provide the same API, and the Convert method can be used to interconvert
150 // them. For zone types, no query method touches the heap, only constructors do. 150 // them. For zone types, no query method touches the heap, only constructors do.
151 151
152 152
153 // ----------------------------------------------------------------------------- 153 // -----------------------------------------------------------------------------
154 // Values for bitset types 154 // Values for bitset types
155 155
156 #define MASK_BITSET_TYPE_LIST(V) \ 156 #define MASK_BITSET_TYPE_LIST(V) \
157 V(Representation, 0xff800000u) \ 157 V(Representation, 0xfff00000u) \
158 V(Semantic, 0x007ffffeu) 158 V(Semantic, 0x000ffffeu)
159 159
160 #define REPRESENTATION(k) ((k) & BitsetType::kRepresentation) 160 #define REPRESENTATION(k) ((k) & BitsetType::kRepresentation)
161 #define SEMANTIC(k) ((k) & BitsetType::kSemantic) 161 #define SEMANTIC(k) ((k) & BitsetType::kSemantic)
162 162
163 #define REPRESENTATION_BITSET_TYPE_LIST(V) \ 163 #define REPRESENTATION_BITSET_TYPE_LIST(V) \
164 V(None, 0) \ 164 V(None, 0) \
165 V(UntaggedInt1, 1u << 23 | kSemantic) \ 165 V(UntaggedBit, 1u << 20 | kSemantic) \
166 V(UntaggedInt8, 1u << 24 | kSemantic) \ 166 V(UntaggedSigned8, 1u << 21 | kSemantic) \
167 V(UntaggedInt16, 1u << 25 | kSemantic) \ 167 V(UntaggedSigned16, 1u << 22 | kSemantic) \
168 V(UntaggedInt32, 1u << 26 | kSemantic) \ 168 V(UntaggedSigned32, 1u << 23 | kSemantic) \
169 V(UntaggedFloat32, 1u << 27 | kSemantic) \ 169 V(UntaggedUnsigned8, 1u << 24 | kSemantic) \
170 V(UntaggedFloat64, 1u << 28 | kSemantic) \ 170 V(UntaggedUnsigned16, 1u << 25 | kSemantic) \
171 V(UntaggedPtr, 1u << 29 | kSemantic) \ 171 V(UntaggedUnsigned32, 1u << 26 | kSemantic) \
172 V(TaggedInt, 1u << 30 | kSemantic) \ 172 V(UntaggedFloat32, 1u << 27 | kSemantic) \
173 V(TaggedPtr, 1u << 31 | kSemantic) \ 173 V(UntaggedFloat64, 1u << 28 | kSemantic) \
174 V(UntaggedPointer, 1u << 29 | kSemantic) \
175 V(TaggedSigned, 1u << 30 | kSemantic) \
176 V(TaggedPointer, 1u << 31 | kSemantic) \
174 \ 177 \
175 V(UntaggedInt, kUntaggedInt1 | kUntaggedInt8 | \ 178 V(UntaggedSigned, kUntaggedSigned8 | kUntaggedSigned16 | \
176 kUntaggedInt16 | kUntaggedInt32) \ 179 kUntaggedSigned32) \
177 V(UntaggedFloat, kUntaggedFloat32 | kUntaggedFloat64) \ 180 V(UntaggedUnsigned, kUntaggedUnsigned8 | kUntaggedUnsigned16 | \
178 V(UntaggedNumber, kUntaggedInt | kUntaggedFloat) \ 181 kUntaggedUnsigned32) \
179 V(Untagged, kUntaggedNumber | kUntaggedPtr) \ 182 V(UntaggedIntegral8, kUntaggedSigned8 | kUntaggedUnsigned8) \
180 V(Tagged, kTaggedInt | kTaggedPtr) 183 V(UntaggedIntegral16, kUntaggedSigned16 | kUntaggedUnsigned16) \
184 V(UntaggedIntegral32, kUntaggedSigned32 | kUntaggedUnsigned32) \
185 V(UntaggedIntegral, kUntaggedBit | kUntaggedSigned | kUntaggedUnsigned) \
186 V(UntaggedFloat, kUntaggedFloat32 | kUntaggedFloat64) \
187 V(UntaggedNumber, kUntaggedIntegral | kUntaggedFloat) \
188 V(Untagged, kUntaggedNumber | kUntaggedPointer) \
189 V(Tagged, kTaggedSigned | kTaggedPointer)
181 190
182 #define SEMANTIC_BITSET_TYPE_LIST(V) \ 191 #define SEMANTIC_BITSET_TYPE_LIST(V) \
183 V(Null, 1u << 1 | REPRESENTATION(kTaggedPtr)) \ 192 V(Null, 1u << 1 | REPRESENTATION(kTaggedPointer)) \
184 V(Undefined, 1u << 2 | REPRESENTATION(kTaggedPtr)) \ 193 V(Undefined, 1u << 2 | REPRESENTATION(kTaggedPointer)) \
185 V(Boolean, 1u << 3 | REPRESENTATION(kTaggedPtr)) \ 194 V(Boolean, 1u << 3 | REPRESENTATION(kTaggedPointer)) \
186 V(UnsignedSmall, 1u << 4 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 195 V(UnsignedSmall, 1u << 4 | REPRESENTATION(kTagged | kUntaggedNumber)) \
187 V(OtherSignedSmall, 1u << 5 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 196 V(OtherSignedSmall, 1u << 5 | REPRESENTATION(kTagged | kUntaggedNumber)) \
188 V(OtherUnsigned31, 1u << 6 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 197 V(OtherUnsigned31, 1u << 6 | REPRESENTATION(kTagged | kUntaggedNumber)) \
189 V(OtherUnsigned32, 1u << 7 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 198 V(OtherUnsigned32, 1u << 7 | REPRESENTATION(kTagged | kUntaggedNumber)) \
190 V(OtherSigned32, 1u << 8 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 199 V(OtherSigned32, 1u << 8 | REPRESENTATION(kTagged | kUntaggedNumber)) \
191 V(MinusZero, 1u << 9 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 200 V(MinusZero, 1u << 9 | REPRESENTATION(kTagged | kUntaggedNumber)) \
192 V(NaN, 1u << 10 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 201 V(NaN, 1u << 10 | REPRESENTATION(kTagged | kUntaggedNumber)) \
193 V(OtherNumber, 1u << 11 | REPRESENTATION(kTagged | kUntaggedNumber)) \ 202 V(OtherNumber, 1u << 11 | REPRESENTATION(kTagged | kUntaggedNumber)) \
194 V(Symbol, 1u << 12 | REPRESENTATION(kTaggedPtr)) \ 203 V(Symbol, 1u << 12 | REPRESENTATION(kTaggedPointer)) \
195 V(InternalizedString, 1u << 13 | REPRESENTATION(kTaggedPtr)) \ 204 V(InternalizedString, 1u << 13 | REPRESENTATION(kTaggedPointer)) \
196 V(OtherString, 1u << 14 | REPRESENTATION(kTaggedPtr)) \ 205 V(OtherString, 1u << 14 | REPRESENTATION(kTaggedPointer)) \
197 V(Undetectable, 1u << 15 | REPRESENTATION(kTaggedPtr)) \ 206 V(Undetectable, 1u << 15 | REPRESENTATION(kTaggedPointer)) \
198 V(Array, 1u << 16 | REPRESENTATION(kTaggedPtr)) \ 207 V(Array, 1u << 16 | REPRESENTATION(kTaggedPointer)) \
199 V(Buffer, 1u << 17 | REPRESENTATION(kTaggedPtr)) \ 208 V(OtherObject, 1u << 17 | REPRESENTATION(kTaggedPointer)) \
200 V(Function, 1u << 18 | REPRESENTATION(kTaggedPtr)) \ 209 V(Proxy, 1u << 18 | REPRESENTATION(kTaggedPointer)) \
201 V(RegExp, 1u << 19 | REPRESENTATION(kTaggedPtr)) \ 210 V(Internal, 1u << 19 | REPRESENTATION(kTagged | kUntagged)) \
202 V(OtherObject, 1u << 20 | REPRESENTATION(kTaggedPtr)) \
203 V(Proxy, 1u << 21 | REPRESENTATION(kTaggedPtr)) \
204 V(Internal, 1u << 22 | REPRESENTATION(kTagged | kUntagged)) \
205 \ 211 \
206 V(SignedSmall, kUnsignedSmall | kOtherSignedSmall) \ 212 V(SignedSmall, kUnsignedSmall | kOtherSignedSmall) \
207 V(Signed32, kSignedSmall | kOtherUnsigned31 | kOtherSigned32) \ 213 V(Signed32, kSignedSmall | kOtherUnsigned31 | kOtherSigned32) \
208 V(Unsigned32, kUnsignedSmall | kOtherUnsigned31 | kOtherUnsigned32) \ 214 V(Unsigned32, kUnsignedSmall | kOtherUnsigned31 | kOtherUnsigned32) \
209 V(Integral32, kSigned32 | kUnsigned32) \ 215 V(Integral32, kSigned32 | kUnsigned32) \
210 V(OrderedNumber, kIntegral32 | kMinusZero | kOtherNumber) \ 216 V(OrderedNumber, kIntegral32 | kMinusZero | kOtherNumber) \
211 V(Number, kOrderedNumber | kNaN) \ 217 V(Number, kOrderedNumber | kNaN) \
212 V(String, kInternalizedString | kOtherString) \ 218 V(String, kInternalizedString | kOtherString) \
213 V(UniqueName, kSymbol | kInternalizedString) \ 219 V(UniqueName, kSymbol | kInternalizedString) \
214 V(Name, kSymbol | kString) \ 220 V(Name, kSymbol | kString) \
215 V(NumberOrString, kNumber | kString) \ 221 V(NumberOrString, kNumber | kString) \
216 V(PlainPrimitive, kNumberOrString | kBoolean | kNull | kUndefined) \ 222 V(PlainPrimitive, kNumberOrString | kBoolean | kNull | kUndefined) \
217 V(Primitive, kSymbol | kPlainPrimitive) \ 223 V(Primitive, kSymbol | kPlainPrimitive) \
218 V(DetectableObject, kArray | kFunction | kRegExp | kOtherObject) \ 224 V(DetectableObject, kArray | kOtherObject) \
219 V(DetectableReceiver, kDetectableObject | kProxy) \ 225 V(DetectableReceiver, kDetectableObject | kProxy) \
220 V(Detectable, kDetectableReceiver | kNumber | kName) \ 226 V(Detectable, kDetectableReceiver | kNumber | kName) \
221 V(Object, kDetectableObject | kUndetectable) \ 227 V(Object, kDetectableObject | kUndetectable) \
222 V(Receiver, kObject | kProxy) \ 228 V(Receiver, kObject | kProxy) \
223 V(Unique, kBoolean | kUniqueName | kNull | kUndefined | \ 229 V(Unique, kBoolean | kUniqueName | kNull | kUndefined | \
224 kReceiver) \ 230 kReceiver) \
225 V(NonNumber, kUnique | kString | kInternal) \ 231 V(NonNumber, kUnique | kString | kInternal) \
226 V(Any, 0xfffffffeu) 232 V(Any, 0xfffffffeu)
227 233
228 /* 234 /*
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 bool Narrows(BoundsImpl that) { 1070 bool Narrows(BoundsImpl that) {
1065 return that.lower->Is(this->lower) && this->upper->Is(that.upper); 1071 return that.lower->Is(this->lower) && this->upper->Is(that.upper);
1066 } 1072 }
1067 }; 1073 };
1068 1074
1069 typedef BoundsImpl<ZoneTypeConfig> Bounds; 1075 typedef BoundsImpl<ZoneTypeConfig> Bounds;
1070 1076
1071 } } // namespace v8::internal 1077 } } // namespace v8::internal
1072 1078
1073 #endif // V8_TYPES_H_ 1079 #endif // V8_TYPES_H_
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698