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 { |
(...skipping 12 matching lines...) Expand all Loading... |
23 kNone = 0, | 23 kNone = 0, |
24 kAsync, | 24 kAsync, |
25 kCore, | 25 kCore, |
26 kCollection, | 26 kCollection, |
27 kCollectionDev, | 27 kCollectionDev, |
28 kConvert, | 28 kConvert, |
29 kIsolate, | 29 kIsolate, |
30 kMath, | 30 kMath, |
31 kMirrors, | 31 kMirrors, |
32 kTypedData, | 32 kTypedData, |
33 kUtf, | |
34 }; | 33 }; |
35 | 34 |
36 ~ObjectStore(); | 35 ~ObjectStore(); |
37 | 36 |
38 RawClass* object_class() const { | 37 RawClass* object_class() const { |
39 ASSERT(object_class_ != Object::null()); | 38 ASSERT(object_class_ != Object::null()); |
40 return object_class_; | 39 return object_class_; |
41 } | 40 } |
42 void set_object_class(const Class& value) { object_class_ = value.raw(); } | 41 void set_object_class(const Class& value) { object_class_ = value.raw(); } |
43 static intptr_t object_class_offset() { | 42 static intptr_t object_class_offset() { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 RawLibrary* core_library() const { return core_library_; } | 271 RawLibrary* core_library() const { return core_library_; } |
273 RawLibrary* collection_library() const { return collection_library_; } | 272 RawLibrary* collection_library() const { return collection_library_; } |
274 RawLibrary* collection_dev_library() const { | 273 RawLibrary* collection_dev_library() const { |
275 return collection_dev_library_; | 274 return collection_dev_library_; |
276 } | 275 } |
277 RawLibrary* convert_library() const { return convert_library_; } | 276 RawLibrary* convert_library() const { return convert_library_; } |
278 RawLibrary* isolate_library() const { return isolate_library_; } | 277 RawLibrary* isolate_library() const { return isolate_library_; } |
279 RawLibrary* math_library() const { return math_library_; } | 278 RawLibrary* math_library() const { return math_library_; } |
280 RawLibrary* mirrors_library() const { return mirrors_library_; } | 279 RawLibrary* mirrors_library() const { return mirrors_library_; } |
281 RawLibrary* typed_data_library() const { return typed_data_library_; } | 280 RawLibrary* typed_data_library() const { return typed_data_library_; } |
282 RawLibrary* utf_library() const { return utf_library_; } | |
283 void set_bootstrap_library(BootstrapLibraryId index, const Library& value) { | 281 void set_bootstrap_library(BootstrapLibraryId index, const Library& value) { |
284 switch (index) { | 282 switch (index) { |
285 case kAsync: | 283 case kAsync: |
286 async_library_ = value.raw(); | 284 async_library_ = value.raw(); |
287 break; | 285 break; |
288 case kCore: | 286 case kCore: |
289 core_library_ = value.raw(); | 287 core_library_ = value.raw(); |
290 break; | 288 break; |
291 case kCollection: | 289 case kCollection: |
292 collection_library_ = value.raw(); | 290 collection_library_ = value.raw(); |
293 break; | 291 break; |
294 case kCollectionDev: | 292 case kCollectionDev: |
295 collection_dev_library_ = value.raw(); | 293 collection_dev_library_ = value.raw(); |
296 break; | 294 break; |
297 case kConvert: | 295 case kConvert: |
298 convert_library_ = value.raw(); | 296 convert_library_ = value.raw(); |
299 break; | 297 break; |
300 case kIsolate: | 298 case kIsolate: |
301 isolate_library_ = value.raw(); | 299 isolate_library_ = value.raw(); |
302 break; | 300 break; |
303 case kMath: | 301 case kMath: |
304 math_library_ = value.raw(); | 302 math_library_ = value.raw(); |
305 break; | 303 break; |
306 case kMirrors: | 304 case kMirrors: |
307 mirrors_library_ = value.raw(); | 305 mirrors_library_ = value.raw(); |
308 break; | 306 break; |
309 case kTypedData: | 307 case kTypedData: |
310 typed_data_library_ = value.raw(); | 308 typed_data_library_ = value.raw(); |
311 break; | 309 break; |
312 case kUtf: | |
313 utf_library_ = value.raw(); | |
314 break; | |
315 default: | 310 default: |
316 UNREACHABLE(); | 311 UNREACHABLE(); |
317 } | 312 } |
318 } | 313 } |
319 | 314 |
320 void set_builtin_library(const Library& value) { | 315 void set_builtin_library(const Library& value) { |
321 builtin_library_ = value.raw(); | 316 builtin_library_ = value.raw(); |
322 } | 317 } |
323 | 318 |
324 RawLibrary* native_wrappers_library() const { | 319 RawLibrary* native_wrappers_library() const { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 RawLibrary* core_library_; | 468 RawLibrary* core_library_; |
474 RawLibrary* collection_library_; | 469 RawLibrary* collection_library_; |
475 RawLibrary* collection_dev_library_; | 470 RawLibrary* collection_dev_library_; |
476 RawLibrary* convert_library_; | 471 RawLibrary* convert_library_; |
477 RawLibrary* isolate_library_; | 472 RawLibrary* isolate_library_; |
478 RawLibrary* math_library_; | 473 RawLibrary* math_library_; |
479 RawLibrary* mirrors_library_; | 474 RawLibrary* mirrors_library_; |
480 RawLibrary* native_wrappers_library_; | 475 RawLibrary* native_wrappers_library_; |
481 RawLibrary* root_library_; | 476 RawLibrary* root_library_; |
482 RawLibrary* typed_data_library_; | 477 RawLibrary* typed_data_library_; |
483 RawLibrary* utf_library_; | |
484 RawGrowableObjectArray* libraries_; | 478 RawGrowableObjectArray* libraries_; |
485 RawGrowableObjectArray* pending_classes_; | 479 RawGrowableObjectArray* pending_classes_; |
486 RawGrowableObjectArray* pending_functions_; | 480 RawGrowableObjectArray* pending_functions_; |
487 RawError* sticky_error_; | 481 RawError* sticky_error_; |
488 RawString* unhandled_exception_handler_; | 482 RawString* unhandled_exception_handler_; |
489 RawContext* empty_context_; | 483 RawContext* empty_context_; |
490 RawInstance* stack_overflow_; | 484 RawInstance* stack_overflow_; |
491 RawInstance* out_of_memory_; | 485 RawInstance* out_of_memory_; |
492 RawStacktrace* preallocated_stack_trace_; | 486 RawStacktrace* preallocated_stack_trace_; |
493 RawArray* keyword_symbols_; | 487 RawArray* keyword_symbols_; |
494 RawFunction* receive_port_create_function_; | 488 RawFunction* receive_port_create_function_; |
495 RawFunction* lookup_receive_port_function_; | 489 RawFunction* lookup_receive_port_function_; |
496 RawFunction* handle_message_function_; | 490 RawFunction* handle_message_function_; |
497 RawObject** to() { return reinterpret_cast<RawObject**>(&keyword_symbols_); } | 491 RawObject** to() { return reinterpret_cast<RawObject**>(&keyword_symbols_); } |
498 | 492 |
499 friend class SnapshotReader; | 493 friend class SnapshotReader; |
500 | 494 |
501 DISALLOW_COPY_AND_ASSIGN(ObjectStore); | 495 DISALLOW_COPY_AND_ASSIGN(ObjectStore); |
502 }; | 496 }; |
503 | 497 |
504 } // namespace dart | 498 } // namespace dart |
505 | 499 |
506 #endif // VM_OBJECT_STORE_H_ | 500 #endif // VM_OBJECT_STORE_H_ |
OLD | NEW |