| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/kernel_reader.h" | 5 #include "vm/kernel_reader.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/kernel_binary.h" | 10 #include "vm/kernel_binary.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 void KernelReader::ReadLibrary(intptr_t kernel_offset) { | 251 void KernelReader::ReadLibrary(intptr_t kernel_offset) { |
| 252 builder_.SetOffset(kernel_offset); | 252 builder_.SetOffset(kernel_offset); |
| 253 LibraryHelper library_helper(&builder_); | 253 LibraryHelper library_helper(&builder_); |
| 254 library_helper.ReadUntilIncluding(LibraryHelper::kCanonicalName); | 254 library_helper.ReadUntilIncluding(LibraryHelper::kCanonicalName); |
| 255 Library& library = LookupLibrary(library_helper.canonical_name_); | 255 Library& library = LookupLibrary(library_helper.canonical_name_); |
| 256 // The Kernel library is external implies that it is already loaded. |
| 257 ASSERT(!library_helper.IsExternal() || library.Loaded()); |
| 256 if (library.Loaded()) return; | 258 if (library.Loaded()) return; |
| 257 | 259 |
| 258 library_helper.ReadUntilIncluding(LibraryHelper::kName); | 260 library_helper.ReadUntilIncluding(LibraryHelper::kName); |
| 259 library.SetName(H.DartSymbol(library_helper.name_index_)); | 261 library.SetName(H.DartSymbol(library_helper.name_index_)); |
| 260 | 262 |
| 261 // The bootstrapper will take care of creating the native wrapper classes, but | 263 // The bootstrapper will take care of creating the native wrapper classes, but |
| 262 // we will add the synthetic constructors to them here. | 264 // we will add the synthetic constructors to them here. |
| 263 if (library.name() == | 265 if (library.name() == |
| 264 Symbols::Symbol(Symbols::kDartNativeWrappersLibNameId).raw()) { | 266 Symbols::Symbol(Symbols::kDartNativeWrappersLibNameId).raw()) { |
| 265 ASSERT(library.LoadInProgress()); | 267 ASSERT(library.LoadInProgress()); |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 initializer_fun.set_result_type(AbstractType::Handle(zone, field.type())); | 1005 initializer_fun.set_result_type(AbstractType::Handle(zone, field.type())); |
| 1004 initializer_fun.set_is_debuggable(false); | 1006 initializer_fun.set_is_debuggable(false); |
| 1005 initializer_fun.set_is_reflectable(false); | 1007 initializer_fun.set_is_reflectable(false); |
| 1006 initializer_fun.set_is_inlinable(false); | 1008 initializer_fun.set_is_inlinable(false); |
| 1007 return new (zone) ParsedFunction(thread, initializer_fun); | 1009 return new (zone) ParsedFunction(thread, initializer_fun); |
| 1008 } | 1010 } |
| 1009 | 1011 |
| 1010 } // namespace kernel | 1012 } // namespace kernel |
| 1011 } // namespace dart | 1013 } // namespace dart |
| 1012 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1014 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| OLD | NEW |