Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: runtime/vm/flow_graph_inliner.cc

Issue 1739593002: Revert "Move precompilation-related flags to flags list." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_range_analysis.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/aot_optimizer.h" 7 #include "vm/aot_optimizer.h"
8 #include "vm/block_scheduler.h" 8 #include "vm/block_scheduler.h"
9 #include "vm/branch_optimizer.h" 9 #include "vm/branch_optimizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 DEFINE_FLAG(int, inlining_recursion_depth_threshold, 1, 55 DEFINE_FLAG(int, inlining_recursion_depth_threshold, 1,
56 "Inline recursive function calls up to threshold recursion depth."); 56 "Inline recursive function calls up to threshold recursion depth.");
57 DEFINE_FLAG(int, max_inlined_per_depth, 500, 57 DEFINE_FLAG(int, max_inlined_per_depth, 500,
58 "Max. number of inlined calls per depth"); 58 "Max. number of inlined calls per depth");
59 DEFINE_FLAG(bool, print_inlining_tree, false, "Print inlining tree"); 59 DEFINE_FLAG(bool, print_inlining_tree, false, "Print inlining tree");
60 DEFINE_FLAG(bool, enable_inlining_annotations, false, 60 DEFINE_FLAG(bool, enable_inlining_annotations, false,
61 "Enable inlining annotations"); 61 "Enable inlining annotations");
62 62
63 DECLARE_FLAG(bool, compiler_stats); 63 DECLARE_FLAG(bool, compiler_stats);
64 DECLARE_FLAG(int, max_deoptimization_counter_threshold); 64 DECLARE_FLAG(int, max_deoptimization_counter_threshold);
65 DECLARE_FLAG(bool, precompilation);
65 DECLARE_FLAG(bool, print_flow_graph); 66 DECLARE_FLAG(bool, print_flow_graph);
66 DECLARE_FLAG(bool, print_flow_graph_optimized); 67 DECLARE_FLAG(bool, print_flow_graph_optimized);
67 DECLARE_FLAG(bool, verify_compiler); 68 DECLARE_FLAG(bool, verify_compiler);
68 69
69 // Quick access to the current zone. 70 // Quick access to the current zone.
70 #define Z (zone()) 71 #define Z (zone())
71 #define I (isolate()) 72 #define I (isolate())
72 73
73 #define TRACE_INLINING(statement) \ 74 #define TRACE_INLINING(statement) \
74 do { \ 75 do { \
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 // Abort if the inlinable bit on the function is low. 625 // Abort if the inlinable bit on the function is low.
625 if (!function.CanBeInlined()) { 626 if (!function.CanBeInlined()) {
626 TRACE_INLINING(THR_Print(" Bailout: not inlinable\n")); 627 TRACE_INLINING(THR_Print(" Bailout: not inlinable\n"));
627 PRINT_INLINING_TREE("Not inlinable", 628 PRINT_INLINING_TREE("Not inlinable",
628 &call_data->caller, &function, call_data->call); 629 &call_data->caller, &function, call_data->call);
629 return false; 630 return false;
630 } 631 }
631 632
632 // Function has no type feedback. With precompilation we don't rely on 633 // Function has no type feedback. With precompilation we don't rely on
633 // type feedback. 634 // type feedback.
634 if (!FLAG_precompiled_mode && 635 if (!FLAG_precompilation &&
635 function.ic_data_array() == Object::null()) { 636 function.ic_data_array() == Object::null()) {
636 TRACE_INLINING(THR_Print(" Bailout: not compiled yet\n")); 637 TRACE_INLINING(THR_Print(" Bailout: not compiled yet\n"));
637 PRINT_INLINING_TREE("Not compiled", 638 PRINT_INLINING_TREE("Not compiled",
638 &call_data->caller, &function, call_data->call); 639 &call_data->caller, &function, call_data->call);
639 return false; 640 return false;
640 } 641 }
641 642
642 // Abort if this function has deoptimized too much. 643 // Abort if this function has deoptimized too much.
643 if (function.deoptimization_counter() >= 644 if (function.deoptimization_counter() >=
644 FLAG_max_deoptimization_counter_threshold) { 645 FLAG_max_deoptimization_counter_threshold) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 // Compute SSA on the callee graph, catching bailouts. 783 // Compute SSA on the callee graph, catching bailouts.
783 callee_graph->ComputeSSA(caller_graph_->max_virtual_register_number(), 784 callee_graph->ComputeSSA(caller_graph_->max_virtual_register_number(),
784 param_stubs); 785 param_stubs);
785 DEBUG_ASSERT(callee_graph->VerifyUseLists()); 786 DEBUG_ASSERT(callee_graph->VerifyUseLists());
786 } 787 }
787 788
788 { 789 {
789 CSTAT_TIMER_SCOPE(thread(), graphinliner_opt_timer); 790 CSTAT_TIMER_SCOPE(thread(), graphinliner_opt_timer);
790 // TODO(fschneider): Improve suppression of speculative inlining. 791 // TODO(fschneider): Improve suppression of speculative inlining.
791 // Deopt-ids overlap between caller and callee. 792 // Deopt-ids overlap between caller and callee.
792 if (FLAG_precompiled_mode) { 793 if (FLAG_precompilation) {
793 AotOptimizer optimizer(callee_graph, 794 AotOptimizer optimizer(callee_graph,
794 inliner_->use_speculative_inlining_, 795 inliner_->use_speculative_inlining_,
795 inliner_->inlining_black_list_); 796 inliner_->inlining_black_list_);
796 optimizer.PopulateWithICData(); 797 optimizer.PopulateWithICData();
797 798
798 optimizer.ApplyClassIds(); 799 optimizer.ApplyClassIds();
799 DEBUG_ASSERT(callee_graph->VerifyUseLists()); 800 DEBUG_ASSERT(callee_graph->VerifyUseLists());
800 801
801 FlowGraphTypePropagator::Propagate(callee_graph); 802 FlowGraphTypePropagator::Propagate(callee_graph);
802 DEBUG_ASSERT(callee_graph->VerifyUseLists()); 803 DEBUG_ASSERT(callee_graph->VerifyUseLists());
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 return false; 923 return false;
923 } else { 924 } else {
924 // Fall through to exit long jump scope. 925 // Fall through to exit long jump scope.
925 } 926 }
926 } 927 }
927 } 928 }
928 929
929 // Propagate a compile-time error. Only in precompilation do we attempt to 930 // Propagate a compile-time error. Only in precompilation do we attempt to
930 // inline functions that have never been compiled before; when JITing we 931 // inline functions that have never been compiled before; when JITing we
931 // should only see compile-time errors in unoptimized compilation. 932 // should only see compile-time errors in unoptimized compilation.
932 ASSERT(FLAG_precompiled_mode); 933 ASSERT(FLAG_precompilation);
933 Thread::Current()->long_jump_base()->Jump(1, error); 934 Thread::Current()->long_jump_base()->Jump(1, error);
934 UNREACHABLE(); 935 UNREACHABLE();
935 return false; 936 return false;
936 } 937 }
937 938
938 void PrintInlinedInfo(const Function& top) { 939 void PrintInlinedInfo(const Function& top) {
939 if (inlined_info_.length() > 0) { 940 if (inlined_info_.length() > 0) {
940 THR_Print("Inlining into: '%s' growth: %f (%" Pd " -> %" Pd ")\n", 941 THR_Print("Inlining into: '%s' growth: %f (%" Pd " -> %" Pd ")\n",
941 top.ToFullyQualifiedCString(), 942 top.ToFullyQualifiedCString(),
942 GrowthFactor(), 943 GrowthFactor(),
(...skipping 2111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3054 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last); 3055 return InlineDoubleOp(flow_graph, Token::kMUL, call, entry, last);
3055 case MethodRecognizer::kDoubleDiv: 3056 case MethodRecognizer::kDoubleDiv:
3056 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last); 3057 return InlineDoubleOp(flow_graph, Token::kDIV, call, entry, last);
3057 default: 3058 default:
3058 return false; 3059 return false;
3059 } 3060 }
3060 } 3061 }
3061 3062
3062 3063
3063 } // namespace dart 3064 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_range_analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698