| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 if (server_address_ != NULL) { | 496 if (server_address_ != NULL) { |
| 497 free(server_address_); | 497 free(server_address_); |
| 498 server_address_ = NULL; | 498 server_address_ = NULL; |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 | 502 |
| 503 void ServiceIsolate::BootVmServiceLibrary() { | 503 void ServiceIsolate::BootVmServiceLibrary() { |
| 504 Thread* thread = Thread::Current(); |
| 504 const Library& vmservice_library = | 505 const Library& vmservice_library = |
| 505 Library::Handle(Library::LookupLibrary(Symbols::DartVMService())); | 506 Library::Handle(Library::LookupLibrary(thread, Symbols::DartVMService())); |
| 506 ASSERT(!vmservice_library.IsNull()); | 507 ASSERT(!vmservice_library.IsNull()); |
| 507 const String& boot_function_name = String::Handle(String::New("boot")); | 508 const String& boot_function_name = String::Handle(String::New("boot")); |
| 508 const Function& boot_function = | 509 const Function& boot_function = |
| 509 Function::Handle( | 510 Function::Handle( |
| 510 vmservice_library.LookupFunctionAllowPrivate(boot_function_name)); | 511 vmservice_library.LookupFunctionAllowPrivate(boot_function_name)); |
| 511 ASSERT(!boot_function.IsNull()); | 512 ASSERT(!boot_function.IsNull()); |
| 512 const Object& result = | 513 const Object& result = |
| 513 Object::Handle( | 514 Object::Handle( |
| 514 DartEntry::InvokeFunction(boot_function, Object::empty_array())); | 515 DartEntry::InvokeFunction(boot_function, Object::empty_array())); |
| 515 ASSERT(!result.IsNull()); | 516 ASSERT(!result.IsNull()); |
| 516 Dart_Port port = ILLEGAL_PORT; | 517 Dart_Port port = ILLEGAL_PORT; |
| 517 if (result.IsReceivePort()) { | 518 if (result.IsReceivePort()) { |
| 518 port = ReceivePort::Cast(result).Id(); | 519 port = ReceivePort::Cast(result).Id(); |
| 519 } | 520 } |
| 520 ASSERT(port != ILLEGAL_PORT); | 521 ASSERT(port != ILLEGAL_PORT); |
| 521 ServiceIsolate::SetServicePort(port); | 522 ServiceIsolate::SetServicePort(port); |
| 522 } | 523 } |
| 523 | 524 |
| 524 } // namespace dart | 525 } // namespace dart |
| OLD | NEW |