| OLD | NEW |
| 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 "bin/vmservice_impl.h" | 5 #include "bin/vmservice_impl.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Wait until service is running on spawned thread. | 77 // Wait until service is running on spawned thread. |
| 78 ml.Wait(); | 78 ml.Wait(); |
| 79 } | 79 } |
| 80 return port_ != ILLEGAL_PORT; | 80 return port_ != ILLEGAL_PORT; |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 bool VmService::_Start(intptr_t server_port) { | 84 bool VmService::_Start(intptr_t server_port) { |
| 85 ASSERT(isolate_ == NULL); | 85 ASSERT(isolate_ == NULL); |
| 86 char* error = NULL; | 86 char* error = NULL; |
| 87 isolate_ = Dart_CreateIsolate("vmservice:", "main", snapshot_buffer, | 87 const char* script_uri = "vmservice:"; |
| 88 new IsolateData(), | 88 IsolateData* isolate_data = new IsolateData(script_uri); |
| 89 isolate_ = Dart_CreateIsolate(script_uri, "main", snapshot_buffer, |
| 90 isolate_data, |
| 89 &error); | 91 &error); |
| 90 if (isolate_ == NULL) { | 92 if (isolate_ == NULL) { |
| 91 error_msg_ = error; | 93 error_msg_ = error; |
| 92 return false; | 94 return false; |
| 93 } | 95 } |
| 94 | 96 |
| 95 Dart_EnterScope(); | 97 Dart_EnterScope(); |
| 96 | 98 |
| 97 if (snapshot_buffer != NULL) { | 99 if (snapshot_buffer != NULL) { |
| 98 // Setup the native resolver as the snapshot does not carry it. | 100 // Setup the native resolver as the snapshot does not carry it. |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 if (!strcmp(function_name, entry.name) && | 521 if (!strcmp(function_name, entry.name) && |
| 520 (num_arguments == entry.num_arguments)) { | 522 (num_arguments == entry.num_arguments)) { |
| 521 return entry.function; | 523 return entry.function; |
| 522 } | 524 } |
| 523 } | 525 } |
| 524 return NULL; | 526 return NULL; |
| 525 } | 527 } |
| 526 | 528 |
| 527 } // namespace bin | 529 } // namespace bin |
| 528 } // namespace dart | 530 } // namespace dart |
| OLD | NEW |