| OLD | NEW |
| 1 // Copyright (c) 2012, 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 | 36 |
| 37 RawScript* Bootstrap::LoadCoreImplScript(bool patch) { | 37 RawScript* Bootstrap::LoadCoreImplScript(bool patch) { |
| 38 // TODO(iposva): Use proper library name. | 38 // TODO(iposva): Use proper library name. |
| 39 const char* url = patch ? "dart:coreimpl-patch" : "bootstrap_impl"; | 39 const char* url = patch ? "dart:coreimpl-patch" : "bootstrap_impl"; |
| 40 const char* source = patch ? corelib_impl_patch_ : corelib_impl_source_; | 40 const char* source = patch ? corelib_impl_patch_ : corelib_impl_source_; |
| 41 return LoadScript(url, source, patch); | 41 return LoadScript(url, source, patch); |
| 42 } | 42 } |
| 43 | 43 |
| 44 | 44 |
| 45 RawScript* Bootstrap::LoadCollectionScript(bool patch) { |
| 46 const char* url = patch ? "dart:collection-patch" : "dart:collection"; |
| 47 const char* source = patch ? collection_source_ : collection_source_; |
| 48 return LoadScript(url, source, patch); |
| 49 } |
| 50 |
| 51 |
| 45 RawScript* Bootstrap::LoadMathScript(bool patch) { | 52 RawScript* Bootstrap::LoadMathScript(bool patch) { |
| 46 const char* url = patch ? "dart:math-patch" : "dart:math"; | 53 const char* url = patch ? "dart:math-patch" : "dart:math"; |
| 47 const char* source = patch ? math_patch_ : math_source_; | 54 const char* source = patch ? math_patch_ : math_source_; |
| 48 return LoadScript(url, source, patch); | 55 return LoadScript(url, source, patch); |
| 49 } | 56 } |
| 50 | 57 |
| 51 | 58 |
| 52 RawScript* Bootstrap::LoadIsolateScript(bool patch) { | 59 RawScript* Bootstrap::LoadIsolateScript(bool patch) { |
| 53 const char* url = patch ? "dart:isolate-patch" : "dart:isolate"; | 60 const char* url = patch ? "dart:isolate-patch" : "dart:isolate"; |
| 54 const char* source = patch ? isolate_patch_ : isolate_source_; | 61 const char* source = patch ? isolate_patch_ : isolate_source_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 80 const Error& error = Error::Handle(Compiler::Compile(library, script)); | 87 const Error& error = Error::Handle(Compiler::Compile(library, script)); |
| 81 if (error.IsNull()) { | 88 if (error.IsNull()) { |
| 82 library.SetLoaded(); | 89 library.SetLoaded(); |
| 83 } else { | 90 } else { |
| 84 library.SetLoadError(); | 91 library.SetLoadError(); |
| 85 } | 92 } |
| 86 return error.raw(); | 93 return error.raw(); |
| 87 } | 94 } |
| 88 | 95 |
| 89 } // namespace dart | 96 } // namespace dart |
| OLD | NEW |