| 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 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 "Do conditional constant propagation/unreachable code elimination."); | 39 "Do conditional constant propagation/unreachable code elimination."); |
| 40 DEFINE_FLAG(bool, common_subexpression_elimination, true, | 40 DEFINE_FLAG(bool, common_subexpression_elimination, true, |
| 41 "Do common subexpression elimination."); | 41 "Do common subexpression elimination."); |
| 42 DEFINE_FLAG(bool, loop_invariant_code_motion, true, | 42 DEFINE_FLAG(bool, loop_invariant_code_motion, true, |
| 43 "Do loop invariant code motion."); | 43 "Do loop invariant code motion."); |
| 44 DEFINE_FLAG(bool, propagate_types, true, "Do static type propagation."); | 44 DEFINE_FLAG(bool, propagate_types, true, "Do static type propagation."); |
| 45 DEFINE_FLAG(int, deoptimization_counter_threshold, 5, | 45 DEFINE_FLAG(int, deoptimization_counter_threshold, 5, |
| 46 "How many times we allow deoptimization before we disallow" | 46 "How many times we allow deoptimization before we disallow" |
| 47 " certain optimizations"); | 47 " certain optimizations"); |
| 48 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); | 48 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); |
| 49 DEFINE_FLAG(bool, range_analysis, false, "Enable range analysis"); | 49 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis"); |
| 50 DECLARE_FLAG(bool, print_flow_graph); | 50 DECLARE_FLAG(bool, print_flow_graph); |
| 51 | 51 |
| 52 | 52 |
| 53 // Compile a function. Should call only if the function has not been compiled. | 53 // Compile a function. Should call only if the function has not been compiled. |
| 54 // Arg0: function object. | 54 // Arg0: function object. |
| 55 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { | 55 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { |
| 56 ASSERT(arguments.Count() == kCompileFunctionRuntimeEntry.argument_count()); | 56 ASSERT(arguments.Count() == kCompileFunctionRuntimeEntry.argument_count()); |
| 57 const Function& function = Function::CheckedHandle(arguments.At(0)); | 57 const Function& function = Function::CheckedHandle(arguments.At(0)); |
| 58 ASSERT(!function.HasCode()); | 58 ASSERT(!function.HasCode()); |
| 59 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 59 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 result = isolate->object_store()->sticky_error(); | 582 result = isolate->object_store()->sticky_error(); |
| 583 isolate->object_store()->clear_sticky_error(); | 583 isolate->object_store()->clear_sticky_error(); |
| 584 isolate->set_long_jump_base(base); | 584 isolate->set_long_jump_base(base); |
| 585 return result.raw(); | 585 return result.raw(); |
| 586 } | 586 } |
| 587 UNREACHABLE(); | 587 UNREACHABLE(); |
| 588 return Object::null(); | 588 return Object::null(); |
| 589 } | 589 } |
| 590 | 590 |
| 591 } // namespace dart | 591 } // namespace dart |
| OLD | NEW |