| 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 #if !defined(DART_PRECOMPILED_RUNTIME) | 4 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 5 | 5 |
| 6 #include "vm/kernel_binary.h" | 6 #include "vm/kernel_binary.h" |
| 7 #include "platform/globals.h" | 7 #include "platform/globals.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/kernel.h" | 10 #include "vm/kernel.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 ASSERT(flags == 0); // external libraries not supported | 175 ASSERT(flags == 0); // external libraries not supported |
| 176 kernel_data_ = reader->buffer(); | 176 kernel_data_ = reader->buffer(); |
| 177 kernel_data_size_ = reader->size(); | 177 kernel_data_size_ = reader->size(); |
| 178 | 178 |
| 179 canonical_name_ = reader->ReadCanonicalNameReference(); | 179 canonical_name_ = reader->ReadCanonicalNameReference(); |
| 180 name_index_ = StringIndex(reader->ReadUInt()); | 180 name_index_ = StringIndex(reader->ReadUInt()); |
| 181 import_uri_index_ = reader->CanonicalNameString(canonical_name_); | 181 import_uri_index_ = reader->CanonicalNameString(canonical_name_); |
| 182 source_uri_index_ = reader->ReadUInt(); | 182 source_uri_index_ = reader->ReadUInt(); |
| 183 reader->set_current_script_id(source_uri_index_); | 183 reader->set_current_script_id(source_uri_index_); |
| 184 | 184 |
| 185 annotations_.ReadFromStatic<Expression>(reader); |
| 185 dependencies().ReadFromStatic<LibraryDependency>(reader); | 186 dependencies().ReadFromStatic<LibraryDependency>(reader); |
| 186 int num_typedefs = reader->ReadUInt(); | 187 int num_typedefs = reader->ReadUInt(); |
| 187 typedefs().EnsureInitialized(num_typedefs); | 188 typedefs().EnsureInitialized(num_typedefs); |
| 188 for (intptr_t i = 0; i < num_typedefs; i++) { | 189 for (intptr_t i = 0; i < num_typedefs; i++) { |
| 189 typedefs().GetOrCreate<Typedef>(i, this)->ReadFrom(reader); | 190 typedefs().GetOrCreate<Typedef>(i, this)->ReadFrom(reader); |
| 190 } | 191 } |
| 191 int num_classes = reader->ReadUInt(); | 192 int num_classes = reader->ReadUInt(); |
| 192 classes().EnsureInitialized(num_classes); | 193 classes().EnsureInitialized(num_classes); |
| 193 for (intptr_t i = 0; i < num_classes; i++) { | 194 for (intptr_t i = 0; i < num_classes; i++) { |
| 194 Tag tag = reader->ReadTag(); | 195 Tag tag = reader->ReadTag(); |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1860 | 1861 |
| 1861 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 1862 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
| 1862 intptr_t buffer_length) { | 1863 intptr_t buffer_length) { |
| 1863 kernel::Reader reader(buffer, buffer_length); | 1864 kernel::Reader reader(buffer, buffer_length); |
| 1864 return kernel::Program::ReadFrom(&reader); | 1865 return kernel::Program::ReadFrom(&reader); |
| 1865 } | 1866 } |
| 1866 | 1867 |
| 1867 | 1868 |
| 1868 } // namespace dart | 1869 } // namespace dart |
| 1869 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1870 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| OLD | NEW |