| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 DEFINE_FLAG(bool, common_subexpression_elimination, true, | 43 DEFINE_FLAG(bool, common_subexpression_elimination, true, |
| 44 "Do common subexpression elimination."); | 44 "Do common subexpression elimination."); |
| 45 DEFINE_FLAG(bool, loop_invariant_code_motion, true, | 45 DEFINE_FLAG(bool, loop_invariant_code_motion, true, |
| 46 "Do loop invariant code motion."); | 46 "Do loop invariant code motion."); |
| 47 DEFINE_FLAG(bool, allocation_sinking, true, | 47 DEFINE_FLAG(bool, allocation_sinking, true, |
| 48 "Attempt to sink temporary allocations to side exits"); | 48 "Attempt to sink temporary allocations to side exits"); |
| 49 DEFINE_FLAG(int, deoptimization_counter_threshold, 16, | 49 DEFINE_FLAG(int, deoptimization_counter_threshold, 16, |
| 50 "How many times we allow deoptimization before we disallow optimization."); | 50 "How many times we allow deoptimization before we disallow optimization."); |
| 51 DEFINE_FLAG(int, deoptimization_counter_licm_threshold, 8, | 51 DEFINE_FLAG(int, deoptimization_counter_licm_threshold, 8, |
| 52 "How many times we allow deoptimization before we disable LICM."); | 52 "How many times we allow deoptimization before we disable LICM."); |
| 53 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); | 53 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); |
| 54 DEFINE_FLAG(bool, print_flow_graph_optimized, false, |
| 55 "Print the IR flow graph when optimizing."); |
| 54 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis"); | 56 DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis"); |
| 55 DEFINE_FLAG(bool, reorder_basic_blocks, true, "Enable basic-block reordering."); | 57 DEFINE_FLAG(bool, reorder_basic_blocks, true, "Enable basic-block reordering."); |
| 58 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); |
| 56 DEFINE_FLAG(bool, verify_compiler, false, | 59 DEFINE_FLAG(bool, verify_compiler, false, |
| 57 "Enable compiler verification assertions"); | 60 "Enable compiler verification assertions"); |
| 58 DECLARE_FLAG(bool, print_flow_graph); | |
| 59 DECLARE_FLAG(bool, print_flow_graph_optimized); | |
| 60 DECLARE_FLAG(bool, trace_failed_optimization_attempts); | 61 DECLARE_FLAG(bool, trace_failed_optimization_attempts); |
| 61 | 62 |
| 62 // Compile a function. Should call only if the function has not been compiled. | 63 // Compile a function. Should call only if the function has not been compiled. |
| 63 // Arg0: function object. | 64 // Arg0: function object. |
| 64 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { | 65 DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { |
| 65 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); | 66 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
| 66 ASSERT(!function.HasCode()); | 67 ASSERT(!function.HasCode()); |
| 67 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 68 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 68 if (!error.IsNull()) { | 69 if (!error.IsNull()) { |
| 69 Exceptions::PropagateError(error); | 70 Exceptions::PropagateError(error); |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 const Object& result = | 939 const Object& result = |
| 939 Object::Handle(isolate->object_store()->sticky_error()); | 940 Object::Handle(isolate->object_store()->sticky_error()); |
| 940 isolate->object_store()->clear_sticky_error(); | 941 isolate->object_store()->clear_sticky_error(); |
| 941 return result.raw(); | 942 return result.raw(); |
| 942 } | 943 } |
| 943 UNREACHABLE(); | 944 UNREACHABLE(); |
| 944 return Object::null(); | 945 return Object::null(); |
| 945 } | 946 } |
| 946 | 947 |
| 947 } // namespace dart | 948 } // namespace dart |
| OLD | NEW |