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

Side by Side Diff: runtime/vm/raw_object.h

Issue 103913005: Introduce class TypeRef in the VM to fully support recursive types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 V(MegamorphicCache) \ 43 V(MegamorphicCache) \
44 V(SubtypeTestCache) \ 44 V(SubtypeTestCache) \
45 V(Error) \ 45 V(Error) \
46 V(ApiError) \ 46 V(ApiError) \
47 V(LanguageError) \ 47 V(LanguageError) \
48 V(UnhandledException) \ 48 V(UnhandledException) \
49 V(UnwindError) \ 49 V(UnwindError) \
50 V(Instance) \ 50 V(Instance) \
51 V(AbstractType) \ 51 V(AbstractType) \
52 V(Type) \ 52 V(Type) \
53 V(TypeRef) \
53 V(TypeParameter) \ 54 V(TypeParameter) \
54 V(BoundedType) \ 55 V(BoundedType) \
55 V(MixinAppType) \ 56 V(MixinAppType) \
56 V(Number) \ 57 V(Number) \
57 V(Integer) \ 58 V(Integer) \
58 V(Smi) \ 59 V(Smi) \
59 V(Mint) \ 60 V(Mint) \
60 V(Bigint) \ 61 V(Bigint) \
61 V(Double) \ 62 V(Double) \
62 V(Bool) \ 63 V(Bool) \
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 RawAbstractTypeArguments* arguments_; 1172 RawAbstractTypeArguments* arguments_;
1172 RawLanguageError* error_; // Error object if type is malformed or malbounded. 1173 RawLanguageError* error_; // Error object if type is malformed or malbounded.
1173 RawObject** to() { 1174 RawObject** to() {
1174 return reinterpret_cast<RawObject**>(&ptr()->error_); 1175 return reinterpret_cast<RawObject**>(&ptr()->error_);
1175 } 1176 }
1176 intptr_t token_pos_; 1177 intptr_t token_pos_;
1177 int8_t type_state_; 1178 int8_t type_state_;
1178 }; 1179 };
1179 1180
1180 1181
1182 class RawTypeRef : public RawAbstractType {
1183 private:
1184 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeRef);
1185
1186 RawObject** from() {
1187 return reinterpret_cast<RawObject**>(&ptr()->type_);
1188 }
1189 RawAbstractType* type_; // The referenced type.
1190 RawObject** to() {
1191 return reinterpret_cast<RawObject**>(&ptr()->type_);
1192 }
1193 bool is_being_checked_; // Transient field, not snapshotted.
1194 };
1195
1196
1181 class RawTypeParameter : public RawAbstractType { 1197 class RawTypeParameter : public RawAbstractType {
1182 private: 1198 private:
1183 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter); 1199 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter);
1184 1200
1185 RawObject** from() { 1201 RawObject** from() {
1186 return reinterpret_cast<RawObject**>(&ptr()->parameterized_class_); 1202 return reinterpret_cast<RawObject**>(&ptr()->parameterized_class_);
1187 } 1203 }
1188 RawClass* parameterized_class_; 1204 RawClass* parameterized_class_;
1189 RawString* name_; 1205 RawString* name_;
1190 RawAbstractType* bound_; // ObjectType if no explicit bound specified. 1206 RawAbstractType* bound_; // ObjectType if no explicit bound specified.
(...skipping 10 matching lines...) Expand all
1201 1217
1202 RawObject** from() { 1218 RawObject** from() {
1203 return reinterpret_cast<RawObject**>(&ptr()->type_); 1219 return reinterpret_cast<RawObject**>(&ptr()->type_);
1204 } 1220 }
1205 RawAbstractType* type_; 1221 RawAbstractType* type_;
1206 RawAbstractType* bound_; 1222 RawAbstractType* bound_;
1207 RawTypeParameter* type_parameter_; // For more detailed error reporting. 1223 RawTypeParameter* type_parameter_; // For more detailed error reporting.
1208 RawObject** to() { 1224 RawObject** to() {
1209 return reinterpret_cast<RawObject**>(&ptr()->type_parameter_); 1225 return reinterpret_cast<RawObject**>(&ptr()->type_parameter_);
1210 } 1226 }
1211 bool is_being_checked_; 1227 bool is_being_checked_; // Transient field, not snapshotted.
1212 }; 1228 };
1213 1229
1214 1230
1215 class RawMixinAppType : public RawAbstractType { 1231 class RawMixinAppType : public RawAbstractType {
1216 private: 1232 private:
1217 RAW_HEAP_OBJECT_IMPLEMENTATION(MixinAppType); 1233 RAW_HEAP_OBJECT_IMPLEMENTATION(MixinAppType);
1218 1234
1219 RawObject** from() { 1235 RawObject** from() {
1220 return reinterpret_cast<RawObject**>(&ptr()->super_type_); 1236 return reinterpret_cast<RawObject**>(&ptr()->super_type_);
1221 } 1237 }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 // Make sure this is updated when new TypedData types are added. 1747 // Make sure this is updated when new TypedData types are added.
1732 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13); 1748 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13);
1733 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14); 1749 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14);
1734 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 13); 1750 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 13);
1735 return (kNullCid - kTypedDataInt8ArrayCid); 1751 return (kNullCid - kTypedDataInt8ArrayCid);
1736 } 1752 }
1737 1753
1738 } // namespace dart 1754 } // namespace dart
1739 1755
1740 #endif // VM_RAW_OBJECT_H_ 1756 #endif // VM_RAW_OBJECT_H_
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/parser.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698