Chromium Code Reviews| 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 28 matching lines...) Expand all Loading... | |
| 39 | 39 |
| 40 static void InitOnce(); | 40 static void InitOnce(); |
| 41 static Isolate* Init(); | 41 static Isolate* Init(); |
| 42 void Shutdown(); | 42 void Shutdown(); |
| 43 | 43 |
| 44 // Visit all object pointers. | 44 // Visit all object pointers. |
| 45 void VisitObjectPointers(ObjectPointerVisitor* visitor, bool validate_frames); | 45 void VisitObjectPointers(ObjectPointerVisitor* visitor, bool validate_frames); |
| 46 | 46 |
| 47 StoreBufferBlock* store_buffer() { return &store_buffer_; } | 47 StoreBufferBlock* store_buffer() { return &store_buffer_; } |
| 48 | 48 |
| 49 Monitor* monitor() const { return monitor_; } | 49 Dart_PostMessageCallback post_message_callback() const { |
|
Anton Muhin
2011/10/18 17:19:58
will you add a TODO to handle concurrent update of
turnidge
2011/10/18 17:33:40
I added a comment in dart_api.h declaiming respons
| |
| 50 void set_monitor(Monitor* value) { monitor_ = value; } | 50 return post_message_callback_; |
| 51 } | |
| 52 void set_post_message_callback(Dart_PostMessageCallback value) { | |
| 53 post_message_callback_ = value; | |
| 54 } | |
| 55 | |
| 56 Dart_ClosePortCallback close_port_callback() const { | |
| 57 return close_port_callback_; | |
| 58 } | |
| 59 void set_close_port_callback(Dart_ClosePortCallback value) { | |
| 60 close_port_callback_ = value; | |
| 61 } | |
| 51 | 62 |
| 52 MessageQueue* message_queue() const { return message_queue_; } | 63 MessageQueue* message_queue() const { return message_queue_; } |
| 53 void set_message_queue(MessageQueue* value) { message_queue_ = value; } | 64 void set_message_queue(MessageQueue* value) { message_queue_ = value; } |
| 54 | 65 |
| 55 // The count of active ports is only correct when read from the current | 66 // The count of active ports is only correct when read from the current |
| 56 // isolate. This value is not protected from being updated concurrently. | 67 // isolate. This value is not protected from being updated concurrently. |
| 57 intptr_t active_ports() const { return active_ports_; } | 68 intptr_t active_ports() const { return active_ports_; } |
| 58 void increment_active_ports() { | 69 void increment_active_ports() { |
| 59 ASSERT(this == Isolate::Current()); | 70 ASSERT(this == Isolate::Current()); |
| 60 active_ports_++; | 71 active_ports_++; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 void SetStackLimitFromCurrentTOS(uword isolate_stack_top); | 213 void SetStackLimitFromCurrentTOS(uword isolate_stack_top); |
| 203 | 214 |
| 204 void ResetStackLimitAfterException() { | 215 void ResetStackLimitAfterException() { |
| 205 stack_limit_ = stack_limit_on_overflow_exception_ + kStackSizeBuffer; | 216 stack_limit_ = stack_limit_on_overflow_exception_ + kStackSizeBuffer; |
| 206 } | 217 } |
| 207 | 218 |
| 208 void AdjustStackLimitForException() { | 219 void AdjustStackLimitForException() { |
| 209 stack_limit_ = stack_limit_on_overflow_exception_; | 220 stack_limit_ = stack_limit_on_overflow_exception_; |
| 210 } | 221 } |
| 211 | 222 |
| 223 void StandardRunLoop(); | |
| 224 | |
| 212 intptr_t ast_node_id() const { return ast_node_id_; } | 225 intptr_t ast_node_id() const { return ast_node_id_; } |
| 213 void set_ast_node_id(int value) { ast_node_id_ = value; } | 226 void set_ast_node_id(int value) { ast_node_id_ = value; } |
| 214 | 227 |
| 215 private: | 228 private: |
| 216 Isolate(); | 229 Isolate(); |
| 217 | 230 |
| 218 void PrintInvokedFunctions(); | 231 void PrintInvokedFunctions(); |
| 219 | 232 |
| 220 static uword GetSpecifiedStackSize(); | 233 static uword GetSpecifiedStackSize(); |
| 221 | 234 |
| 222 static const uword kStackSizeBuffer = (128 * KB); | 235 static const uword kStackSizeBuffer = (128 * KB); |
| 223 static const uword kDefaultStackSize = (1 * MB); | 236 static const uword kDefaultStackSize = (1 * MB); |
| 224 | 237 |
| 225 StoreBufferBlock store_buffer_; | 238 StoreBufferBlock store_buffer_; |
| 226 Monitor* monitor_; | 239 Monitor* monitor_; |
| 227 MessageQueue* message_queue_; | 240 MessageQueue* message_queue_; |
| 241 Dart_PostMessageCallback post_message_callback_; | |
| 242 Dart_ClosePortCallback close_port_callback_; | |
| 228 intptr_t active_ports_; | 243 intptr_t active_ports_; |
| 229 Heap* heap_; | 244 Heap* heap_; |
| 230 ObjectStore* object_store_; | 245 ObjectStore* object_store_; |
| 231 StackResource* top_resource_; | 246 StackResource* top_resource_; |
| 232 RawContext* top_context_; | 247 RawContext* top_context_; |
| 233 Zone* current_zone_; | 248 Zone* current_zone_; |
| 234 #if defined(DEBUG) | 249 #if defined(DEBUG) |
| 235 int32_t no_gc_scope_depth_; | 250 int32_t no_gc_scope_depth_; |
| 236 int32_t no_handle_scope_depth_; | 251 int32_t no_handle_scope_depth_; |
| 237 HandleScope* top_handle_scope_; | 252 HandleScope* top_handle_scope_; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 261 #include "vm/isolate_linux.h" | 276 #include "vm/isolate_linux.h" |
| 262 #elif defined(TARGET_OS_MACOS) | 277 #elif defined(TARGET_OS_MACOS) |
| 263 #include "vm/isolate_macos.h" | 278 #include "vm/isolate_macos.h" |
| 264 #elif defined(TARGET_OS_WINDOWS) | 279 #elif defined(TARGET_OS_WINDOWS) |
| 265 #include "vm/isolate_win.h" | 280 #include "vm/isolate_win.h" |
| 266 #else | 281 #else |
| 267 #error Unknown target os. | 282 #error Unknown target os. |
| 268 #endif | 283 #endif |
| 269 | 284 |
| 270 #endif // VM_ISOLATE_H_ | 285 #endif // VM_ISOLATE_H_ |
| OLD | NEW |