| OLD | NEW |
| 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_OBJECT_STORE_H_ | 5 #ifndef VM_OBJECT_STORE_H_ |
| 6 #define VM_OBJECT_STORE_H_ | 6 #define VM_OBJECT_STORE_H_ |
| 7 | 7 |
| 8 #include "vm/object.h" | 8 #include "vm/object.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 // Forward declarations. | 12 // Forward declarations. |
| 13 class Isolate; | 13 class Isolate; |
| 14 class ObjectPointerVisitor; | 14 class ObjectPointerVisitor; |
| 15 | 15 |
| 16 // The object store is a per isolate instance which stores references to | 16 // The object store is a per isolate instance which stores references to |
| 17 // objects used by the VM. | 17 // objects used by the VM. |
| 18 // TODO(iposva): Move the actual store into the object heap for quick handling | 18 // TODO(iposva): Move the actual store into the object heap for quick handling |
| 19 // by snapshots eventually. | 19 // by snapshots eventually. |
| 20 class ObjectStore { | 20 class ObjectStore { |
| 21 public: | 21 public: |
| 22 enum { | 22 enum { |
| 23 kNone = 0, | 23 kNone = 0, |
| 24 kAsync, | 24 kAsync, |
| 25 kCodec, | |
| 26 kCore, | 25 kCore, |
| 27 kCollection, | 26 kCollection, |
| 28 kCollectionDev, | 27 kCollectionDev, |
| 29 kConvert, | 28 kConvert, |
| 30 kIsolate, | 29 kIsolate, |
| 31 kJson, | 30 kJson, |
| 32 kMath, | 31 kMath, |
| 33 kMirrors, | 32 kMirrors, |
| 34 kTypedData, | 33 kTypedData, |
| 35 kUtf, | 34 kUtf, |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 252 |
| 254 RawArray* canonical_type_arguments() const { | 253 RawArray* canonical_type_arguments() const { |
| 255 return canonical_type_arguments_; | 254 return canonical_type_arguments_; |
| 256 } | 255 } |
| 257 void set_canonical_type_arguments(const Array& value) { | 256 void set_canonical_type_arguments(const Array& value) { |
| 258 canonical_type_arguments_ = value.raw(); | 257 canonical_type_arguments_ = value.raw(); |
| 259 } | 258 } |
| 260 | 259 |
| 261 RawLibrary* async_library() const { return async_library_; } | 260 RawLibrary* async_library() const { return async_library_; } |
| 262 RawLibrary* builtin_library() const { return builtin_library_; } | 261 RawLibrary* builtin_library() const { return builtin_library_; } |
| 263 RawLibrary* codec_library() const { return codec_library_; } | |
| 264 RawLibrary* core_library() const { return core_library_; } | 262 RawLibrary* core_library() const { return core_library_; } |
| 265 RawLibrary* collection_library() const { return collection_library_; } | 263 RawLibrary* collection_library() const { return collection_library_; } |
| 266 RawLibrary* collection_dev_library() const { | 264 RawLibrary* collection_dev_library() const { |
| 267 return collection_dev_library_; | 265 return collection_dev_library_; |
| 268 } | 266 } |
| 269 RawLibrary* convert_library() const { return convert_library_; } | 267 RawLibrary* convert_library() const { return convert_library_; } |
| 270 RawLibrary* isolate_library() const { return isolate_library_; } | 268 RawLibrary* isolate_library() const { return isolate_library_; } |
| 271 RawLibrary* json_library() const { return json_library_; } | 269 RawLibrary* json_library() const { return json_library_; } |
| 272 RawLibrary* math_library() const { return math_library_; } | 270 RawLibrary* math_library() const { return math_library_; } |
| 273 RawLibrary* mirrors_library() const { return mirrors_library_; } | 271 RawLibrary* mirrors_library() const { return mirrors_library_; } |
| 274 RawLibrary* typed_data_library() const { return typed_data_library_; } | 272 RawLibrary* typed_data_library() const { return typed_data_library_; } |
| 275 RawLibrary* utf_library() const { return utf_library_; } | 273 RawLibrary* utf_library() const { return utf_library_; } |
| 276 void set_bootstrap_library(intptr_t index, const Library& value) { | 274 void set_bootstrap_library(intptr_t index, const Library& value) { |
| 277 switch (index) { | 275 switch (index) { |
| 278 case kAsync: | 276 case kAsync: |
| 279 async_library_ = value.raw(); | 277 async_library_ = value.raw(); |
| 280 break; | 278 break; |
| 281 case kCodec: | |
| 282 codec_library_ = value.raw(); | |
| 283 break; | |
| 284 case kCore: | 279 case kCore: |
| 285 core_library_ = value.raw(); | 280 core_library_ = value.raw(); |
| 286 break; | 281 break; |
| 287 case kCollection: | 282 case kCollection: |
| 288 collection_library_ = value.raw(); | 283 collection_library_ = value.raw(); |
| 289 break; | 284 break; |
| 290 case kCollectionDev: | 285 case kCollectionDev: |
| 291 collection_dev_library_ = value.raw(); | 286 collection_dev_library_ = value.raw(); |
| 292 break; | 287 break; |
| 293 case kConvert: | 288 case kConvert: |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 RawClass* uint32x4_class_; | 452 RawClass* uint32x4_class_; |
| 458 RawArray* typed_data_classes_; | 453 RawArray* typed_data_classes_; |
| 459 RawClass* stacktrace_class_; | 454 RawClass* stacktrace_class_; |
| 460 RawClass* jsregexp_class_; | 455 RawClass* jsregexp_class_; |
| 461 RawClass* weak_property_class_; | 456 RawClass* weak_property_class_; |
| 462 RawClass* mirror_reference_class_; | 457 RawClass* mirror_reference_class_; |
| 463 RawArray* symbol_table_; | 458 RawArray* symbol_table_; |
| 464 RawArray* canonical_type_arguments_; | 459 RawArray* canonical_type_arguments_; |
| 465 RawLibrary* async_library_; | 460 RawLibrary* async_library_; |
| 466 RawLibrary* builtin_library_; | 461 RawLibrary* builtin_library_; |
| 467 RawLibrary* codec_library_; | |
| 468 RawLibrary* core_library_; | 462 RawLibrary* core_library_; |
| 469 RawLibrary* collection_library_; | 463 RawLibrary* collection_library_; |
| 470 RawLibrary* collection_dev_library_; | 464 RawLibrary* collection_dev_library_; |
| 471 RawLibrary* convert_library_; | 465 RawLibrary* convert_library_; |
| 472 RawLibrary* isolate_library_; | 466 RawLibrary* isolate_library_; |
| 473 RawLibrary* json_library_; | 467 RawLibrary* json_library_; |
| 474 RawLibrary* math_library_; | 468 RawLibrary* math_library_; |
| 475 RawLibrary* mirrors_library_; | 469 RawLibrary* mirrors_library_; |
| 476 RawLibrary* native_wrappers_library_; | 470 RawLibrary* native_wrappers_library_; |
| 477 RawLibrary* root_library_; | 471 RawLibrary* root_library_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 492 RawObject** to() { return reinterpret_cast<RawObject**>(&keyword_symbols_); } | 486 RawObject** to() { return reinterpret_cast<RawObject**>(&keyword_symbols_); } |
| 493 | 487 |
| 494 friend class SnapshotReader; | 488 friend class SnapshotReader; |
| 495 | 489 |
| 496 DISALLOW_COPY_AND_ASSIGN(ObjectStore); | 490 DISALLOW_COPY_AND_ASSIGN(ObjectStore); |
| 497 }; | 491 }; |
| 498 | 492 |
| 499 } // namespace dart | 493 } // namespace dart |
| 500 | 494 |
| 501 #endif // VM_OBJECT_STORE_H_ | 495 #endif // VM_OBJECT_STORE_H_ |
| OLD | NEW |