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

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: Refactor and port to archs. 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
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 DECLARE_FLAG(int, optimization_counter_scale);
37 DECLARE_FLAG(int, min_optimization_counter_threshold);
38 DECLARE_FLAG(int, reoptimization_counter_threshold);
36 DECLARE_FLAG(bool, use_cha); 39 DECLARE_FLAG(bool, use_cha);
37 DECLARE_FLAG(bool, use_osr); 40 DECLARE_FLAG(bool, use_osr);
38 DECLARE_FLAG(int, stacktrace_every); 41 DECLARE_FLAG(int, stacktrace_every);
39 DECLARE_FLAG(charp, stacktrace_filter); 42 DECLARE_FLAG(charp, stacktrace_filter);
40 DECLARE_FLAG(int, deoptimize_every); 43 DECLARE_FLAG(int, deoptimize_every);
41 DECLARE_FLAG(charp, deoptimize_filter); 44 DECLARE_FLAG(charp, deoptimize_filter);
42 DECLARE_FLAG(bool, warn_on_javascript_compatibility); 45 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
43 DEFINE_FLAG(bool, enable_simd_inline, true, 46 DEFINE_FLAG(bool, enable_simd_inline, true,
44 "Enable inlining of SIMD related method calls."); 47 "Enable inlining of SIMD related method calls.");
45 DEFINE_FLAG(bool, source_lines, false, "Emit source line as assembly comment."); 48 DEFINE_FLAG(bool, source_lines, false, "Emit source line as assembly comment.");
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 ASSERT(res->NumArgsTested() == num_args_tested); 1424 ASSERT(res->NumArgsTested() == num_args_tested);
1422 return res; 1425 return res;
1423 } 1426 }
1424 const ICData& ic_data = ICData::ZoneHandle(isolate(), ICData::New( 1427 const ICData& ic_data = ICData::ZoneHandle(isolate(), ICData::New(
1425 parsed_function().function(), String::Handle(isolate(), target.name()), 1428 parsed_function().function(), String::Handle(isolate(), target.name()),
1426 arguments_descriptor, deopt_id, num_args_tested)); 1429 arguments_descriptor, deopt_id, num_args_tested));
1427 ic_data.AddTarget(target); 1430 ic_data.AddTarget(target);
1428 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1431 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1429 return &ic_data; 1432 return &ic_data;
1430 } 1433 }
1431 1434
Vyacheslav Egorov (Google) 2014/08/29 11:17:18 + empty line
Anders Johnsen 2014/08/29 11:56:28 Done.
1435 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const {
1436 intptr_t threshold;
1437 if (is_optimizing()) {
1438 threshold = FLAG_reoptimization_counter_threshold;
1439 } else {
1440 const intptr_t basic_blocks = flow_graph().preorder().length();
1441 ASSERT(basic_blocks > 0);
1442 threshold = FLAG_optimization_counter_scale * basic_blocks +
1443 FLAG_min_optimization_counter_threshold;
1444 if (threshold > FLAG_optimization_counter_threshold) {
1445 threshold = FLAG_optimization_counter_threshold;
1446 }
1447 }
1448 return threshold;
1449 }
1450
1432 } // namespace dart 1451 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698