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 "vm/bootstrap.h" | 5 #include "vm/bootstrap.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "vm/bootstrap_natives.h" | 9 #include "vm/bootstrap_natives.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 break; | 125 break; |
126 } | 126 } |
127 } | 127 } |
128 if ((source_path == NULL) && (source_data == NULL)) { | 128 if ((source_path == NULL) && (source_data == NULL)) { |
129 return String::null(); // Uri does not exist in path mapping information. | 129 return String::null(); // Uri does not exist in path mapping information. |
130 } | 130 } |
131 | 131 |
132 const uint8_t* utf8_array = NULL; | 132 const uint8_t* utf8_array = NULL; |
133 intptr_t file_length = -1; | 133 intptr_t file_length = -1; |
134 | 134 |
135 Dart_FileOpenCallback file_open = Isolate::file_open_callback(); | 135 Dart_FileOpenCallback file_open = Dart::file_open_callback(); |
136 Dart_FileReadCallback file_read = Isolate::file_read_callback(); | 136 Dart_FileReadCallback file_read = Dart::file_read_callback(); |
137 Dart_FileCloseCallback file_close = Isolate::file_close_callback(); | 137 Dart_FileCloseCallback file_close = Dart::file_close_callback(); |
138 if ((file_open != NULL) && (file_read != NULL) && (file_close != NULL)) { | 138 if ((file_open != NULL) && (file_read != NULL) && (file_close != NULL)) { |
139 // Try to open and read the file. | 139 // Try to open and read the file. |
140 void* stream = (*file_open)(source_path, false); | 140 void* stream = (*file_open)(source_path, false); |
141 if (stream != NULL) { | 141 if (stream != NULL) { |
142 (*file_read)(&utf8_array, &file_length, stream); | 142 (*file_read)(&utf8_array, &file_length, stream); |
143 (*file_close)(stream); | 143 (*file_close)(stream); |
144 } | 144 } |
145 } | 145 } |
146 if (file_length == -1) { | 146 if (file_length == -1) { |
147 if (source_data != NULL) { | 147 if (source_data != NULL) { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 Compiler::CompileClass(cls); | 363 Compiler::CompileClass(cls); |
364 } | 364 } |
365 | 365 |
366 // Restore the library tag handler for the isolate. | 366 // Restore the library tag handler for the isolate. |
367 isolate->set_library_tag_handler(saved_tag_handler); | 367 isolate->set_library_tag_handler(saved_tag_handler); |
368 | 368 |
369 return error.raw(); | 369 return error.raw(); |
370 } | 370 } |
371 | 371 |
372 } // namespace dart | 372 } // namespace dart |
OLD | NEW |