| 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/bootstrap_natives.h" | 9 #include "vm/bootstrap_natives.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return result.raw(); | 74 return result.raw(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 | 77 |
| 78 void Bootstrap::Compile(const Library& library, const Script& script) { | 78 void Bootstrap::Compile(const Library& library, const Script& script) { |
| 79 if (FLAG_print_bootstrap) { | 79 if (FLAG_print_bootstrap) { |
| 80 OS::Print("Bootstrap source '%s':\n%s\n", | 80 OS::Print("Bootstrap source '%s':\n%s\n", |
| 81 String::Handle(script.url()).ToCString(), | 81 String::Handle(script.url()).ToCString(), |
| 82 String::Handle(script.source()).ToCString()); | 82 String::Handle(script.source()).ToCString()); |
| 83 } | 83 } |
| 84 library.SetLoadInProgress(); |
| 84 Compiler::Compile(library, script); | 85 Compiler::Compile(library, script); |
| 86 library.SetLoaded(); |
| 85 } | 87 } |
| 86 | 88 |
| 87 | 89 |
| 88 void Bootstrap::SetupNativeResolver() { | 90 void Bootstrap::SetupNativeResolver() { |
| 89 Library& library = Library::Handle(Library::CoreLibrary()); | 91 Library& library = Library::Handle(Library::CoreLibrary()); |
| 90 ASSERT(!library.IsNull()); | 92 ASSERT(!library.IsNull()); |
| 91 library.set_native_entry_resolver( | 93 library.set_native_entry_resolver( |
| 92 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); | 94 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); |
| 93 library = Library::CoreImplLibrary(); | 95 library = Library::CoreImplLibrary(); |
| 94 ASSERT(!library.IsNull()); | 96 ASSERT(!library.IsNull()); |
| 95 library.set_native_entry_resolver( | 97 library.set_native_entry_resolver( |
| 96 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); | 98 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); |
| 97 } | 99 } |
| 98 | 100 |
| 99 } // namespace dart | 101 } // namespace dart |
| OLD | NEW |