| 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, |
| 25 kCore, | 26 kCore, |
| 26 kCollection, | 27 kCollection, |
| 27 kCollectionDev, | 28 kCollectionDev, |
| 29 kConvert, |
| 28 kIsolate, | 30 kIsolate, |
| 29 kJson, | 31 kJson, |
| 30 kMath, | 32 kMath, |
| 31 kMirrors, | 33 kMirrors, |
| 32 kTypedData, | 34 kTypedData, |
| 33 kUtf, | 35 kUtf, |
| 34 }; | 36 }; |
| 35 | 37 |
| 36 ~ObjectStore(); | 38 ~ObjectStore(); |
| 37 | 39 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 256 |
| 255 RawArray* canonical_type_arguments() const { | 257 RawArray* canonical_type_arguments() const { |
| 256 return canonical_type_arguments_; | 258 return canonical_type_arguments_; |
| 257 } | 259 } |
| 258 void set_canonical_type_arguments(const Array& value) { | 260 void set_canonical_type_arguments(const Array& value) { |
| 259 canonical_type_arguments_ = value.raw(); | 261 canonical_type_arguments_ = value.raw(); |
| 260 } | 262 } |
| 261 | 263 |
| 262 RawLibrary* async_library() const { return async_library_; } | 264 RawLibrary* async_library() const { return async_library_; } |
| 263 RawLibrary* builtin_library() const { return builtin_library_; } | 265 RawLibrary* builtin_library() const { return builtin_library_; } |
| 266 RawLibrary* codec_library() const { return codec_library_; } |
| 264 RawLibrary* core_library() const { return core_library_; } | 267 RawLibrary* core_library() const { return core_library_; } |
| 265 RawLibrary* collection_library() const { return collection_library_; } | 268 RawLibrary* collection_library() const { return collection_library_; } |
| 266 RawLibrary* collection_dev_library() const { | 269 RawLibrary* collection_dev_library() const { |
| 267 return collection_dev_library_; | 270 return collection_dev_library_; |
| 268 } | 271 } |
| 272 RawLibrary* convert_library() const { return convert_library_; } |
| 269 RawLibrary* isolate_library() const { return isolate_library_; } | 273 RawLibrary* isolate_library() const { return isolate_library_; } |
| 270 RawLibrary* json_library() const { return json_library_; } | 274 RawLibrary* json_library() const { return json_library_; } |
| 271 RawLibrary* math_library() const { return math_library_; } | 275 RawLibrary* math_library() const { return math_library_; } |
| 272 RawLibrary* mirrors_library() const { return mirrors_library_; } | 276 RawLibrary* mirrors_library() const { return mirrors_library_; } |
| 273 RawLibrary* typed_data_library() const { return typed_data_library_; } | 277 RawLibrary* typed_data_library() const { return typed_data_library_; } |
| 274 RawLibrary* utf_library() const { return utf_library_; } | 278 RawLibrary* utf_library() const { return utf_library_; } |
| 275 void set_bootstrap_library(intptr_t index, const Library& value) { | 279 void set_bootstrap_library(intptr_t index, const Library& value) { |
| 276 switch (index) { | 280 switch (index) { |
| 277 case kAsync: | 281 case kAsync: |
| 278 async_library_ = value.raw(); | 282 async_library_ = value.raw(); |
| 279 break; | 283 break; |
| 284 case kCodec: |
| 285 codec_library_ = value.raw(); |
| 286 break; |
| 280 case kCore: | 287 case kCore: |
| 281 core_library_ = value.raw(); | 288 core_library_ = value.raw(); |
| 282 break; | 289 break; |
| 283 case kCollection: | 290 case kCollection: |
| 284 collection_library_ = value.raw(); | 291 collection_library_ = value.raw(); |
| 285 break; | 292 break; |
| 286 case kCollectionDev: | 293 case kCollectionDev: |
| 287 collection_dev_library_ = value.raw(); | 294 collection_dev_library_ = value.raw(); |
| 288 break; | 295 break; |
| 296 case kConvert: |
| 297 convert_library_ = value.raw(); |
| 298 break; |
| 289 case kIsolate: | 299 case kIsolate: |
| 290 isolate_library_ = value.raw(); | 300 isolate_library_ = value.raw(); |
| 291 break; | 301 break; |
| 292 case kJson: | 302 case kJson: |
| 293 json_library_ = value.raw(); | 303 json_library_ = value.raw(); |
| 294 break; | 304 break; |
| 295 case kMath: | 305 case kMath: |
| 296 math_library_ = value.raw(); | 306 math_library_ = value.raw(); |
| 297 break; | 307 break; |
| 298 case kMirrors: | 308 case kMirrors: |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 RawClass* uint32x4_class_; | 461 RawClass* uint32x4_class_; |
| 452 RawArray* typed_data_classes_; | 462 RawArray* typed_data_classes_; |
| 453 RawClass* stacktrace_class_; | 463 RawClass* stacktrace_class_; |
| 454 RawClass* jsregexp_class_; | 464 RawClass* jsregexp_class_; |
| 455 RawClass* weak_property_class_; | 465 RawClass* weak_property_class_; |
| 456 RawClass* mirror_reference_class_; | 466 RawClass* mirror_reference_class_; |
| 457 RawArray* symbol_table_; | 467 RawArray* symbol_table_; |
| 458 RawArray* canonical_type_arguments_; | 468 RawArray* canonical_type_arguments_; |
| 459 RawLibrary* async_library_; | 469 RawLibrary* async_library_; |
| 460 RawLibrary* builtin_library_; | 470 RawLibrary* builtin_library_; |
| 471 RawLibrary* codec_library_; |
| 461 RawLibrary* core_library_; | 472 RawLibrary* core_library_; |
| 462 RawLibrary* collection_library_; | 473 RawLibrary* collection_library_; |
| 463 RawLibrary* collection_dev_library_; | 474 RawLibrary* collection_dev_library_; |
| 475 RawLibrary* convert_library_; |
| 464 RawLibrary* isolate_library_; | 476 RawLibrary* isolate_library_; |
| 465 RawLibrary* json_library_; | 477 RawLibrary* json_library_; |
| 466 RawLibrary* math_library_; | 478 RawLibrary* math_library_; |
| 467 RawLibrary* mirrors_library_; | 479 RawLibrary* mirrors_library_; |
| 468 RawLibrary* native_wrappers_library_; | 480 RawLibrary* native_wrappers_library_; |
| 469 RawLibrary* root_library_; | 481 RawLibrary* root_library_; |
| 470 RawLibrary* typed_data_library_; | 482 RawLibrary* typed_data_library_; |
| 471 RawLibrary* utf_library_; | 483 RawLibrary* utf_library_; |
| 472 RawGrowableObjectArray* libraries_; | 484 RawGrowableObjectArray* libraries_; |
| 473 RawGrowableObjectArray* pending_classes_; | 485 RawGrowableObjectArray* pending_classes_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 484 RawObject** to() { return reinterpret_cast<RawObject**>(&keyword_symbols_); } | 496 RawObject** to() { return reinterpret_cast<RawObject**>(&keyword_symbols_); } |
| 485 | 497 |
| 486 friend class SnapshotReader; | 498 friend class SnapshotReader; |
| 487 | 499 |
| 488 DISALLOW_COPY_AND_ASSIGN(ObjectStore); | 500 DISALLOW_COPY_AND_ASSIGN(ObjectStore); |
| 489 }; | 501 }; |
| 490 | 502 |
| 491 } // namespace dart | 503 } // namespace dart |
| 492 | 504 |
| 493 #endif // VM_OBJECT_STORE_H_ | 505 #endif // VM_OBJECT_STORE_H_ |
| OLD | NEW |