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

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

Issue 1559653002: Investigate & fix issues around usage_count and deoptimization_count (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: d Created 4 years, 11 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/code_generator.cc ('k') | runtime/vm/object.h » ('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) 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 DEFINE_FLAG(bool, trace_optimizing_compiler, false, 63 DEFINE_FLAG(bool, trace_optimizing_compiler, false,
64 "Trace only optimizing compiler operations."); 64 "Trace only optimizing compiler operations.");
65 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler."); 65 DEFINE_FLAG(bool, trace_bailout, false, "Print bailout from ssa compiler.");
66 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); 66 DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining");
67 DEFINE_FLAG(bool, verify_compiler, false, 67 DEFINE_FLAG(bool, verify_compiler, false,
68 "Enable compiler verification assertions"); 68 "Enable compiler verification assertions");
69 DEFINE_FLAG(int, max_speculative_inlining_attempts, 1, 69 DEFINE_FLAG(int, max_speculative_inlining_attempts, 1,
70 "Max number of attempts with speculative inlining (precompilation only)"); 70 "Max number of attempts with speculative inlining (precompilation only)");
71 71
72 DECLARE_FLAG(bool, background_compilation); 72 DECLARE_FLAG(bool, background_compilation);
73 DECLARE_FLAG(bool, huge_method_cutoff_in_code_size);
73 DECLARE_FLAG(bool, load_deferred_eagerly); 74 DECLARE_FLAG(bool, load_deferred_eagerly);
74 DECLARE_FLAG(bool, trace_failed_optimization_attempts); 75 DECLARE_FLAG(bool, trace_failed_optimization_attempts);
75 DECLARE_FLAG(bool, trace_inlining_intervals); 76 DECLARE_FLAG(bool, trace_inlining_intervals);
76 DECLARE_FLAG(bool, trace_irregexp); 77 DECLARE_FLAG(bool, trace_irregexp);
77 78
78 79
79 bool Compiler::always_optimize_ = false; 80 bool Compiler::always_optimize_ = false;
80 bool Compiler::allow_recompilation_ = true; 81 bool Compiler::allow_recompilation_ = true;
81 82
82 #ifndef DART_PRECOMPILED 83 #ifndef DART_PRECOMPILED
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 const Array& deopt_info_array = 460 const Array& deopt_info_array =
460 Array::Handle(zone, graph_compiler->CreateDeoptInfo(assembler)); 461 Array::Handle(zone, graph_compiler->CreateDeoptInfo(assembler));
461 INC_STAT(thread(), total_code_size, 462 INC_STAT(thread(), total_code_size,
462 deopt_info_array.Length() * sizeof(uword)); 463 deopt_info_array.Length() * sizeof(uword));
463 // Allocates instruction object. Since this occurs only at safepoint, 464 // Allocates instruction object. Since this occurs only at safepoint,
464 // there can be no concurrent access to the instruction page. 465 // there can be no concurrent access to the instruction page.
465 const Code& code = Code::Handle( 466 const Code& code = Code::Handle(
466 Code::FinalizeCode(function, assembler, optimized())); 467 Code::FinalizeCode(function, assembler, optimized()));
467 code.set_is_optimized(optimized()); 468 code.set_is_optimized(optimized());
468 code.set_owner(function); 469 code.set_owner(function);
470 if (!function.IsOptimizable()) {
471 // A function with huge unoptimized code can become non-optimizable
472 // after generating unoptimized code.
473 function.set_usage_counter(INT_MIN);
474 }
469 475
470 const Array& intervals = graph_compiler->inlined_code_intervals(); 476 const Array& intervals = graph_compiler->inlined_code_intervals();
471 INC_STAT(thread(), total_code_size, 477 INC_STAT(thread(), total_code_size,
472 intervals.Length() * sizeof(uword)); 478 intervals.Length() * sizeof(uword));
473 code.SetInlinedIntervals(intervals); 479 code.SetInlinedIntervals(intervals);
474 480
475 const Array& inlined_id_array = 481 const Array& inlined_id_array =
476 Array::Handle(zone, graph_compiler->InliningIdToFunction()); 482 Array::Handle(zone, graph_compiler->InliningIdToFunction());
477 INC_STAT(thread(), total_code_size, 483 INC_STAT(thread(), total_code_size,
478 inlined_id_array.Length() * sizeof(uword)); 484 inlined_id_array.Length() * sizeof(uword));
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 } 2037 }
2032 2038
2033 2039
2034 void BackgroundCompiler::EnsureInit(Thread* thread) { 2040 void BackgroundCompiler::EnsureInit(Thread* thread) {
2035 UNREACHABLE(); 2041 UNREACHABLE();
2036 } 2042 }
2037 2043
2038 #endif // DART_PRECOMPILED 2044 #endif // DART_PRECOMPILED
2039 2045
2040 } // namespace dart 2046 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698