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

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

Issue 1410733006: More general CHA-based inlining and devirtualization for precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments, fixed type propagation assertion failure Created 5 years, 2 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.cc ('k') | runtime/vm/flow_graph_optimizer.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/block_scheduler.h" 7 #include "vm/block_scheduler.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/flow_graph.h" 10 #include "vm/flow_graph.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 function.deoptimization_counter())); 619 function.deoptimization_counter()));
620 620
621 // Abort if the inlinable bit on the function is low. 621 // Abort if the inlinable bit on the function is low.
622 if (!function.CanBeInlined()) { 622 if (!function.CanBeInlined()) {
623 TRACE_INLINING(THR_Print(" Bailout: not inlinable\n")); 623 TRACE_INLINING(THR_Print(" Bailout: not inlinable\n"));
624 PRINT_INLINING_TREE("Not inlinable", 624 PRINT_INLINING_TREE("Not inlinable",
625 &call_data->caller, &function, call_data->call); 625 &call_data->caller, &function, call_data->call);
626 return false; 626 return false;
627 } 627 }
628 628
629 // Function has no type feedback. With precompilation we don't rely on
630 // type feedback.
631 if (!Compiler::always_optimize() &&
632 function.ic_data_array() == Object::null()) {
633 TRACE_INLINING(THR_Print(" Bailout: not compiled yet\n"));
634 PRINT_INLINING_TREE("Not compiled",
635 &call_data->caller, &function, call_data->call);
636 return false;
637 }
638
629 // Abort if this function has deoptimized too much. 639 // Abort if this function has deoptimized too much.
630 if (function.deoptimization_counter() >= 640 if (function.deoptimization_counter() >=
631 FLAG_deoptimization_counter_threshold) { 641 FLAG_deoptimization_counter_threshold) {
632 function.set_is_inlinable(false); 642 function.set_is_inlinable(false);
633 TRACE_INLINING(THR_Print(" Bailout: deoptimization threshold\n")); 643 TRACE_INLINING(THR_Print(" Bailout: deoptimization threshold\n"));
634 PRINT_INLINING_TREE("Deoptimization threshold exceeded", 644 PRINT_INLINING_TREE("Deoptimization threshold exceeded",
635 &call_data->caller, &function, call_data->call); 645 &call_data->caller, &function, call_data->call);
636 return false; 646 return false;
637 } 647 }
638 648
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 intptr_t FlowGraphInliner::NextInlineId(const Function& function, 1893 intptr_t FlowGraphInliner::NextInlineId(const Function& function,
1884 intptr_t parent_id) { 1894 intptr_t parent_id) {
1885 const intptr_t id = inline_id_to_function_->length(); 1895 const intptr_t id = inline_id_to_function_->length();
1886 inline_id_to_function_->Add(&function); 1896 inline_id_to_function_->Add(&function);
1887 caller_inline_id_->Add(parent_id); 1897 caller_inline_id_->Add(parent_id);
1888 return id; 1898 return id;
1889 } 1899 }
1890 1900
1891 1901
1892 } // namespace dart 1902 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698