| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/service_isolate.h" | 5 #include "vm/service_isolate.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 TimelineDurationScope tds(Timeline::GetVMStream(), | 294 TimelineDurationScope tds(Timeline::GetVMStream(), |
| 295 "ServiceIsolateStartup"); | 295 "ServiceIsolateStartup"); |
| 296 char* error = NULL; | 296 char* error = NULL; |
| 297 Isolate* isolate = NULL; | 297 Isolate* isolate = NULL; |
| 298 | 298 |
| 299 Dart_IsolateCreateCallback create_callback = | 299 Dart_IsolateCreateCallback create_callback = |
| 300 ServiceIsolate::create_callback(); | 300 ServiceIsolate::create_callback(); |
| 301 // TODO(johnmccutchan): Support starting up service isolate without embedder | 301 // TODO(johnmccutchan): Support starting up service isolate without embedder |
| 302 // provided isolate creation callback. | 302 // provided isolate creation callback. |
| 303 if (create_callback == NULL) { | 303 if (create_callback == NULL) { |
| 304 ServiceIsolate::SetServiceIsolate(NULL); |
| 304 ServiceIsolate::FinishedInitializing(); | 305 ServiceIsolate::FinishedInitializing(); |
| 305 return; | 306 return; |
| 306 } | 307 } |
| 307 | 308 |
| 308 Isolate::Flags default_flags; | 309 Isolate::Flags default_flags; |
| 309 Dart_IsolateFlags api_flags; | 310 Dart_IsolateFlags api_flags; |
| 310 default_flags.CopyTo(&api_flags); | 311 default_flags.CopyTo(&api_flags); |
| 311 | 312 |
| 312 isolate = | 313 isolate = |
| 313 reinterpret_cast<Isolate*>(create_callback(ServiceIsolate::kName, | 314 reinterpret_cast<Isolate*>(create_callback(ServiceIsolate::kName, |
| 314 NULL, | 315 NULL, |
| 315 NULL, | 316 NULL, |
| 316 NULL, | 317 NULL, |
| 317 &api_flags, | 318 &api_flags, |
| 318 NULL, | 319 NULL, |
| 319 &error)); | 320 &error)); |
| 320 if (isolate == NULL) { | 321 if (isolate == NULL) { |
| 321 OS::PrintErr("vm-service: Isolate creation error: %s\n", error); | 322 OS::PrintErr("vm-service: Isolate creation error: %s\n", error); |
| 323 ServiceIsolate::SetServiceIsolate(NULL); |
| 322 ServiceIsolate::FinishedInitializing(); | 324 ServiceIsolate::FinishedInitializing(); |
| 323 return; | 325 return; |
| 324 } | 326 } |
| 325 | 327 |
| 326 | 328 |
| 327 Thread::ExitIsolate(); | 329 Thread::ExitIsolate(); |
| 328 | 330 |
| 329 ServiceIsolate::ConstructExitMessageAndCache(isolate); | 331 ServiceIsolate::ConstructExitMessageAndCache(isolate); |
| 330 | 332 |
| 331 RunMain(isolate); | 333 RunMain(isolate); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 ASSERT(!result.IsNull()); | 494 ASSERT(!result.IsNull()); |
| 493 Dart_Port port = ILLEGAL_PORT; | 495 Dart_Port port = ILLEGAL_PORT; |
| 494 if (result.IsReceivePort()) { | 496 if (result.IsReceivePort()) { |
| 495 port = ReceivePort::Cast(result).Id(); | 497 port = ReceivePort::Cast(result).Id(); |
| 496 } | 498 } |
| 497 ASSERT(port != ILLEGAL_PORT); | 499 ASSERT(port != ILLEGAL_PORT); |
| 498 ServiceIsolate::SetServicePort(port); | 500 ServiceIsolate::SetServicePort(port); |
| 499 } | 501 } |
| 500 | 502 |
| 501 } // namespace dart | 503 } // namespace dart |
| OLD | NEW |