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 "platform/thread.h" | 10 #include "platform/thread.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 class RawMint; | 39 class RawMint; |
40 class RawObject; | 40 class RawObject; |
41 class RawInteger; | 41 class RawInteger; |
42 class RawError; | 42 class RawError; |
43 class Simulator; | 43 class Simulator; |
44 class StackResource; | 44 class StackResource; |
45 class StackZone; | 45 class StackZone; |
46 class StubCode; | 46 class StubCode; |
47 class RawFloat32x4; | 47 class RawFloat32x4; |
48 class RawUint32x4; | 48 class RawUint32x4; |
| 49 class ObjectHistogram; |
49 | 50 |
50 | 51 |
51 // Used by the deoptimization infrastructure to defer allocation of unboxed | 52 // Used by the deoptimization infrastructure to defer allocation of unboxed |
52 // objects until frame is fully rewritten and GC is safe. | 53 // objects until frame is fully rewritten and GC is safe. |
53 // Describes a stack slot that should be populated with a reference to the | 54 // Describes a stack slot that should be populated with a reference to the |
54 // materialized object. | 55 // materialized object. |
55 class DeferredSlot { | 56 class DeferredSlot { |
56 public: | 57 public: |
57 DeferredSlot(RawInstance** slot, DeferredSlot* next) | 58 DeferredSlot(RawInstance** slot, DeferredSlot* next) |
58 : slot_(slot), next_(next) { } | 59 : slot_(slot), next_(next) { } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 static inline Isolate* Current() { | 225 static inline Isolate* Current() { |
225 return reinterpret_cast<Isolate*>(Thread::GetThreadLocal(isolate_key)); | 226 return reinterpret_cast<Isolate*>(Thread::GetThreadLocal(isolate_key)); |
226 } | 227 } |
227 | 228 |
228 static void SetCurrent(Isolate* isolate); | 229 static void SetCurrent(Isolate* isolate); |
229 | 230 |
230 static void InitOnce(); | 231 static void InitOnce(); |
231 static Isolate* Init(const char* name_prefix); | 232 static Isolate* Init(const char* name_prefix); |
232 void Shutdown(); | 233 void Shutdown(); |
233 | 234 |
| 235 // Register a newly introduced class. |
| 236 void RegisterClass(const Class& cls); |
| 237 |
234 // Visit all object pointers. | 238 // Visit all object pointers. |
235 void VisitObjectPointers(ObjectPointerVisitor* visitor, | 239 void VisitObjectPointers(ObjectPointerVisitor* visitor, |
236 bool visit_prologue_weak_persistent_handles, | 240 bool visit_prologue_weak_persistent_handles, |
237 bool validate_frames); | 241 bool validate_frames); |
238 | 242 |
239 // Visits weak object pointers. | 243 // Visits weak object pointers. |
240 void VisitWeakPersistentHandles(HandleVisitor* visit, | 244 void VisitWeakPersistentHandles(HandleVisitor* visit, |
241 bool visit_prologue_weak_persistent_handles); | 245 bool visit_prologue_weak_persistent_handles); |
242 | 246 |
243 StoreBuffer* store_buffer() { return &store_buffer_; } | 247 StoreBuffer* store_buffer() { return &store_buffer_; } |
244 static intptr_t store_buffer_offset() { | 248 static intptr_t store_buffer_offset() { |
245 return OFFSET_OF(Isolate, store_buffer_); | 249 return OFFSET_OF(Isolate, store_buffer_); |
246 } | 250 } |
247 | 251 |
248 ClassTable* class_table() { return &class_table_; } | 252 ClassTable* class_table() { return &class_table_; } |
249 static intptr_t class_table_offset() { | 253 static intptr_t class_table_offset() { |
250 return OFFSET_OF(Isolate, class_table_); | 254 return OFFSET_OF(Isolate, class_table_); |
251 } | 255 } |
252 | 256 |
| 257 ObjectHistogram* object_histogram() { return object_histogram_; } |
| 258 |
253 MegamorphicCacheTable* megamorphic_cache_table() { | 259 MegamorphicCacheTable* megamorphic_cache_table() { |
254 return &megamorphic_cache_table_; | 260 return &megamorphic_cache_table_; |
255 } | 261 } |
256 | 262 |
257 Dart_MessageNotifyCallback message_notify_callback() const { | 263 Dart_MessageNotifyCallback message_notify_callback() const { |
258 return message_notify_callback_; | 264 return message_notify_callback_; |
259 } | 265 } |
260 void set_message_notify_callback(Dart_MessageNotifyCallback value) { | 266 void set_message_notify_callback(Dart_MessageNotifyCallback value) { |
261 message_notify_callback_ = value; | 267 message_notify_callback_ = value; |
262 } | 268 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 intptr_t deopt_frame_copy_size_; | 634 intptr_t deopt_frame_copy_size_; |
629 DeferredSlot* deferred_boxes_; | 635 DeferredSlot* deferred_boxes_; |
630 DeferredSlot* deferred_object_refs_; | 636 DeferredSlot* deferred_object_refs_; |
631 | 637 |
632 intptr_t deferred_objects_count_; | 638 intptr_t deferred_objects_count_; |
633 DeferredObject** deferred_objects_; | 639 DeferredObject** deferred_objects_; |
634 | 640 |
635 // Status support. | 641 // Status support. |
636 char* stacktrace_; | 642 char* stacktrace_; |
637 intptr_t stack_frame_index_; | 643 intptr_t stack_frame_index_; |
| 644 ObjectHistogram* object_histogram_; |
638 | 645 |
639 static Dart_IsolateCreateCallback create_callback_; | 646 static Dart_IsolateCreateCallback create_callback_; |
640 static Dart_IsolateInterruptCallback interrupt_callback_; | 647 static Dart_IsolateInterruptCallback interrupt_callback_; |
641 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; | 648 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; |
642 static Dart_IsolateShutdownCallback shutdown_callback_; | 649 static Dart_IsolateShutdownCallback shutdown_callback_; |
643 static Dart_FileOpenCallback file_open_callback_; | 650 static Dart_FileOpenCallback file_open_callback_; |
644 static Dart_FileReadCallback file_read_callback_; | 651 static Dart_FileReadCallback file_read_callback_; |
645 static Dart_FileWriteCallback file_write_callback_; | 652 static Dart_FileWriteCallback file_write_callback_; |
646 static Dart_FileCloseCallback file_close_callback_; | 653 static Dart_FileCloseCallback file_close_callback_; |
647 static Dart_IsolateInterruptCallback vmstats_callback_; | 654 static Dart_IsolateInterruptCallback vmstats_callback_; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 764 |
758 private: | 765 private: |
759 Isolate::IsolateRunState saved_state_; | 766 Isolate::IsolateRunState saved_state_; |
760 | 767 |
761 DISALLOW_COPY_AND_ASSIGN(IsolateRunStateManager); | 768 DISALLOW_COPY_AND_ASSIGN(IsolateRunStateManager); |
762 }; | 769 }; |
763 | 770 |
764 } // namespace dart | 771 } // namespace dart |
765 | 772 |
766 #endif // VM_ISOLATE_H_ | 773 #endif // VM_ISOLATE_H_ |
OLD | NEW |