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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 358 } |
359 | 359 |
360 RawGrowableObjectArray* exit_listeners() const { | 360 RawGrowableObjectArray* exit_listeners() const { |
361 return exit_listeners_; | 361 return exit_listeners_; |
362 } | 362 } |
363 | 363 |
364 RawGrowableObjectArray* error_listeners() const { | 364 RawGrowableObjectArray* error_listeners() const { |
365 return error_listeners_; | 365 return error_listeners_; |
366 } | 366 } |
367 | 367 |
368 RawError* sticky_error() const { return sticky_error_; } | |
369 void set_sticky_error(const Error& value) { | |
370 // TODO(asiva): Move sticky_error_ into thread specific area. | |
371 ASSERT(Thread::Current()->IsMutatorThread()); | |
372 ASSERT(!value.IsNull()); | |
373 sticky_error_ = value.raw(); | |
374 } | |
375 void clear_sticky_error() { sticky_error_ = Error::null(); } | |
376 | |
377 RawContext* empty_context() const { return empty_context_; } | 368 RawContext* empty_context() const { return empty_context_; } |
378 void set_empty_context(const Context& value) { | 369 void set_empty_context(const Context& value) { |
379 empty_context_ = value.raw(); | 370 empty_context_ = value.raw(); |
380 } | 371 } |
381 | 372 |
382 RawInstance* stack_overflow() const { return stack_overflow_; } | 373 RawInstance* stack_overflow() const { return stack_overflow_; } |
383 void set_stack_overflow(const Instance& value) { | 374 void set_stack_overflow(const Instance& value) { |
384 stack_overflow_ = value.raw(); | 375 stack_overflow_ = value.raw(); |
385 } | 376 } |
386 | 377 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // Hold onto the code so it is traced and not detached from the function. | 472 // Hold onto the code so it is traced and not detached from the function. |
482 megamorphic_miss_code_ = code.raw(); | 473 megamorphic_miss_code_ = code.raw(); |
483 megamorphic_miss_function_ = func.raw(); | 474 megamorphic_miss_function_ = func.raw(); |
484 } | 475 } |
485 | 476 |
486 // Visit all object pointers. | 477 // Visit all object pointers. |
487 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 478 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
488 | 479 |
489 // Called to initialize objects required by the vm but which invoke | 480 // Called to initialize objects required by the vm but which invoke |
490 // dart code. If an error occurs then false is returned and error | 481 // dart code. If an error occurs then false is returned and error |
491 // information is stored in sticky_error(). | 482 // information is stored in Thread::sticky_error(). |
492 bool PreallocateObjects(); | 483 bool PreallocateObjects(); |
493 | 484 |
494 void InitKnownObjects(); | 485 void InitKnownObjects(); |
495 | 486 |
496 static void Init(Isolate* isolate); | 487 static void Init(Isolate* isolate); |
497 | 488 |
498 private: | 489 private: |
499 ObjectStore(); | 490 ObjectStore(); |
500 | 491 |
501 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); } | 492 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 RawLibrary* root_library_; | 547 RawLibrary* root_library_; |
557 RawLibrary* typed_data_library_; | 548 RawLibrary* typed_data_library_; |
558 RawLibrary* vmservice_library_; | 549 RawLibrary* vmservice_library_; |
559 RawGrowableObjectArray* libraries_; | 550 RawGrowableObjectArray* libraries_; |
560 RawGrowableObjectArray* closure_functions_; | 551 RawGrowableObjectArray* closure_functions_; |
561 RawGrowableObjectArray* pending_classes_; | 552 RawGrowableObjectArray* pending_classes_; |
562 RawGrowableObjectArray* pending_deferred_loads_; | 553 RawGrowableObjectArray* pending_deferred_loads_; |
563 RawGrowableObjectArray* resume_capabilities_; | 554 RawGrowableObjectArray* resume_capabilities_; |
564 RawGrowableObjectArray* exit_listeners_; | 555 RawGrowableObjectArray* exit_listeners_; |
565 RawGrowableObjectArray* error_listeners_; | 556 RawGrowableObjectArray* error_listeners_; |
566 RawError* sticky_error_; | |
567 RawContext* empty_context_; | 557 RawContext* empty_context_; |
568 RawInstance* stack_overflow_; | 558 RawInstance* stack_overflow_; |
569 RawInstance* out_of_memory_; | 559 RawInstance* out_of_memory_; |
570 RawUnhandledException* preallocated_unhandled_exception_; | 560 RawUnhandledException* preallocated_unhandled_exception_; |
571 RawStacktrace* preallocated_stack_trace_; | 561 RawStacktrace* preallocated_stack_trace_; |
572 RawFunction* lookup_port_handler_; | 562 RawFunction* lookup_port_handler_; |
573 RawTypedData* empty_uint32_array_; | 563 RawTypedData* empty_uint32_array_; |
574 RawFunction* handle_message_function_; | 564 RawFunction* handle_message_function_; |
575 RawArray* library_load_error_table_; | 565 RawArray* library_load_error_table_; |
576 RawArray* compile_time_constants_; | 566 RawArray* compile_time_constants_; |
(...skipping 13 matching lines...) Expand all Loading... |
590 friend class FullSnapshotWriter; | 580 friend class FullSnapshotWriter; |
591 friend class SnapshotReader; | 581 friend class SnapshotReader; |
592 friend class VmIsolateSnapshotReader; | 582 friend class VmIsolateSnapshotReader; |
593 | 583 |
594 DISALLOW_COPY_AND_ASSIGN(ObjectStore); | 584 DISALLOW_COPY_AND_ASSIGN(ObjectStore); |
595 }; | 585 }; |
596 | 586 |
597 } // namespace dart | 587 } // namespace dart |
598 | 588 |
599 #endif // VM_OBJECT_STORE_H_ | 589 #endif // VM_OBJECT_STORE_H_ |
OLD | NEW |