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

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

Issue 295353002: Fix pause-on-start and pause-on-exit with async loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | runtime/vm/service.cc » ('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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 ASSERT(state != NULL); 439 ASSERT(state != NULL);
440 result->set_api_state(state); 440 result->set_api_state(state);
441 441
442 // Initialize stack top and limit in case we are running the isolate in the 442 // Initialize stack top and limit in case we are running the isolate in the
443 // main thread. 443 // main thread.
444 // TODO(5411455): Need to figure out how to set the stack limit for the 444 // TODO(5411455): Need to figure out how to set the stack limit for the
445 // main thread. 445 // main thread.
446 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result)); 446 result->SetStackLimitFromCurrentTOS(reinterpret_cast<uword>(&result));
447 result->set_main_port(PortMap::CreatePort(result->message_handler())); 447 result->set_main_port(PortMap::CreatePort(result->message_handler()));
448 result->BuildName(name_prefix); 448 result->BuildName(name_prefix);
449 result->message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start);
450 result->message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit);
451 449
452 result->debugger_ = new Debugger(); 450 result->debugger_ = new Debugger();
453 result->debugger_->Initialize(result); 451 result->debugger_->Initialize(result);
454 if (FLAG_trace_isolates) { 452 if (FLAG_trace_isolates) {
455 if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) { 453 if (name_prefix == NULL || strcmp(name_prefix, "vm-isolate") != 0) {
456 OS::Print("[+] Starting isolate:\n" 454 OS::Print("[+] Starting isolate:\n"
457 "\tisolate: %s\n", result->name()); 455 "\tisolate: %s\n", result->name());
458 } 456 }
459 } 457 }
460 458
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 // a StackResource, which requires a current isolate. 538 // a StackResource, which requires a current isolate.
541 mutex_->Lock(); 539 mutex_->Lock();
542 // Check if we are in a valid state to make the isolate runnable. 540 // Check if we are in a valid state to make the isolate runnable.
543 if (is_runnable_ == true) { 541 if (is_runnable_ == true) {
544 mutex_->Unlock(); 542 mutex_->Unlock();
545 return false; // Already runnable. 543 return false; // Already runnable.
546 } 544 }
547 // Set the isolate as runnable and if we are being spawned schedule 545 // Set the isolate as runnable and if we are being spawned schedule
548 // isolate on thread pool for execution. 546 // isolate on thread pool for execution.
549 is_runnable_ = true; 547 is_runnable_ = true;
548 if (!Service::IsServiceIsolate(this)) {
549 message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start);
550 message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit);
551 }
550 IsolateSpawnState* state = spawn_state(); 552 IsolateSpawnState* state = spawn_state();
551 if (state != NULL) { 553 if (state != NULL) {
552 ASSERT(this == state->isolate()); 554 ASSERT(this == state->isolate());
553 Run(); 555 Run();
554 } 556 }
555 mutex_->Unlock(); 557 mutex_->Unlock();
556 return true; 558 return true;
557 } 559 }
558 560
559 561
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 return func.raw(); 1197 return func.raw();
1196 } 1198 }
1197 1199
1198 1200
1199 void IsolateSpawnState::Cleanup() { 1201 void IsolateSpawnState::Cleanup() {
1200 SwitchIsolateScope switch_scope(isolate()); 1202 SwitchIsolateScope switch_scope(isolate());
1201 Dart::ShutdownIsolate(); 1203 Dart::ShutdownIsolate();
1202 } 1204 }
1203 1205
1204 } // namespace dart 1206 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698