Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: runtime/vm/isolate.cc

Issue 271153002: Add pause/resume for isolates in vmservice/observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "lib/mirrors.h" 10 #include "lib/mirrors.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 object_store_(NULL), 306 object_store_(NULL),
307 top_context_(Context::null()), 307 top_context_(Context::null()),
308 top_exit_frame_info_(0), 308 top_exit_frame_info_(0),
309 init_callback_data_(NULL), 309 init_callback_data_(NULL),
310 environment_callback_(NULL), 310 environment_callback_(NULL),
311 library_tag_handler_(NULL), 311 library_tag_handler_(NULL),
312 api_state_(NULL), 312 api_state_(NULL),
313 stub_code_(NULL), 313 stub_code_(NULL),
314 debugger_(NULL), 314 debugger_(NULL),
315 single_step_(false), 315 single_step_(false),
316 resume_request_(false),
316 random_(), 317 random_(),
317 simulator_(NULL), 318 simulator_(NULL),
318 long_jump_base_(NULL), 319 long_jump_base_(NULL),
319 timer_list_(), 320 timer_list_(),
320 deopt_id_(0), 321 deopt_id_(0),
321 mutex_(new Mutex()), 322 mutex_(new Mutex()),
322 stack_limit_(0), 323 stack_limit_(0),
323 saved_stack_limit_(0), 324 saved_stack_limit_(0),
324 stack_overflow_flags_(0), 325 stack_overflow_flags_(0),
325 stack_overflow_count_(0), 326 stack_overflow_count_(0),
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 DebuggerStackTrace* stack = debugger()->StackTrace(); 931 DebuggerStackTrace* stack = debugger()->StackTrace();
931 if (stack->Length() > 0) { 932 if (stack->Length() > 0) {
932 JSONObject jsframe(&jsobj, "topFrame"); 933 JSONObject jsframe(&jsobj, "topFrame");
933 934
934 ActivationFrame* frame = stack->FrameAt(0); 935 ActivationFrame* frame = stack->FrameAt(0);
935 frame->PrintToJSONObject(&jsobj); 936 frame->PrintToJSONObject(&jsobj);
936 // TODO(turnidge): Implement depth differently -- differentiate 937 // TODO(turnidge): Implement depth differently -- differentiate
937 // inlined frames. 938 // inlined frames.
938 jsobj.AddProperty("depth", (intptr_t)0); 939 jsobj.AddProperty("depth", (intptr_t)0);
939 } 940 }
940 intptr_t live_ports = message_handler()->live_ports(); 941 jsobj.AddProperty("livePorts", message_handler()->live_ports());
941 intptr_t control_ports = message_handler()->control_ports(); 942 jsobj.AddProperty("controlPorts", message_handler()->control_ports());
942 bool paused_on_exit = message_handler()->paused_on_exit(); 943 jsobj.AddProperty("pauseOnExit", message_handler()->pause_on_exit());
943 bool pause_on_start = message_handler()->pause_on_start(); 944
944 bool pause_on_exit = message_handler()->pause_on_exit(); 945 // TODO(turnidge): Make the debugger support paused_on_start/exit.
945 jsobj.AddProperty("livePorts", live_ports); 946 if (message_handler()->paused_on_start()) {
946 jsobj.AddProperty("controlPorts", control_ports); 947 ASSERT(debugger()->PauseEvent() == NULL);
947 jsobj.AddProperty("pausedOnStart", pause_on_start); 948 DebuggerEvent pauseEvent(DebuggerEvent::kIsolateCreated);
948 jsobj.AddProperty("pausedOnExit", paused_on_exit); 949 jsobj.AddProperty("pauseEvent", &pauseEvent);
949 jsobj.AddProperty("pauseOnExit", pause_on_exit); 950 } else if (message_handler()->paused_on_exit()) {
951 ASSERT(debugger()->PauseEvent() == NULL);
952 DebuggerEvent pauseEvent(DebuggerEvent::kIsolateShutdown);
953 jsobj.AddProperty("pauseEvent", &pauseEvent);
954 } else if (debugger()->PauseEvent() != NULL) {
955 jsobj.AddProperty("pauseEvent", debugger()->PauseEvent());
956 }
957
950 const Library& lib = 958 const Library& lib =
951 Library::Handle(object_store()->root_library()); 959 Library::Handle(object_store()->root_library());
952 jsobj.AddProperty("rootLib", lib); 960 jsobj.AddProperty("rootLib", lib);
953 961
954 timer_list().PrintTimersToJSONProperty(&jsobj); 962 timer_list().PrintTimersToJSONProperty(&jsobj);
955 { 963 {
956 JSONObject tagCounters(&jsobj, "tagCounters"); 964 JSONObject tagCounters(&jsobj, "tagCounters");
957 vm_tag_counters()->PrintToJSONObject(&tagCounters); 965 vm_tag_counters()->PrintToJSONObject(&tagCounters);
958 } 966 }
959 if (object_store()->sticky_error() != Object::null()) { 967 if (object_store()->sticky_error() != Object::null()) {
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 return func.raw(); 1183 return func.raw();
1176 } 1184 }
1177 1185
1178 1186
1179 void IsolateSpawnState::Cleanup() { 1187 void IsolateSpawnState::Cleanup() {
1180 SwitchIsolateScope switch_scope(isolate()); 1188 SwitchIsolateScope switch_scope(isolate());
1181 Dart::ShutdownIsolate(); 1189 Dart::ShutdownIsolate();
1182 } 1190 }
1183 1191
1184 } // namespace dart 1192 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698