| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
| 6 | 6 |
| 7 #include "vm/code_patcher.h" | 7 #include "vm/code_patcher.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/log.h" | 10 #include "vm/log.h" |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 } | 873 } |
| 874 } | 874 } |
| 875 | 875 |
| 876 | 876 |
| 877 void Precompiler::FinalizeAllClasses() { | 877 void Precompiler::FinalizeAllClasses() { |
| 878 Library& lib = Library::Handle(Z); | 878 Library& lib = Library::Handle(Z); |
| 879 Class& cls = Class::Handle(Z); | 879 Class& cls = Class::Handle(Z); |
| 880 | 880 |
| 881 for (intptr_t i = 0; i < libraries_.Length(); i++) { | 881 for (intptr_t i = 0; i < libraries_.Length(); i++) { |
| 882 lib ^= libraries_.At(i); | 882 lib ^= libraries_.At(i); |
| 883 if (!lib.Loaded()) { |
| 884 String& uri = String::Handle(Z, lib.url()); |
| 885 String& msg = String::Handle(Z, String::NewFormatted( |
| 886 "Library '%s' is not loaded. " |
| 887 "Did you forget to call Dart_FinalizeLoading?", uri.ToCString())); |
| 888 Jump(Error::Handle(Z, ApiError::New(msg))); |
| 889 } |
| 890 |
| 883 ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate); | 891 ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate); |
| 884 while (it.HasNext()) { | 892 while (it.HasNext()) { |
| 885 cls = it.GetNextClass(); | 893 cls = it.GetNextClass(); |
| 886 if (cls.IsDynamicClass()) { | 894 if (cls.IsDynamicClass()) { |
| 887 continue; // class 'dynamic' is in the read-only VM isolate. | 895 continue; // class 'dynamic' is in the read-only VM isolate. |
| 888 } | 896 } |
| 889 cls.EnsureIsFinalized(T); | 897 cls.EnsureIsFinalized(T); |
| 890 } | 898 } |
| 891 } | 899 } |
| 892 I->set_all_classes_finalized(true); | 900 I->set_all_classes_finalized(true); |
| 893 } | 901 } |
| 894 | 902 |
| 895 | 903 |
| 896 } // namespace dart | 904 } // namespace dart |
| OLD | NEW |