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

Unified Diff: runtime/vm/isolate.cc

Issue 822803003: - Allow an isolate to be started in paused state. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
===================================================================
--- runtime/vm/isolate.cc (revision 42575)
+++ runtime/vm/isolate.cc (working copy)
@@ -959,6 +959,12 @@
Capability& capability = Capability::Handle();
capability = Capability::New(isolate->pause_capability());
capabilities.SetAt(0, capability);
+ // Check whether this isolate should be started in paused state.
+ if (state->paused()) {
+ bool added = isolate->AddResumeCapability(capability);
+ ASSERT(added); // There should be no pending resume capabilities.
+ isolate->message_handler()->increment_paused();
+ }
capability = Capability::New(isolate->terminate_capability());
capabilities.SetAt(1, capability);
@@ -1536,7 +1542,8 @@
IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
const Function& func,
- const Instance& message)
+ const Instance& message,
+ bool paused)
: isolate_(NULL),
parent_port_(parent_port),
script_url_(NULL),
@@ -1548,7 +1555,8 @@
serialized_args_(NULL),
serialized_args_len_(0),
serialized_message_(NULL),
- serialized_message_len_(0) {
+ serialized_message_len_(0),
+ paused_(paused) {
script_url_ = NULL;
const Class& cls = Class::Handle(func.Owner());
const Library& lib = Library::Handle(cls.library());
@@ -1570,7 +1578,8 @@
const char* script_url,
const char* package_root,
const Instance& args,
- const Instance& message)
+ const Instance& message,
+ bool paused)
: isolate_(NULL),
parent_port_(parent_port),
package_root_(NULL),
@@ -1581,7 +1590,8 @@
serialized_args_(NULL),
serialized_args_len_(0),
serialized_message_(NULL),
- serialized_message_len_(0) {
+ serialized_message_len_(0),
+ paused_(paused) {
script_url_ = strdup(script_url);
if (package_root != NULL) {
package_root_ = strdup(package_root);
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698