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/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 Heap::kOld)); | 31 Heap::kOld)); |
32 const String& src = String::Handle(String::New(corelib_impl_source_, | 32 const String& src = String::Handle(String::New(corelib_impl_source_, |
33 Heap::kOld)); | 33 Heap::kOld)); |
34 | 34 |
35 const Script& result = | 35 const Script& result = |
36 Script::Handle(Script::New(url, src, RawScript::kSource)); | 36 Script::Handle(Script::New(url, src, RawScript::kSource)); |
37 return result.raw(); | 37 return result.raw(); |
38 } | 38 } |
39 | 39 |
40 | 40 |
| 41 RawScript* Bootstrap::LoadMathScript() { |
| 42 const String& url = String::Handle(String::New("dart:math", Heap::kOld)); |
| 43 const String& src = String::Handle(String::New(math_source_, Heap::kOld)); |
| 44 |
| 45 const Script& result = |
| 46 Script::Handle(Script::New(url, src, RawScript::kSource)); |
| 47 return result.raw(); |
| 48 } |
| 49 |
| 50 |
41 RawScript* Bootstrap::LoadIsolateScript() { | 51 RawScript* Bootstrap::LoadIsolateScript() { |
42 const String& url = String::Handle(String::New("dart:isolate", Heap::kOld)); | 52 const String& url = String::Handle(String::New("dart:isolate", Heap::kOld)); |
43 const String& src = String::Handle(String::New(isolate_source_, Heap::kOld)); | 53 const String& src = String::Handle(String::New(isolate_source_, Heap::kOld)); |
44 | 54 |
45 const Script& result = | 55 const Script& result = |
46 Script::Handle(Script::New(url, src, RawScript::kSource)); | 56 Script::Handle(Script::New(url, src, RawScript::kSource)); |
47 return result.raw(); | 57 return result.raw(); |
48 } | 58 } |
49 | 59 |
50 | 60 |
(...skipping 17 matching lines...) Expand all Loading... |
68 const Error& error = Error::Handle(Compiler::Compile(library, script)); | 78 const Error& error = Error::Handle(Compiler::Compile(library, script)); |
69 if (error.IsNull()) { | 79 if (error.IsNull()) { |
70 library.SetLoaded(); | 80 library.SetLoaded(); |
71 } else { | 81 } else { |
72 library.SetLoadError(); | 82 library.SetLoadError(); |
73 } | 83 } |
74 return error.raw(); | 84 return error.raw(); |
75 } | 85 } |
76 | 86 |
77 } // namespace dart | 87 } // namespace dart |
OLD | NEW |