OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 <stdio.h> | 5 #include <stdio.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" |
| 11 #include "bin/platform.h" |
11 | 12 |
12 namespace dart { | 13 namespace dart { |
13 namespace bin { | 14 namespace bin { |
14 | 15 |
15 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = { | 16 Builtin::builtin_lib_props Builtin::builtin_libraries_[] = { |
16 /* { url_, source_, patch_url_, patch_source_, has_natives_ } */ | 17 /* { url_, source_, patch_url_, patch_source_, has_natives_ } */ |
17 { DartUtils::kBuiltinLibURL, _builtin_source_paths_, NULL, NULL, true }, | 18 { DartUtils::kBuiltinLibURL, _builtin_source_paths_, NULL, NULL, true }, |
18 { DartUtils::kIOLibURL, io_source_paths_, | 19 { DartUtils::kIOLibURL, io_source_paths_, |
19 DartUtils::kIOLibPatchURL, io_patch_paths_, true }, | 20 DartUtils::kIOLibPatchURL, io_patch_paths_, true }, |
20 }; | 21 }; |
21 | 22 |
| 23 Dart_Port Builtin::load_port_ = ILLEGAL_PORT; |
22 | 24 |
23 // Patch all the specified patch files in the array 'patch_files' into the | 25 // Patch all the specified patch files in the array 'patch_files' into the |
24 // library specified in 'library'. | 26 // library specified in 'library'. |
25 static void LoadPatchFiles(Dart_Handle library, | 27 static void LoadPatchFiles(Dart_Handle library, |
26 const char* patch_uri, | 28 const char* patch_uri, |
27 const char** patch_files) { | 29 const char** patch_files) { |
28 for (intptr_t j = 0; patch_files[j] != NULL; j += 2) { | 30 for (intptr_t j = 0; patch_files[j] != NULL; j += 2) { |
29 Dart_Handle patch_src = DartUtils::ReadStringFromFile(patch_files[j + 1]); | 31 Dart_Handle patch_src = DartUtils::ReadStringFromFile(patch_files[j + 1]); |
30 | 32 |
31 // Prepend the patch library URI to form a unique script URI for the patch. | 33 // Prepend the patch library URI to form a unique script URI for the patch. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 Dart_Handle library = Dart_LookupLibrary(url); | 113 Dart_Handle library = Dart_LookupLibrary(url); |
112 if (Dart_IsError(library)) { | 114 if (Dart_IsError(library)) { |
113 library = LoadLibrary(url, id); | 115 library = LoadLibrary(url, id); |
114 } | 116 } |
115 DART_CHECK_VALID(library); | 117 DART_CHECK_VALID(library); |
116 return library; | 118 return library; |
117 } | 119 } |
118 | 120 |
119 } // namespace bin | 121 } // namespace bin |
120 } // namespace dart | 122 } // namespace dart |
OLD | NEW |