| 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/base_isolate.h" | 10 #include "vm/base_isolate.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 static uword GetSpecifiedStackSize(); | 298 static uword GetSpecifiedStackSize(); |
| 299 | 299 |
| 300 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); | 300 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); |
| 301 | 301 |
| 302 // Interrupt bits. | 302 // Interrupt bits. |
| 303 enum { | 303 enum { |
| 304 kApiInterrupt = 0x1, // An interrupt from Dart_InterruptIsolate. | 304 kApiInterrupt = 0x1, // An interrupt from Dart_InterruptIsolate. |
| 305 kMessageInterrupt = 0x2, // An interrupt to process an out of band message. | 305 kMessageInterrupt = 0x2, // An interrupt to process an out of band message. |
| 306 kStoreBufferInterrupt = 0x4, // An interrupt to process the store buffer. | 306 kStoreBufferInterrupt = 0x4, // An interrupt to process the store buffer. |
| 307 kVmStatusInterrupt = 0x8, // An interrupt to process a status request. | |
| 308 | 307 |
| 309 kInterruptsMask = | 308 kInterruptsMask = |
| 310 kApiInterrupt | | 309 kApiInterrupt | |
| 311 kMessageInterrupt | | 310 kMessageInterrupt | |
| 312 kStoreBufferInterrupt | | 311 kStoreBufferInterrupt, |
| 313 kVmStatusInterrupt, | |
| 314 }; | 312 }; |
| 315 | 313 |
| 316 void ScheduleInterrupts(uword interrupt_bits); | 314 void ScheduleInterrupts(uword interrupt_bits); |
| 317 uword GetAndClearInterrupts(); | 315 uword GetAndClearInterrupts(); |
| 318 | 316 |
| 319 // Marks all libraries as loaded. | 317 // Marks all libraries as loaded. |
| 320 void DoneLoading(); | 318 void DoneLoading(); |
| 321 | 319 |
| 322 bool MakeRunnable(); | 320 bool MakeRunnable(); |
| 323 void Run(); | 321 void Run(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 return create_callback_; | 448 return create_callback_; |
| 451 } | 449 } |
| 452 | 450 |
| 453 static void SetInterruptCallback(Dart_IsolateInterruptCallback cb) { | 451 static void SetInterruptCallback(Dart_IsolateInterruptCallback cb) { |
| 454 interrupt_callback_ = cb; | 452 interrupt_callback_ = cb; |
| 455 } | 453 } |
| 456 static Dart_IsolateInterruptCallback InterruptCallback() { | 454 static Dart_IsolateInterruptCallback InterruptCallback() { |
| 457 return interrupt_callback_; | 455 return interrupt_callback_; |
| 458 } | 456 } |
| 459 | 457 |
| 460 static void SetVmStatsCallback(Dart_IsolateInterruptCallback cb) { | |
| 461 vmstats_callback_ = cb; | |
| 462 } | |
| 463 static Dart_IsolateInterruptCallback VmStatsCallback() { | |
| 464 return vmstats_callback_; | |
| 465 } | |
| 466 | |
| 467 static void SetUnhandledExceptionCallback( | 458 static void SetUnhandledExceptionCallback( |
| 468 Dart_IsolateUnhandledExceptionCallback cb) { | 459 Dart_IsolateUnhandledExceptionCallback cb) { |
| 469 unhandled_exception_callback_ = cb; | 460 unhandled_exception_callback_ = cb; |
| 470 } | 461 } |
| 471 static Dart_IsolateUnhandledExceptionCallback UnhandledExceptionCallback() { | 462 static Dart_IsolateUnhandledExceptionCallback UnhandledExceptionCallback() { |
| 472 return unhandled_exception_callback_; | 463 return unhandled_exception_callback_; |
| 473 } | 464 } |
| 474 | 465 |
| 475 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) { | 466 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) { |
| 476 shutdown_callback_ = cb; | 467 shutdown_callback_ = cb; |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 uint8_t* serialized_args_; | 912 uint8_t* serialized_args_; |
| 922 intptr_t serialized_args_len_; | 913 intptr_t serialized_args_len_; |
| 923 uint8_t* serialized_message_; | 914 uint8_t* serialized_message_; |
| 924 intptr_t serialized_message_len_; | 915 intptr_t serialized_message_len_; |
| 925 bool paused_; | 916 bool paused_; |
| 926 }; | 917 }; |
| 927 | 918 |
| 928 } // namespace dart | 919 } // namespace dart |
| 929 | 920 |
| 930 #endif // VM_ISOLATE_H_ | 921 #endif // VM_ISOLATE_H_ |
| OLD | NEW |