| 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/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| 11 #include "vm/flow_graph_optimizer.h" | 11 #include "vm/flow_graph_optimizer.h" |
| 12 #include "vm/il_printer.h" | 12 #include "vm/il_printer.h" |
| 13 #include "vm/intrinsifier.h" | 13 #include "vm/intrinsifier.h" |
| 14 #include "vm/longjump.h" | 14 #include "vm/longjump.h" |
| 15 #include "vm/object.h" | 15 #include "vm/object.h" |
| 16 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
| 17 | 17 |
| 18 namespace dart { | 18 namespace dart { |
| 19 | 19 |
| 20 DEFINE_FLAG(bool, trace_inlining, false, "Trace inlining"); | 20 DEFINE_FLAG(bool, trace_inlining, false, "Trace inlining"); |
| 21 DEFINE_FLAG(charp, inlining_filter, NULL, "Inline only in named function"); | 21 DEFINE_FLAG(charp, inlining_filter, NULL, "Inline only in named function"); |
| 22 DEFINE_FLAG(int, inlining_size_threshold, 50, | 22 DEFINE_FLAG(int, inlining_size_threshold, 50, |
| 23 "Inline only functions with up to threshold instructions (default 50)"); | 23 "Inline only functions with up to threshold instructions (default 50)"); |
| 24 DEFINE_FLAG(int, inlining_depth_threshold, 3, | 24 // TODO(srdjan): set to 3 once crash in apidoc.dart is resolved. |
| 25 "Inline recursively up to threshold depth (default 3)"); | 25 DEFINE_FLAG(int, inlining_depth_threshold, 1, |
| 26 "Inline recursively up to threshold depth (default 1)"); |
| 26 DEFINE_FLAG(bool, inline_control_flow, true, | 27 DEFINE_FLAG(bool, inline_control_flow, true, |
| 27 "Inline functions with control flow."); | 28 "Inline functions with control flow."); |
| 28 DECLARE_FLAG(bool, print_flow_graph); | 29 DECLARE_FLAG(bool, print_flow_graph); |
| 29 DECLARE_FLAG(int, deoptimization_counter_threshold); | 30 DECLARE_FLAG(int, deoptimization_counter_threshold); |
| 30 DECLARE_FLAG(bool, verify_compiler); | 31 DECLARE_FLAG(bool, verify_compiler); |
| 31 | 32 |
| 32 #define TRACE_INLINING(statement) \ | 33 #define TRACE_INLINING(statement) \ |
| 33 do { \ | 34 do { \ |
| 34 if (FLAG_trace_inlining) statement; \ | 35 if (FLAG_trace_inlining) statement; \ |
| 35 } while (false) | 36 } while (false) |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 OS::Print("After Inlining of %s\n", flow_graph_-> | 431 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 431 parsed_function().function().ToFullyQualifiedCString()); | 432 parsed_function().function().ToFullyQualifiedCString()); |
| 432 FlowGraphPrinter printer(*flow_graph_); | 433 FlowGraphPrinter printer(*flow_graph_); |
| 433 printer.PrintBlocks(); | 434 printer.PrintBlocks(); |
| 434 } | 435 } |
| 435 } | 436 } |
| 436 } | 437 } |
| 437 } | 438 } |
| 438 | 439 |
| 439 } // namespace dart | 440 } // namespace dart |
| OLD | NEW |