| 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 <map> | 6 #include <map> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 637 |
| 638 Library* Library::ReadFrom(Reader* reader) { | 638 Library* Library::ReadFrom(Reader* reader) { |
| 639 TRACE_READ_OFFSET(); | 639 TRACE_READ_OFFSET(); |
| 640 int flags = reader->ReadFlags(); | 640 int flags = reader->ReadFlags(); |
| 641 ASSERT(flags == 0); // external libraries not supported | 641 ASSERT(flags == 0); // external libraries not supported |
| 642 name_ = Reference::ReadStringFrom(reader); | 642 name_ = Reference::ReadStringFrom(reader); |
| 643 import_uri_ = Reference::ReadStringFrom(reader); | 643 import_uri_ = Reference::ReadStringFrom(reader); |
| 644 source_uri_index_ = reader->ReadUInt(); | 644 source_uri_index_ = reader->ReadUInt(); |
| 645 reader->set_current_script_id(source_uri_index_); | 645 reader->set_current_script_id(source_uri_index_); |
| 646 | 646 |
| 647 int num_imports = reader->ReadUInt(); |
| 648 if (num_imports != 0) { |
| 649 FATAL("Deferred imports not implemented in VM"); |
| 650 } |
| 647 int num_classes = reader->ReadUInt(); | 651 int num_classes = reader->ReadUInt(); |
| 648 classes().EnsureInitialized(num_classes); | 652 classes().EnsureInitialized(num_classes); |
| 649 for (int i = 0; i < num_classes; i++) { | 653 for (int i = 0; i < num_classes; i++) { |
| 650 Tag tag = reader->ReadTag(); | 654 Tag tag = reader->ReadTag(); |
| 651 if (tag == kNormalClass) { | 655 if (tag == kNormalClass) { |
| 652 NormalClass* klass = classes().GetOrCreate<NormalClass>(i, this); | 656 NormalClass* klass = classes().GetOrCreate<NormalClass>(i, this); |
| 653 klass->ReadFrom(reader); | 657 klass->ReadFrom(reader); |
| 654 } else { | 658 } else { |
| 655 ASSERT(tag == kMixinClass); | 659 ASSERT(tag == kMixinClass); |
| 656 MixinClass* klass = classes().GetOrCreate<MixinClass>(i, this); | 660 MixinClass* klass = classes().GetOrCreate<MixinClass>(i, this); |
| (...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 | 1891 |
| 1888 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, | 1892 kernel::Program* ReadPrecompiledKernelFromBuffer(const uint8_t* buffer, |
| 1889 intptr_t buffer_length) { | 1893 intptr_t buffer_length) { |
| 1890 kernel::Reader reader(buffer, buffer_length); | 1894 kernel::Reader reader(buffer, buffer_length); |
| 1891 return kernel::Program::ReadFrom(&reader); | 1895 return kernel::Program::ReadFrom(&reader); |
| 1892 } | 1896 } |
| 1893 | 1897 |
| 1894 | 1898 |
| 1895 } // namespace dart | 1899 } // namespace dart |
| 1896 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1900 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| OLD | NEW |