| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ISOLATE_H_ | 5 #ifndef VM_ISOLATE_H_ |
| 6 #define VM_ISOLATE_H_ | 6 #define VM_ISOLATE_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
| 11 #include "vm/base_isolate.h" | 11 #include "vm/base_isolate.h" |
| 12 #include "vm/class_table.h" | 12 #include "vm/class_table.h" |
| 13 #include "vm/handles.h" | 13 #include "vm/handles.h" |
| 14 #include "vm/megamorphic_cache_table.h" | 14 #include "vm/megamorphic_cache_table.h" |
| 15 #include "vm/metrics.h" | 15 #include "vm/metrics.h" |
| 16 #include "vm/random.h" | 16 #include "vm/random.h" |
| 17 #include "vm/tags.h" | 17 #include "vm/tags.h" |
| 18 #include "vm/thread.h" | 18 #include "vm/thread.h" |
| 19 #include "vm/os_thread.h" | 19 #include "vm/os_thread.h" |
| 20 #include "vm/timer.h" | 20 #include "vm/timer.h" |
| 21 #include "vm/token_position.h" | 21 #include "vm/token_position.h" |
| 22 #include "vm/growable_array.h" |
| 22 | 23 |
| 23 namespace dart { | 24 namespace dart { |
| 24 | 25 |
| 25 // Forward declarations. | 26 // Forward declarations. |
| 26 class ApiState; | 27 class ApiState; |
| 27 class BackgroundCompiler; | 28 class BackgroundCompiler; |
| 28 class Capability; | 29 class Capability; |
| 29 class CodeIndexTable; | 30 class CodeIndexTable; |
| 30 class CompilerStats; | 31 class CompilerStats; |
| 31 class Debugger; | 32 class Debugger; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 class ServiceIdZone; | 64 class ServiceIdZone; |
| 64 class Simulator; | 65 class Simulator; |
| 65 class StackResource; | 66 class StackResource; |
| 66 class StackZone; | 67 class StackZone; |
| 67 class StoreBuffer; | 68 class StoreBuffer; |
| 68 class StubCode; | 69 class StubCode; |
| 69 class ThreadRegistry; | 70 class ThreadRegistry; |
| 70 class UserTag; | 71 class UserTag; |
| 71 | 72 |
| 72 | 73 |
| 74 class PendingLazyDeopt { |
| 75 public: |
| 76 PendingLazyDeopt(uword fp, uword pc) : fp_(fp), pc_(pc) { } |
| 77 uword fp() { return fp_; } |
| 78 uword pc() { return pc_; } |
| 79 |
| 80 private: |
| 81 uword fp_; |
| 82 uword pc_; |
| 83 }; |
| 84 |
| 85 |
| 73 class IsolateVisitor { | 86 class IsolateVisitor { |
| 74 public: | 87 public: |
| 75 IsolateVisitor() {} | 88 IsolateVisitor() {} |
| 76 virtual ~IsolateVisitor() {} | 89 virtual ~IsolateVisitor() {} |
| 77 | 90 |
| 78 virtual void VisitIsolate(Isolate* isolate) = 0; | 91 virtual void VisitIsolate(Isolate* isolate) = 0; |
| 79 | 92 |
| 80 private: | 93 private: |
| 81 DISALLOW_COPY_AND_ASSIGN(IsolateVisitor); | 94 DISALLOW_COPY_AND_ASSIGN(IsolateVisitor); |
| 82 }; | 95 }; |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 return shutdown_callback_; | 396 return shutdown_callback_; |
| 384 } | 397 } |
| 385 | 398 |
| 386 void set_object_id_ring(ObjectIdRing* ring) { | 399 void set_object_id_ring(ObjectIdRing* ring) { |
| 387 object_id_ring_ = ring; | 400 object_id_ring_ = ring; |
| 388 } | 401 } |
| 389 ObjectIdRing* object_id_ring() { | 402 ObjectIdRing* object_id_ring() { |
| 390 return object_id_ring_; | 403 return object_id_ring_; |
| 391 } | 404 } |
| 392 | 405 |
| 406 MallocGrowableArray<PendingLazyDeopt>* pending_deopts() { |
| 407 return pending_deopts_; |
| 408 } |
| 393 bool IsDeoptimizing() const { return deopt_context_ != NULL; } | 409 bool IsDeoptimizing() const { return deopt_context_ != NULL; } |
| 394 DeoptContext* deopt_context() const { return deopt_context_; } | 410 DeoptContext* deopt_context() const { return deopt_context_; } |
| 395 void set_deopt_context(DeoptContext* value) { | 411 void set_deopt_context(DeoptContext* value) { |
| 396 ASSERT(value == NULL || deopt_context_ == NULL); | 412 ASSERT(value == NULL || deopt_context_ == NULL); |
| 397 deopt_context_ = value; | 413 deopt_context_ = value; |
| 398 } | 414 } |
| 399 | 415 |
| 400 BackgroundCompiler* background_compiler() const { | 416 BackgroundCompiler* background_compiler() const { |
| 401 return background_compiler_; | 417 return background_compiler_; |
| 402 } | 418 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 Mutex* symbols_mutex_; // Protects concurrent access to the symbol table. | 749 Mutex* symbols_mutex_; // Protects concurrent access to the symbol table. |
| 734 Mutex* type_canonicalization_mutex_; // Protects type canonicalization. | 750 Mutex* type_canonicalization_mutex_; // Protects type canonicalization. |
| 735 Mutex* constant_canonicalization_mutex_; // Protects const canonicalization. | 751 Mutex* constant_canonicalization_mutex_; // Protects const canonicalization. |
| 736 Mutex* megamorphic_lookup_mutex_; // Protects megamorphic table lookup. | 752 Mutex* megamorphic_lookup_mutex_; // Protects megamorphic table lookup. |
| 737 MessageHandler* message_handler_; | 753 MessageHandler* message_handler_; |
| 738 IsolateSpawnState* spawn_state_; | 754 IsolateSpawnState* spawn_state_; |
| 739 bool is_runnable_; | 755 bool is_runnable_; |
| 740 Dart_GcPrologueCallback gc_prologue_callback_; | 756 Dart_GcPrologueCallback gc_prologue_callback_; |
| 741 Dart_GcEpilogueCallback gc_epilogue_callback_; | 757 Dart_GcEpilogueCallback gc_epilogue_callback_; |
| 742 intptr_t defer_finalization_count_; | 758 intptr_t defer_finalization_count_; |
| 759 MallocGrowableArray<PendingLazyDeopt>* pending_deopts_; |
| 743 DeoptContext* deopt_context_; | 760 DeoptContext* deopt_context_; |
| 744 | 761 |
| 745 bool is_service_isolate_; | 762 bool is_service_isolate_; |
| 746 | 763 |
| 747 // Isolate-specific flags. | 764 // Isolate-specific flags. |
| 748 NOT_IN_PRODUCT( | 765 NOT_IN_PRODUCT( |
| 749 bool type_checks_; | 766 bool type_checks_; |
| 750 bool asserts_; | 767 bool asserts_; |
| 751 bool error_on_bad_type_; | 768 bool error_on_bad_type_; |
| 752 bool error_on_bad_override_; | 769 bool error_on_bad_override_; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 intptr_t* spawn_count_; | 1007 intptr_t* spawn_count_; |
| 991 | 1008 |
| 992 Dart_IsolateFlags isolate_flags_; | 1009 Dart_IsolateFlags isolate_flags_; |
| 993 bool paused_; | 1010 bool paused_; |
| 994 bool errors_are_fatal_; | 1011 bool errors_are_fatal_; |
| 995 }; | 1012 }; |
| 996 | 1013 |
| 997 } // namespace dart | 1014 } // namespace dart |
| 998 | 1015 |
| 999 #endif // VM_ISOLATE_H_ | 1016 #endif // VM_ISOLATE_H_ |
| OLD | NEW |