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

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

Issue 501553005: Scale invocation count by the number of BBs in the flow-graph of a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 15 matching lines...) Expand all
26 namespace dart { 26 namespace dart {
27 27
28 DECLARE_FLAG(bool, code_comments); 28 DECLARE_FLAG(bool, code_comments);
29 DECLARE_FLAG(bool, disassemble); 29 DECLARE_FLAG(bool, disassemble);
30 DECLARE_FLAG(bool, disassemble_optimized); 30 DECLARE_FLAG(bool, disassemble_optimized);
31 DECLARE_FLAG(bool, emit_edge_counters); 31 DECLARE_FLAG(bool, emit_edge_counters);
32 DECLARE_FLAG(bool, enable_type_checks); 32 DECLARE_FLAG(bool, enable_type_checks);
33 DECLARE_FLAG(bool, intrinsify); 33 DECLARE_FLAG(bool, intrinsify);
34 DECLARE_FLAG(bool, propagate_ic_data); 34 DECLARE_FLAG(bool, propagate_ic_data);
35 DECLARE_FLAG(int, optimization_counter_threshold); 35 DECLARE_FLAG(int, optimization_counter_threshold);
36 DEFINE_FLAG(int, optimization_counter_scale, 2000,
37 "The scale of invocation count, by size of the function.");
38 DEFINE_FLAG(int, min_optimization_counter_threshold, 5000,
39 "The minimum invocation count for a function.");
40 DECLARE_FLAG(int, reoptimization_counter_threshold);
36 DECLARE_FLAG(bool, use_cha); 41 DECLARE_FLAG(bool, use_cha);
37 DECLARE_FLAG(bool, use_osr); 42 DECLARE_FLAG(bool, use_osr);
38 DECLARE_FLAG(int, stacktrace_every); 43 DECLARE_FLAG(int, stacktrace_every);
39 DECLARE_FLAG(charp, stacktrace_filter); 44 DECLARE_FLAG(charp, stacktrace_filter);
40 DECLARE_FLAG(int, deoptimize_every); 45 DECLARE_FLAG(int, deoptimize_every);
41 DECLARE_FLAG(charp, deoptimize_filter); 46 DECLARE_FLAG(charp, deoptimize_filter);
42 DECLARE_FLAG(bool, warn_on_javascript_compatibility); 47 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
43 DEFINE_FLAG(bool, enable_simd_inline, true, 48 DEFINE_FLAG(bool, enable_simd_inline, true,
44 "Enable inlining of SIMD related method calls."); 49 "Enable inlining of SIMD related method calls.");
45 DEFINE_FLAG(bool, source_lines, false, "Emit source line as assembly comment."); 50 DEFINE_FLAG(bool, source_lines, false, "Emit source line as assembly comment.");
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 return res; 1427 return res;
1423 } 1428 }
1424 const ICData& ic_data = ICData::ZoneHandle(isolate(), ICData::New( 1429 const ICData& ic_data = ICData::ZoneHandle(isolate(), ICData::New(
1425 parsed_function().function(), String::Handle(isolate(), target.name()), 1430 parsed_function().function(), String::Handle(isolate(), target.name()),
1426 arguments_descriptor, deopt_id, num_args_tested)); 1431 arguments_descriptor, deopt_id, num_args_tested));
1427 ic_data.AddTarget(target); 1432 ic_data.AddTarget(target);
1428 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1433 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1429 return &ic_data; 1434 return &ic_data;
1430 } 1435 }
1431 1436
1437
1438 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const {
1439 intptr_t threshold;
1440 if (is_optimizing()) {
1441 threshold = FLAG_reoptimization_counter_threshold;
1442 } else {
1443 const intptr_t basic_blocks = flow_graph().preorder().length();
1444 ASSERT(basic_blocks > 0);
1445 threshold = FLAG_optimization_counter_scale * basic_blocks +
1446 FLAG_min_optimization_counter_threshold;
1447 if (threshold > FLAG_optimization_counter_threshold) {
1448 threshold = FLAG_optimization_counter_threshold;
1449 }
1450 }
1451 return threshold;
1452 }
1453
1432 } // namespace dart 1454 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698