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

Unified Diff: runtime/vm/service_isolate.cc

Issue 1422753005: Minimize enter/exit isolate calls during startup and shutdown of service isolate. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_isolate.cc
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc
index 98cbeb957f7b42abdc8278494681b91bb35100f9..6f16f4190f9bd32fb3e349ded3074841000873cc 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -255,7 +255,6 @@ void ServiceIsolate::MaybeMakeServiceIsolate(Isolate* I) {
void ServiceIsolate::ConstructExitMessageAndCache(Isolate* I) {
// Construct and cache exit message here so we can send it without needing an
// isolate.
- StartIsolateScope iso_scope(I);
Thread* T = Thread::Current();
ASSERT(I == T->isolate());
ASSERT(I != NULL);
@@ -324,12 +323,12 @@ class RunServiceTask : public ThreadPool::Task {
return;
}
-
- Thread::ExitIsolate();
-
- ServiceIsolate::ConstructExitMessageAndCache(isolate);
-
- RunMain(isolate);
+ {
+ ASSERT(Isolate::Current() == NULL);
+ StartIsolateScope start_scope(isolate);
+ ServiceIsolate::ConstructExitMessageAndCache(isolate);
+ RunMain(isolate);
+ }
ServiceIsolate::FinishedInitializing();
@@ -348,6 +347,7 @@ class RunServiceTask : public ThreadPool::Task {
{
// Print the error if there is one. This may execute dart code to
// print the exception object, so we need to use a StartIsolateScope.
+ ASSERT(Isolate::Current() == NULL);
StartIsolateScope start_scope(I);
Thread* T = Thread::Current();
ASSERT(I == T->isolate());
@@ -359,10 +359,8 @@ class RunServiceTask : public ThreadPool::Task {
OS::PrintErr("vm-service: Error: %s\n", error.ToErrorCString());
}
Dart::RunShutdownCallback();
- }
- {
+
// Shut the isolate down.
- SwitchIsolateScope switch_scope(I);
Dart::ShutdownIsolate();
}
if (FLAG_trace_service) {
@@ -376,8 +374,6 @@ class RunServiceTask : public ThreadPool::Task {
// TODO(24651): Remove this.
return;
}
-
- StartIsolateScope iso_scope(I);
Thread* T = Thread::Current();
ASSERT(I == T->isolate());
StackZone zone(T);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698