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

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

Issue 8872037: Adjust index of type parameters at finalization time (fix issue 718). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/snapshot.h" 10 #include "vm/snapshot.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 RawString* ident_; // Name of the unresolved identifier. 268 RawString* ident_; // Name of the unresolved identifier.
269 RawClass* factory_signature_class_; // Expected type parameters for factory. 269 RawClass* factory_signature_class_; // Expected type parameters for factory.
270 RawObject** to() { 270 RawObject** to() {
271 return reinterpret_cast<RawObject**>(&ptr()->factory_signature_class_); 271 return reinterpret_cast<RawObject**>(&ptr()->factory_signature_class_);
272 } 272 }
273 intptr_t token_index_; 273 intptr_t token_index_;
274 }; 274 };
275 275
276 276
277 class RawAbstractType : public RawObject { 277 class RawAbstractType : public RawObject {
278 protected:
279 enum TypeState {
280 kAllocated, // Initial state.
281 kBeingFinalized, // In the process of being finalized.
282 kFinalized, // Type ready for use.
283 };
284
srdjan 2011/12/08 22:30:29 private:
regis 2011/12/08 22:50:20 Done.
278 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractType); 285 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractType);
279 286
280 friend class ObjectStore; 287 friend class ObjectStore;
281 }; 288 };
282 289
283 290
284 class RawType : public RawAbstractType { 291 class RawType : public RawAbstractType {
srdjan 2011/12/08 22:30:29 add "private:" (explictly)
regis 2011/12/08 22:50:20 Done.
285 private:
286 enum TypeState {
287 kAllocated, // Initial state.
288 kBeingFinalized, // In the process of being finalized.
289 kFinalized, // Type ready for use.
290 };
291
292 RAW_HEAP_OBJECT_IMPLEMENTATION(Type); 292 RAW_HEAP_OBJECT_IMPLEMENTATION(Type);
293 293
294 RawObject** from() { 294 RawObject** from() {
295 return reinterpret_cast<RawObject**>(&ptr()->type_class_); 295 return reinterpret_cast<RawObject**>(&ptr()->type_class_);
296 } 296 }
297 RawObject* type_class_; // Either resolved class or unresolved class. 297 RawObject* type_class_; // Either resolved class or unresolved class.
298 RawAbstractTypeArguments* arguments_; 298 RawAbstractTypeArguments* arguments_;
299 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->arguments_); } 299 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->arguments_); }
300 int8_t type_state_; 300 int8_t type_state_;
301 }; 301 };
302 302
303 303
304 class RawTypeParameter : public RawAbstractType { 304 class RawTypeParameter : public RawAbstractType {
305 private: 305 private:
306 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter); 306 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter);
307 307
308 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 308 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
309 RawString* name_; 309 RawString* name_;
310 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 310 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
311 intptr_t index_; 311 intptr_t index_;
312 int8_t type_state_;
312 }; 313 };
313 314
314 315
315 class RawInstantiatedType : public RawAbstractType { 316 class RawInstantiatedType : public RawAbstractType {
316 private: 317 private:
317 RAW_HEAP_OBJECT_IMPLEMENTATION(InstantiatedType); 318 RAW_HEAP_OBJECT_IMPLEMENTATION(InstantiatedType);
318 319
319 RawObject** from() { 320 RawObject** from() {
320 return reinterpret_cast<RawObject**>(&ptr()->uninstantiated_type_); 321 return reinterpret_cast<RawObject**>(&ptr()->uninstantiated_type_);
321 } 322 }
322 RawAbstractType* uninstantiated_type_; 323 RawAbstractType* uninstantiated_type_;
323 RawAbstractTypeArguments* instantiator_type_arguments_; 324 RawAbstractTypeArguments* instantiator_type_arguments_;
324 RawObject** to() { 325 RawObject** to() {
325 return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_); 326 return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_);
326 } 327 }
327 }; 328 };
328 329
329 330
330 class RawAbstractTypeArguments : public RawObject { 331 class RawAbstractTypeArguments : public RawObject {
regis 2011/12/08 22:50:20 Done here too.
331 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractTypeArguments); 332 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractTypeArguments);
332 }; 333 };
333 334
334 335
335 class RawTypeArguments : public RawAbstractTypeArguments { 336 class RawTypeArguments : public RawAbstractTypeArguments {
336 private: 337 private:
337 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeArguments); 338 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeArguments);
338 339
339 RawObject** from() { 340 RawObject** from() {
340 return reinterpret_cast<RawObject**>(&ptr()->length_); 341 return reinterpret_cast<RawObject**>(&ptr()->length_);
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 intptr_t type_; // Uninitialized, simple or complex. 859 intptr_t type_; // Uninitialized, simple or complex.
859 intptr_t flags_; // Represents global/local, case insensitive, multiline. 860 intptr_t flags_; // Represents global/local, case insensitive, multiline.
860 861
861 // Variable length data follows here. 862 // Variable length data follows here.
862 uint8_t data_[0]; 863 uint8_t data_[0];
863 }; 864 };
864 865
865 } // namespace dart 866 } // namespace dart
866 867
867 #endif // VM_RAW_OBJECT_H_ 868 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698