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/compiler.h" | 5 #include "vm/compiler.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 | 8 |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return new(zone) DartCompilationPipeline(); | 162 return new(zone) DartCompilationPipeline(); |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 | 166 |
167 // Compile a function. Should call only if the function has not been compiled. | 167 // Compile a function. Should call only if the function has not been compiled. |
168 // Arg0: function object. | 168 // Arg0: function object. |
169 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { | 169 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { |
170 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); | 170 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
171 ASSERT(!function.HasCode()); | 171 ASSERT(!function.HasCode()); |
172 const Error& error = Error::Handle(Compiler::CompileFunction(thread, | 172 const Error& error = |
173 function)); | 173 Error::Handle(Compiler::CompileFunction(thread, function)); |
174 if (!error.IsNull()) { | 174 if (!error.IsNull()) { |
175 Exceptions::PropagateError(error); | 175 Exceptions::PropagateError(error); |
176 } | 176 } |
177 } | 177 } |
178 | 178 |
179 | 179 |
180 RawError* Compiler::Compile(const Library& library, const Script& script) { | 180 RawError* Compiler::Compile(const Library& library, const Script& script) { |
181 LongJumpScope jump; | 181 LongJumpScope jump; |
182 if (setjmp(*jump.Set()) == 0) { | 182 if (setjmp(*jump.Set()) == 0) { |
183 Isolate* const isolate = Isolate::Current(); | 183 Isolate* const isolate = Isolate::Current(); |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 const Object& result = | 1273 const Object& result = |
1274 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1274 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
1275 isolate->object_store()->clear_sticky_error(); | 1275 isolate->object_store()->clear_sticky_error(); |
1276 return result.raw(); | 1276 return result.raw(); |
1277 } | 1277 } |
1278 UNREACHABLE(); | 1278 UNREACHABLE(); |
1279 return Object::null(); | 1279 return Object::null(); |
1280 } | 1280 } |
1281 | 1281 |
1282 } // namespace dart | 1282 } // namespace dart |
OLD | NEW |