OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 <limits.h> | 8 #include <limits.h> |
9 | 9 |
10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 intptr_t active_ports() const { return active_ports_; } | 68 intptr_t active_ports() const { return active_ports_; } |
69 void increment_active_ports() { | 69 void increment_active_ports() { |
70 ASSERT(this == Isolate::Current()); | 70 ASSERT(this == Isolate::Current()); |
71 active_ports_++; | 71 active_ports_++; |
72 } | 72 } |
73 void decrement_active_ports() { | 73 void decrement_active_ports() { |
74 ASSERT(this == Isolate::Current()); | 74 ASSERT(this == Isolate::Current()); |
75 active_ports_--; | 75 active_ports_--; |
76 } | 76 } |
77 | 77 |
| 78 Dart_Port main_port() { return main_port_; } |
| 79 void set_main_port(Dart_Port port) { |
| 80 ASSERT(main_port_ == 0); // Only set main port once. |
| 81 main_port_ = port; |
| 82 } |
| 83 |
78 Heap* heap() const { return heap_; } | 84 Heap* heap() const { return heap_; } |
79 void set_heap(Heap* value) { heap_ = value; } | 85 void set_heap(Heap* value) { heap_ = value; } |
80 static intptr_t heap_offset() { return OFFSET_OF(Isolate, heap_); } | 86 static intptr_t heap_offset() { return OFFSET_OF(Isolate, heap_); } |
81 | 87 |
82 ObjectStore* object_store() const { return object_store_; } | 88 ObjectStore* object_store() const { return object_store_; } |
83 void set_object_store(ObjectStore* value) { object_store_ = value; } | 89 void set_object_store(ObjectStore* value) { object_store_ = value; } |
84 static intptr_t object_store_offset() { | 90 static intptr_t object_store_offset() { |
85 return OFFSET_OF(Isolate, object_store_); | 91 return OFFSET_OF(Isolate, object_store_); |
86 } | 92 } |
87 | 93 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 240 |
235 static const uword kStackSizeBuffer = (128 * KB); | 241 static const uword kStackSizeBuffer = (128 * KB); |
236 static const uword kDefaultStackSize = (1 * MB); | 242 static const uword kDefaultStackSize = (1 * MB); |
237 | 243 |
238 StoreBufferBlock store_buffer_; | 244 StoreBufferBlock store_buffer_; |
239 Monitor* monitor_; | 245 Monitor* monitor_; |
240 MessageQueue* message_queue_; | 246 MessageQueue* message_queue_; |
241 Dart_PostMessageCallback post_message_callback_; | 247 Dart_PostMessageCallback post_message_callback_; |
242 Dart_ClosePortCallback close_port_callback_; | 248 Dart_ClosePortCallback close_port_callback_; |
243 intptr_t active_ports_; | 249 intptr_t active_ports_; |
| 250 Dart_Port main_port_; |
244 Heap* heap_; | 251 Heap* heap_; |
245 ObjectStore* object_store_; | 252 ObjectStore* object_store_; |
246 StackResource* top_resource_; | 253 StackResource* top_resource_; |
247 RawContext* top_context_; | 254 RawContext* top_context_; |
248 Zone* current_zone_; | 255 Zone* current_zone_; |
249 #if defined(DEBUG) | 256 #if defined(DEBUG) |
250 int32_t no_gc_scope_depth_; | 257 int32_t no_gc_scope_depth_; |
251 int32_t no_handle_scope_depth_; | 258 int32_t no_handle_scope_depth_; |
252 HandleScope* top_handle_scope_; | 259 HandleScope* top_handle_scope_; |
253 #endif | 260 #endif |
(...skipping 22 matching lines...) Expand all Loading... |
276 #include "vm/isolate_linux.h" | 283 #include "vm/isolate_linux.h" |
277 #elif defined(TARGET_OS_MACOS) | 284 #elif defined(TARGET_OS_MACOS) |
278 #include "vm/isolate_macos.h" | 285 #include "vm/isolate_macos.h" |
279 #elif defined(TARGET_OS_WINDOWS) | 286 #elif defined(TARGET_OS_WINDOWS) |
280 #include "vm/isolate_win.h" | 287 #include "vm/isolate_win.h" |
281 #else | 288 #else |
282 #error Unknown target os. | 289 #error Unknown target os. |
283 #endif | 290 #endif |
284 | 291 |
285 #endif // VM_ISOLATE_H_ | 292 #endif // VM_ISOLATE_H_ |
OLD | NEW |