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 void set_pc(uword pc) { pc_ = pc; } |
| 80 |
| 81 private: |
| 82 uword fp_; |
| 83 uword pc_; |
| 84 }; |
| 85 |
| 86 |
73 class IsolateVisitor { | 87 class IsolateVisitor { |
74 public: | 88 public: |
75 IsolateVisitor() {} | 89 IsolateVisitor() {} |
76 virtual ~IsolateVisitor() {} | 90 virtual ~IsolateVisitor() {} |
77 | 91 |
78 virtual void VisitIsolate(Isolate* isolate) = 0; | 92 virtual void VisitIsolate(Isolate* isolate) = 0; |
79 | 93 |
80 private: | 94 private: |
81 DISALLOW_COPY_AND_ASSIGN(IsolateVisitor); | 95 DISALLOW_COPY_AND_ASSIGN(IsolateVisitor); |
82 }; | 96 }; |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 return shutdown_callback_; | 397 return shutdown_callback_; |
384 } | 398 } |
385 | 399 |
386 void set_object_id_ring(ObjectIdRing* ring) { | 400 void set_object_id_ring(ObjectIdRing* ring) { |
387 object_id_ring_ = ring; | 401 object_id_ring_ = ring; |
388 } | 402 } |
389 ObjectIdRing* object_id_ring() { | 403 ObjectIdRing* object_id_ring() { |
390 return object_id_ring_; | 404 return object_id_ring_; |
391 } | 405 } |
392 | 406 |
| 407 MallocGrowableArray<PendingLazyDeopt>* pending_deopts() { |
| 408 return pending_deopts_; |
| 409 } |
393 bool IsDeoptimizing() const { return deopt_context_ != NULL; } | 410 bool IsDeoptimizing() const { return deopt_context_ != NULL; } |
394 DeoptContext* deopt_context() const { return deopt_context_; } | 411 DeoptContext* deopt_context() const { return deopt_context_; } |
395 void set_deopt_context(DeoptContext* value) { | 412 void set_deopt_context(DeoptContext* value) { |
396 ASSERT(value == NULL || deopt_context_ == NULL); | 413 ASSERT(value == NULL || deopt_context_ == NULL); |
397 deopt_context_ = value; | 414 deopt_context_ = value; |
398 } | 415 } |
399 | 416 |
400 BackgroundCompiler* background_compiler() const { | 417 BackgroundCompiler* background_compiler() const { |
401 return background_compiler_; | 418 return background_compiler_; |
402 } | 419 } |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 Mutex* symbols_mutex_; // Protects concurrent access to the symbol table. | 750 Mutex* symbols_mutex_; // Protects concurrent access to the symbol table. |
734 Mutex* type_canonicalization_mutex_; // Protects type canonicalization. | 751 Mutex* type_canonicalization_mutex_; // Protects type canonicalization. |
735 Mutex* constant_canonicalization_mutex_; // Protects const canonicalization. | 752 Mutex* constant_canonicalization_mutex_; // Protects const canonicalization. |
736 Mutex* megamorphic_lookup_mutex_; // Protects megamorphic table lookup. | 753 Mutex* megamorphic_lookup_mutex_; // Protects megamorphic table lookup. |
737 MessageHandler* message_handler_; | 754 MessageHandler* message_handler_; |
738 IsolateSpawnState* spawn_state_; | 755 IsolateSpawnState* spawn_state_; |
739 bool is_runnable_; | 756 bool is_runnable_; |
740 Dart_GcPrologueCallback gc_prologue_callback_; | 757 Dart_GcPrologueCallback gc_prologue_callback_; |
741 Dart_GcEpilogueCallback gc_epilogue_callback_; | 758 Dart_GcEpilogueCallback gc_epilogue_callback_; |
742 intptr_t defer_finalization_count_; | 759 intptr_t defer_finalization_count_; |
| 760 MallocGrowableArray<PendingLazyDeopt>* pending_deopts_; |
743 DeoptContext* deopt_context_; | 761 DeoptContext* deopt_context_; |
744 | 762 |
745 bool is_service_isolate_; | 763 bool is_service_isolate_; |
746 | 764 |
747 // Isolate-specific flags. | 765 // Isolate-specific flags. |
748 NOT_IN_PRODUCT( | 766 NOT_IN_PRODUCT( |
749 bool type_checks_; | 767 bool type_checks_; |
750 bool asserts_; | 768 bool asserts_; |
751 bool error_on_bad_type_; | 769 bool error_on_bad_type_; |
752 bool error_on_bad_override_; | 770 bool error_on_bad_override_; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 intptr_t* spawn_count_; | 1008 intptr_t* spawn_count_; |
991 | 1009 |
992 Dart_IsolateFlags isolate_flags_; | 1010 Dart_IsolateFlags isolate_flags_; |
993 bool paused_; | 1011 bool paused_; |
994 bool errors_are_fatal_; | 1012 bool errors_are_fatal_; |
995 }; | 1013 }; |
996 | 1014 |
997 } // namespace dart | 1015 } // namespace dart |
998 | 1016 |
999 #endif // VM_ISOLATE_H_ | 1017 #endif // VM_ISOLATE_H_ |
OLD | NEW |