| 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/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); | 50 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); |
| 51 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis"); | 51 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis"); |
| 52 DEFINE_FLAG(bool, verify_compiler, false, | 52 DEFINE_FLAG(bool, verify_compiler, false, |
| 53 "Enable compiler verification assertions"); | 53 "Enable compiler verification assertions"); |
| 54 DECLARE_FLAG(bool, print_flow_graph); | 54 DECLARE_FLAG(bool, print_flow_graph); |
| 55 | 55 |
| 56 | 56 |
| 57 // Compile a function. Should call only if the function has not been compiled. | 57 // Compile a function. Should call only if the function has not been compiled. |
| 58 // Arg0: function object. | 58 // Arg0: function object. |
| 59 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { | 59 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { |
| 60 ASSERT(arguments.Count() == kCompileFunctionRuntimeEntry.argument_count()); | 60 ASSERT(arguments.ArgCount() == kCompileFunctionRuntimeEntry.argument_count()); |
| 61 const Function& function = Function::CheckedHandle(arguments.At(0)); | 61 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
| 62 ASSERT(!function.HasCode()); | 62 ASSERT(!function.HasCode()); |
| 63 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 63 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 64 if (!error.IsNull()) { | 64 if (!error.IsNull()) { |
| 65 Exceptions::PropagateError(error); | 65 Exceptions::PropagateError(error); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 RawError* Compiler::Compile(const Library& library, const Script& script) { | 70 RawError* Compiler::Compile(const Library& library, const Script& script) { |
| 71 Isolate* isolate = Isolate::Current(); | 71 Isolate* isolate = Isolate::Current(); |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 result = isolate->object_store()->sticky_error(); | 607 result = isolate->object_store()->sticky_error(); |
| 608 isolate->object_store()->clear_sticky_error(); | 608 isolate->object_store()->clear_sticky_error(); |
| 609 isolate->set_long_jump_base(base); | 609 isolate->set_long_jump_base(base); |
| 610 return result.raw(); | 610 return result.raw(); |
| 611 } | 611 } |
| 612 UNREACHABLE(); | 612 UNREACHABLE(); |
| 613 return Object::null(); | 613 return Object::null(); |
| 614 } | 614 } |
| 615 | 615 |
| 616 } // namespace dart | 616 } // namespace dart |
| OLD | NEW |