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 #include "vm/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 DECLARE_FLAG(bool, print_metrics); | 51 DECLARE_FLAG(bool, print_metrics); |
52 DECLARE_FLAG(bool, timing); | 52 DECLARE_FLAG(bool, timing); |
53 DECLARE_FLAG(bool, trace_service); | 53 DECLARE_FLAG(bool, trace_service); |
54 | 54 |
55 DEFINE_FLAG(bool, trace_isolates, false, | 55 DEFINE_FLAG(bool, trace_isolates, false, |
56 "Trace isolate creation and shut down."); | 56 "Trace isolate creation and shut down."); |
57 DEFINE_FLAG(bool, pause_isolates_on_start, false, | 57 DEFINE_FLAG(bool, pause_isolates_on_start, false, |
58 "Pause isolates before starting."); | 58 "Pause isolates before starting."); |
59 DEFINE_FLAG(bool, pause_isolates_on_exit, false, | 59 DEFINE_FLAG(bool, pause_isolates_on_exit, false, |
60 "Pause isolates exiting."); | 60 "Pause isolates exiting."); |
| 61 DEFINE_FLAG(bool, pause_isolates_on_unhandled_exceptions, false, |
| 62 "Pause isolates on unhandled exceptions."); |
| 63 |
61 DEFINE_FLAG(bool, break_at_isolate_spawn, false, | 64 DEFINE_FLAG(bool, break_at_isolate_spawn, false, |
62 "Insert a one-time breakpoint at the entrypoint for all spawned " | 65 "Insert a one-time breakpoint at the entrypoint for all spawned " |
63 "isolates"); | 66 "isolates"); |
64 | 67 |
65 DEFINE_FLAG(int, new_gen_semi_max_size, (kWordSize <= 4) ? 16 : 32, | 68 DEFINE_FLAG(int, new_gen_semi_max_size, (kWordSize <= 4) ? 16 : 32, |
66 "Max size of new gen semi space in MB"); | 69 "Max size of new gen semi space in MB"); |
67 DEFINE_FLAG(int, old_gen_heap_size, 0, | 70 DEFINE_FLAG(int, old_gen_heap_size, 0, |
68 "Max size of old gen heap size in MB, or 0 for unlimited," | 71 "Max size of old gen heap size in MB, or 0 for unlimited," |
69 "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap"); | 72 "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap"); |
70 DEFINE_FLAG(int, external_max_size, (kWordSize <= 4) ? 512 : 1024, | 73 DEFINE_FLAG(int, external_max_size, (kWordSize <= 4) ? 512 : 1024, |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 if (is_runnable() == true) { | 1066 if (is_runnable() == true) { |
1064 return false; // Already runnable. | 1067 return false; // Already runnable. |
1065 } | 1068 } |
1066 // Set the isolate as runnable and if we are being spawned schedule | 1069 // Set the isolate as runnable and if we are being spawned schedule |
1067 // isolate on thread pool for execution. | 1070 // isolate on thread pool for execution. |
1068 ASSERT(object_store()->root_library() != Library::null()); | 1071 ASSERT(object_store()->root_library() != Library::null()); |
1069 set_is_runnable(true); | 1072 set_is_runnable(true); |
1070 if (!ServiceIsolate::IsServiceIsolate(this)) { | 1073 if (!ServiceIsolate::IsServiceIsolate(this)) { |
1071 message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start); | 1074 message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start); |
1072 message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit); | 1075 message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit); |
| 1076 if (FLAG_pause_isolates_on_unhandled_exceptions) { |
| 1077 debugger()->SetExceptionPauseInfo(kPauseOnUnhandledExceptions); |
| 1078 } |
1073 } | 1079 } |
1074 IsolateSpawnState* state = spawn_state(); | 1080 IsolateSpawnState* state = spawn_state(); |
1075 if (state != NULL) { | 1081 if (state != NULL) { |
1076 ASSERT(this == state->isolate()); | 1082 ASSERT(this == state->isolate()); |
1077 Run(); | 1083 Run(); |
1078 } | 1084 } |
1079 TimelineStream* stream = GetIsolateStream(); | 1085 TimelineStream* stream = GetIsolateStream(); |
1080 ASSERT(stream != NULL); | 1086 ASSERT(stream != NULL); |
1081 TimelineEvent* event = stream->StartEvent(); | 1087 TimelineEvent* event = stream->StartEvent(); |
1082 if (event != NULL) { | 1088 if (event != NULL) { |
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2553 void IsolateSpawnState::DecrementSpawnCount() { | 2559 void IsolateSpawnState::DecrementSpawnCount() { |
2554 ASSERT(spawn_count_monitor_ != NULL); | 2560 ASSERT(spawn_count_monitor_ != NULL); |
2555 ASSERT(spawn_count_ != NULL); | 2561 ASSERT(spawn_count_ != NULL); |
2556 MonitorLocker ml(spawn_count_monitor_); | 2562 MonitorLocker ml(spawn_count_monitor_); |
2557 ASSERT(*spawn_count_ > 0); | 2563 ASSERT(*spawn_count_ > 0); |
2558 *spawn_count_ = *spawn_count_ - 1; | 2564 *spawn_count_ = *spawn_count_ - 1; |
2559 ml.Notify(); | 2565 ml.Notify(); |
2560 } | 2566 } |
2561 | 2567 |
2562 } // namespace dart | 2568 } // namespace dart |
OLD | NEW |