OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/bootstrap_natives.h" | 9 #include "vm/bootstrap_natives.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
11 #include "vm/dart_api_impl.h" | 11 #include "vm/dart_api_impl.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 RawScript* Bootstrap::LoadMirrorsScript(bool patch) { | 59 RawScript* Bootstrap::LoadMirrorsScript(bool patch) { |
60 const char* url = patch ? "dart:mirrors-patch" : "dart:mirrors"; | 60 const char* url = patch ? "dart:mirrors-patch" : "dart:mirrors"; |
61 const char* source = patch ? mirrors_patch_ : mirrors_source_; | 61 const char* source = patch ? mirrors_patch_ : mirrors_source_; |
62 return LoadScript(url, source, patch); | 62 return LoadScript(url, source, patch); |
63 } | 63 } |
64 | 64 |
65 | 65 |
| 66 RawScript* Bootstrap::LoadScalarlistScript(bool patch) { |
| 67 const char* url = patch ? "dart:scalarlist_patch" : "dart:scalarlist"; |
| 68 const char* source = patch ? scalarlist_patch_ : scalarlist_source_; |
| 69 return LoadScript(url, source, patch); |
| 70 } |
| 71 |
| 72 |
66 RawError* Bootstrap::Compile(const Library& library, const Script& script) { | 73 RawError* Bootstrap::Compile(const Library& library, const Script& script) { |
67 if (FLAG_print_bootstrap) { | 74 if (FLAG_print_bootstrap) { |
68 OS::Print("Bootstrap source '%s':\n%s\n", | 75 OS::Print("Bootstrap source '%s':\n%s\n", |
69 String::Handle(script.url()).ToCString(), | 76 String::Handle(script.url()).ToCString(), |
70 String::Handle(script.Source()).ToCString()); | 77 String::Handle(script.Source()).ToCString()); |
71 } | 78 } |
72 library.SetLoadInProgress(); | 79 library.SetLoadInProgress(); |
73 const Error& error = Error::Handle(Compiler::Compile(library, script)); | 80 const Error& error = Error::Handle(Compiler::Compile(library, script)); |
74 if (error.IsNull()) { | 81 if (error.IsNull()) { |
75 library.SetLoaded(); | 82 library.SetLoaded(); |
76 } else { | 83 } else { |
77 library.SetLoadError(); | 84 library.SetLoadError(); |
78 } | 85 } |
79 return error.raw(); | 86 return error.raw(); |
80 } | 87 } |
81 | 88 |
82 } // namespace dart | 89 } // namespace dart |
OLD | NEW |