| 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 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 jsobj.AddProperty("pauseOnExit", message_handler()->should_pause_on_exit()); | 1988 jsobj.AddProperty("pauseOnExit", message_handler()->should_pause_on_exit()); |
| 1989 #if !defined(DART_PRECOMPILED_RUNTIME) | 1989 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 1990 jsobj.AddProperty("_isReloading", IsReloading()); | 1990 jsobj.AddProperty("_isReloading", IsReloading()); |
| 1991 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1991 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 1992 | 1992 |
| 1993 if (!is_runnable()) { | 1993 if (!is_runnable()) { |
| 1994 // Isolate is not yet runnable. | 1994 // Isolate is not yet runnable. |
| 1995 ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); | 1995 ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
| 1996 ServiceEvent pause_event(this, ServiceEvent::kNone); | 1996 ServiceEvent pause_event(this, ServiceEvent::kNone); |
| 1997 jsobj.AddProperty("pauseEvent", &pause_event); | 1997 jsobj.AddProperty("pauseEvent", &pause_event); |
| 1998 } else if (message_handler()->is_paused_on_start() || | 1998 } else if (message_handler()->should_pause_on_start()) { |
| 1999 message_handler()->should_pause_on_start()) { | 1999 if (message_handler()->is_paused_on_start()) { |
| 2000 ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); | 2000 ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
| 2001 ServiceEvent pause_event(this, ServiceEvent::kPauseStart); | 2001 ServiceEvent pause_event(this, ServiceEvent::kPauseStart); |
| 2002 jsobj.AddProperty("pauseEvent", &pause_event); | 2002 jsobj.AddProperty("pauseEvent", &pause_event); |
| 2003 } else { |
| 2004 // Isolate is runnable but not paused on start. |
| 2005 // Some service clients get confused if they see: |
| 2006 // NotRunnable -> Runnable -> PausedAtStart |
| 2007 // Treat Runnable+ShouldPauseOnStart as NotRunnable so they see: |
| 2008 // NonRunnable -> PausedAtStart |
| 2009 // The should_pause_on_start flag is set to false after resume. |
| 2010 ASSERT((debugger() == NULL) || (debugger()->PauseEvent() == NULL)); |
| 2011 ServiceEvent pause_event(this, ServiceEvent::kNone); |
| 2012 jsobj.AddProperty("pauseEvent", &pause_event); |
| 2013 } |
| 2003 } else if (message_handler()->is_paused_on_exit() && | 2014 } else if (message_handler()->is_paused_on_exit() && |
| 2004 ((debugger() == NULL) || (debugger()->PauseEvent() == NULL))) { | 2015 ((debugger() == NULL) || (debugger()->PauseEvent() == NULL))) { |
| 2005 ServiceEvent pause_event(this, ServiceEvent::kPauseExit); | 2016 ServiceEvent pause_event(this, ServiceEvent::kPauseExit); |
| 2006 jsobj.AddProperty("pauseEvent", &pause_event); | 2017 jsobj.AddProperty("pauseEvent", &pause_event); |
| 2007 } else if ((debugger() != NULL) && (debugger()->PauseEvent() != NULL) && | 2018 } else if ((debugger() != NULL) && (debugger()->PauseEvent() != NULL) && |
| 2008 !ResumeRequest()) { | 2019 !ResumeRequest()) { |
| 2009 jsobj.AddProperty("pauseEvent", debugger()->PauseEvent()); | 2020 jsobj.AddProperty("pauseEvent", debugger()->PauseEvent()); |
| 2010 } else { | 2021 } else { |
| 2011 ServiceEvent pause_event(this, ServiceEvent::kResume); | 2022 ServiceEvent pause_event(this, ServiceEvent::kResume); |
| 2012 | 2023 |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2909 void IsolateSpawnState::DecrementSpawnCount() { | 2920 void IsolateSpawnState::DecrementSpawnCount() { |
| 2910 ASSERT(spawn_count_monitor_ != NULL); | 2921 ASSERT(spawn_count_monitor_ != NULL); |
| 2911 ASSERT(spawn_count_ != NULL); | 2922 ASSERT(spawn_count_ != NULL); |
| 2912 MonitorLocker ml(spawn_count_monitor_); | 2923 MonitorLocker ml(spawn_count_monitor_); |
| 2913 ASSERT(*spawn_count_ > 0); | 2924 ASSERT(*spawn_count_ > 0); |
| 2914 *spawn_count_ = *spawn_count_ - 1; | 2925 *spawn_count_ = *spawn_count_ - 1; |
| 2915 ml.Notify(); | 2926 ml.Notify(); |
| 2916 } | 2927 } |
| 2917 | 2928 |
| 2918 } // namespace dart | 2929 } // namespace dart |
| OLD | NEW |