OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/class_finalizer.h" |
9 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
10 #include "vm/dart_api_impl.h" | 11 #include "vm/dart_api_impl.h" |
11 #include "vm/object.h" | 12 #include "vm/object.h" |
12 #include "vm/object_store.h" | 13 #include "vm/object_store.h" |
13 | 14 |
14 namespace dart { | 15 namespace dart { |
15 | 16 |
16 DEFINE_FLAG(bool, print_bootstrap, false, "Print the bootstrap source."); | 17 DEFINE_FLAG(bool, print_bootstrap, false, "Print the bootstrap source."); |
17 | 18 |
18 | 19 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 63 } |
63 | 64 |
64 | 65 |
65 RawError* Bootstrap::Compile(const Library& library, const Script& script) { | 66 RawError* Bootstrap::Compile(const Library& library, const Script& script) { |
66 if (FLAG_print_bootstrap) { | 67 if (FLAG_print_bootstrap) { |
67 OS::Print("Bootstrap source '%s':\n%s\n", | 68 OS::Print("Bootstrap source '%s':\n%s\n", |
68 String::Handle(script.url()).ToCString(), | 69 String::Handle(script.url()).ToCString(), |
69 String::Handle(script.Source()).ToCString()); | 70 String::Handle(script.Source()).ToCString()); |
70 } | 71 } |
71 library.SetLoadInProgress(); | 72 library.SetLoadInProgress(); |
72 const Error& error = Error::Handle(Compiler::Compile(library, script)); | 73 // Do not tolerate malformed types in bootstrap scripts. |
| 74 const Error& error = Error::Handle( |
| 75 Compiler::Compile(library, script, ClassFinalizer::kGeneratingSnapshot)); |
73 if (error.IsNull()) { | 76 if (error.IsNull()) { |
74 library.SetLoaded(); | 77 library.SetLoaded(); |
75 } else { | 78 } else { |
76 library.SetLoadError(); | 79 library.SetLoadError(); |
77 } | 80 } |
78 return error.raw(); | 81 return error.raw(); |
79 } | 82 } |
80 | 83 |
81 } // namespace dart | 84 } // namespace dart |
OLD | NEW |