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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 } | 374 } |
375 | 375 |
376 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) { | 376 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) { |
377 shutdown_callback_ = cb; | 377 shutdown_callback_ = cb; |
378 } | 378 } |
379 static Dart_IsolateShutdownCallback ShutdownCallback() { | 379 static Dart_IsolateShutdownCallback ShutdownCallback() { |
380 return shutdown_callback_; | 380 return shutdown_callback_; |
381 } | 381 } |
382 | 382 |
383 static void SetFileCallbacks(Dart_FileOpenCallback file_open, | 383 static void SetFileCallbacks(Dart_FileOpenCallback file_open, |
| 384 Dart_FileReadCallback file_read, |
384 Dart_FileWriteCallback file_write, | 385 Dart_FileWriteCallback file_write, |
385 Dart_FileCloseCallback file_close) { | 386 Dart_FileCloseCallback file_close) { |
386 file_open_callback_ = file_open; | 387 file_open_callback_ = file_open; |
| 388 file_read_callback_ = file_read; |
387 file_write_callback_ = file_write; | 389 file_write_callback_ = file_write; |
388 file_close_callback_ = file_close; | 390 file_close_callback_ = file_close; |
389 } | 391 } |
390 | 392 |
391 static Dart_FileOpenCallback file_open_callback() { | 393 static Dart_FileOpenCallback file_open_callback() { |
392 return file_open_callback_; | 394 return file_open_callback_; |
393 } | 395 } |
| 396 static Dart_FileReadCallback file_read_callback() { |
| 397 return file_read_callback_; |
| 398 } |
394 static Dart_FileWriteCallback file_write_callback() { | 399 static Dart_FileWriteCallback file_write_callback() { |
395 return file_write_callback_; | 400 return file_write_callback_; |
396 } | 401 } |
397 static Dart_FileCloseCallback file_close_callback() { | 402 static Dart_FileCloseCallback file_close_callback() { |
398 return file_close_callback_; | 403 return file_close_callback_; |
399 } | 404 } |
400 | 405 |
401 intptr_t* deopt_cpu_registers_copy() const { | 406 intptr_t* deopt_cpu_registers_copy() const { |
402 return deopt_cpu_registers_copy_; | 407 return deopt_cpu_registers_copy_; |
403 } | 408 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 518 |
514 // Status support. | 519 // Status support. |
515 char* stacktrace_; | 520 char* stacktrace_; |
516 intptr_t stack_frame_index_; | 521 intptr_t stack_frame_index_; |
517 | 522 |
518 static Dart_IsolateCreateCallback create_callback_; | 523 static Dart_IsolateCreateCallback create_callback_; |
519 static Dart_IsolateInterruptCallback interrupt_callback_; | 524 static Dart_IsolateInterruptCallback interrupt_callback_; |
520 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; | 525 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; |
521 static Dart_IsolateShutdownCallback shutdown_callback_; | 526 static Dart_IsolateShutdownCallback shutdown_callback_; |
522 static Dart_FileOpenCallback file_open_callback_; | 527 static Dart_FileOpenCallback file_open_callback_; |
| 528 static Dart_FileReadCallback file_read_callback_; |
523 static Dart_FileWriteCallback file_write_callback_; | 529 static Dart_FileWriteCallback file_write_callback_; |
524 static Dart_FileCloseCallback file_close_callback_; | 530 static Dart_FileCloseCallback file_close_callback_; |
525 static Dart_IsolateInterruptCallback vmstats_callback_; | 531 static Dart_IsolateInterruptCallback vmstats_callback_; |
526 | 532 |
527 DISALLOW_COPY_AND_ASSIGN(Isolate); | 533 DISALLOW_COPY_AND_ASSIGN(Isolate); |
528 }; | 534 }; |
529 | 535 |
530 // When we need to execute code in an isolate, we use the | 536 // When we need to execute code in an isolate, we use the |
531 // StartIsolateScope. | 537 // StartIsolateScope. |
532 class StartIsolateScope { | 538 class StartIsolateScope { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 | 641 |
636 private: | 642 private: |
637 Isolate::IsolateRunState saved_state_; | 643 Isolate::IsolateRunState saved_state_; |
638 | 644 |
639 DISALLOW_COPY_AND_ASSIGN(IsolateRunStateManager); | 645 DISALLOW_COPY_AND_ASSIGN(IsolateRunStateManager); |
640 }; | 646 }; |
641 | 647 |
642 } // namespace dart | 648 } // namespace dart |
643 | 649 |
644 #endif // VM_ISOLATE_H_ | 650 #endif // VM_ISOLATE_H_ |
OLD | NEW |