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

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

Issue 2097413002: Improve inlining of recognized methods in AOT. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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_inliner.cc ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/precompiler.h" 5 #include "vm/precompiler.h"
6 6
7 #include "vm/aot_optimizer.h" 7 #include "vm/aot_optimizer.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/branch_optimizer.h" 10 #include "vm/branch_optimizer.h"
(...skipping 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 if (error.raw() == Object::branch_offset_error().raw()) { 2703 if (error.raw() == Object::branch_offset_error().raw()) {
2704 // Compilation failed due to an out of range branch offset in the 2704 // Compilation failed due to an out of range branch offset in the
2705 // assembler. We try again (done = false) with far branches enabled. 2705 // assembler. We try again (done = false) with far branches enabled.
2706 done = false; 2706 done = false;
2707 ASSERT(!use_far_branches); 2707 ASSERT(!use_far_branches);
2708 use_far_branches = true; 2708 use_far_branches = true;
2709 } else if (error.raw() == Object::speculative_inlining_error().raw()) { 2709 } else if (error.raw() == Object::speculative_inlining_error().raw()) {
2710 // The return value of setjmp is the deopt id of the check instruction 2710 // The return value of setjmp is the deopt id of the check instruction
2711 // that caused the bailout. 2711 // that caused the bailout.
2712 done = false; 2712 done = false;
2713 if (!use_speculative_inlining) {
2714 // Assert that we don't repeatedly retry speculation.
2715 UNREACHABLE();
2716 }
2713 #if defined(DEBUG) 2717 #if defined(DEBUG)
2714 ASSERT(use_speculative_inlining);
2715 for (intptr_t i = 0; i < inlining_black_list.length(); ++i) { 2718 for (intptr_t i = 0; i < inlining_black_list.length(); ++i) {
2716 ASSERT(inlining_black_list[i] != val); 2719 ASSERT(inlining_black_list[i] != val);
2717 } 2720 }
2718 #endif 2721 #endif
2719 inlining_black_list.Add(val); 2722 inlining_black_list.Add(val);
2720 const intptr_t max_attempts = FLAG_max_speculative_inlining_attempts; 2723 const intptr_t max_attempts = FLAG_max_speculative_inlining_attempts;
2721 if (inlining_black_list.length() >= max_attempts) { 2724 if (inlining_black_list.length() >= max_attempts) {
2722 use_speculative_inlining = false; 2725 use_speculative_inlining = false;
2723 if (FLAG_trace_compiler || FLAG_trace_optimizing_compiler) { 2726 if (FLAG_trace_compiler || FLAG_trace_optimizing_compiler) {
2724 THR_Print("Disabled speculative inlining after %" Pd " attempts.\n", 2727 THR_Print("Disabled speculative inlining after %" Pd " attempts.\n",
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2848 CompilationPipeline::New(thread->zone(), function); 2851 CompilationPipeline::New(thread->zone(), function);
2849 2852
2850 ASSERT(FLAG_precompiled_mode); 2853 ASSERT(FLAG_precompiled_mode);
2851 const bool optimized = function.IsOptimizable(); // False for natives. 2854 const bool optimized = function.IsOptimizable(); // False for natives.
2852 return PrecompileFunctionHelper(pipeline, function, optimized); 2855 return PrecompileFunctionHelper(pipeline, function, optimized);
2853 } 2856 }
2854 2857
2855 #endif // DART_PRECOMPILER 2858 #endif // DART_PRECOMPILER
2856 2859
2857 } // namespace dart 2860 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698