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/atomic.h" | 10 #include "vm/atomic.h" |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 return create_callback_; | 424 return create_callback_; |
425 } | 425 } |
426 | 426 |
427 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) { | 427 static void SetShutdownCallback(Dart_IsolateShutdownCallback cb) { |
428 shutdown_callback_ = cb; | 428 shutdown_callback_ = cb; |
429 } | 429 } |
430 static Dart_IsolateShutdownCallback ShutdownCallback() { | 430 static Dart_IsolateShutdownCallback ShutdownCallback() { |
431 return shutdown_callback_; | 431 return shutdown_callback_; |
432 } | 432 } |
433 | 433 |
434 static void SetFileCallbacks(Dart_FileOpenCallback file_open, | |
435 Dart_FileReadCallback file_read, | |
436 Dart_FileWriteCallback file_write, | |
437 Dart_FileCloseCallback file_close) { | |
438 file_open_callback_ = file_open; | |
439 file_read_callback_ = file_read; | |
440 file_write_callback_ = file_write; | |
441 file_close_callback_ = file_close; | |
442 } | |
443 | |
444 static Dart_FileOpenCallback file_open_callback() { | |
445 return file_open_callback_; | |
446 } | |
447 static Dart_FileReadCallback file_read_callback() { | |
448 return file_read_callback_; | |
449 } | |
450 static Dart_FileWriteCallback file_write_callback() { | |
451 return file_write_callback_; | |
452 } | |
453 static Dart_FileCloseCallback file_close_callback() { | |
454 return file_close_callback_; | |
455 } | |
456 | |
457 static void SetEntropySourceCallback(Dart_EntropySource entropy_source) { | |
458 entropy_source_callback_ = entropy_source; | |
459 } | |
460 static Dart_EntropySource entropy_source_callback() { | |
461 return entropy_source_callback_; | |
462 } | |
463 | |
464 void set_object_id_ring(ObjectIdRing* ring) { | 434 void set_object_id_ring(ObjectIdRing* ring) { |
465 object_id_ring_ = ring; | 435 object_id_ring_ = ring; |
466 } | 436 } |
467 ObjectIdRing* object_id_ring() { | 437 ObjectIdRing* object_id_ring() { |
468 return object_id_ring_; | 438 return object_id_ring_; |
469 } | 439 } |
470 | 440 |
471 DeoptContext* deopt_context() const { return deopt_context_; } | 441 DeoptContext* deopt_context() const { return deopt_context_; } |
472 void set_deopt_context(DeoptContext* value) { | 442 void set_deopt_context(DeoptContext* value) { |
473 ASSERT(value == NULL || deopt_context_ == NULL); | 443 ASSERT(value == NULL || deopt_context_ == NULL); |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 intptr_t spawn_count_; | 822 intptr_t spawn_count_; |
853 | 823 |
854 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \ | 824 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \ |
855 type metric_##variable##_; | 825 type metric_##variable##_; |
856 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE); | 826 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE); |
857 #undef ISOLATE_METRIC_VARIABLE | 827 #undef ISOLATE_METRIC_VARIABLE |
858 | 828 |
859 | 829 |
860 static Dart_IsolateCreateCallback create_callback_; | 830 static Dart_IsolateCreateCallback create_callback_; |
861 static Dart_IsolateShutdownCallback shutdown_callback_; | 831 static Dart_IsolateShutdownCallback shutdown_callback_; |
862 static Dart_FileOpenCallback file_open_callback_; | |
863 static Dart_FileReadCallback file_read_callback_; | |
864 static Dart_FileWriteCallback file_write_callback_; | |
865 static Dart_FileCloseCallback file_close_callback_; | |
866 static Dart_EntropySource entropy_source_callback_; | |
867 static Dart_IsolateInterruptCallback vmstats_callback_; | 832 static Dart_IsolateInterruptCallback vmstats_callback_; |
868 | 833 |
869 static void WakePauseEventHandler(Dart_Isolate isolate); | 834 static void WakePauseEventHandler(Dart_Isolate isolate); |
870 | 835 |
871 // Manage list of existing isolates. | 836 // Manage list of existing isolates. |
872 static bool AddIsolateToList(Isolate* isolate); | 837 static bool AddIsolateToList(Isolate* isolate); |
873 static void RemoveIsolateFromList(Isolate* isolate); | 838 static void RemoveIsolateFromList(Isolate* isolate); |
874 | 839 |
875 // This monitor protects isolates_list_head_, and creation_enabled_. | 840 // This monitor protects isolates_list_head_, and creation_enabled_. |
876 static Monitor* isolates_list_monitor_; | 841 static Monitor* isolates_list_monitor_; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 intptr_t* spawn_count_; | 980 intptr_t* spawn_count_; |
1016 | 981 |
1017 Dart_IsolateFlags isolate_flags_; | 982 Dart_IsolateFlags isolate_flags_; |
1018 bool paused_; | 983 bool paused_; |
1019 bool errors_are_fatal_; | 984 bool errors_are_fatal_; |
1020 }; | 985 }; |
1021 | 986 |
1022 } // namespace dart | 987 } // namespace dart |
1023 | 988 |
1024 #endif // VM_ISOLATE_H_ | 989 #endif // VM_ISOLATE_H_ |
OLD | NEW |