| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 namespace dart { | 27 namespace dart { |
| 28 | 28 |
| 29 DECLARE_FLAG(bool, code_comments); | 29 DECLARE_FLAG(bool, code_comments); |
| 30 DECLARE_FLAG(bool, disassemble); | 30 DECLARE_FLAG(bool, disassemble); |
| 31 DECLARE_FLAG(bool, disassemble_optimized); | 31 DECLARE_FLAG(bool, disassemble_optimized); |
| 32 DECLARE_FLAG(bool, emit_edge_counters); | 32 DECLARE_FLAG(bool, emit_edge_counters); |
| 33 DECLARE_FLAG(bool, enable_type_checks); | 33 DECLARE_FLAG(bool, enable_type_checks); |
| 34 DECLARE_FLAG(bool, intrinsify); | 34 DECLARE_FLAG(bool, intrinsify); |
| 35 DECLARE_FLAG(bool, propagate_ic_data); | 35 DECLARE_FLAG(bool, propagate_ic_data); |
| 36 DECLARE_FLAG(int, optimization_counter_threshold); | 36 DECLARE_FLAG(int, optimization_counter_threshold); |
| 37 DECLARE_FLAG(int, regexp_optimization_counter_threshold); |
| 37 DEFINE_FLAG(int, optimization_counter_scale, 2000, | 38 DEFINE_FLAG(int, optimization_counter_scale, 2000, |
| 38 "The scale of invocation count, by size of the function."); | 39 "The scale of invocation count, by size of the function."); |
| 39 DEFINE_FLAG(int, min_optimization_counter_threshold, 5000, | 40 DEFINE_FLAG(int, min_optimization_counter_threshold, 5000, |
| 40 "The minimum invocation count for a function."); | 41 "The minimum invocation count for a function."); |
| 41 DECLARE_FLAG(int, reoptimization_counter_threshold); | 42 DECLARE_FLAG(int, reoptimization_counter_threshold); |
| 42 DECLARE_FLAG(bool, use_cha); | 43 DECLARE_FLAG(bool, use_cha); |
| 43 DECLARE_FLAG(bool, use_osr); | 44 DECLARE_FLAG(bool, use_osr); |
| 44 DECLARE_FLAG(int, stacktrace_every); | 45 DECLARE_FLAG(int, stacktrace_every); |
| 45 DECLARE_FLAG(charp, stacktrace_filter); | 46 DECLARE_FLAG(charp, stacktrace_filter); |
| 46 DECLARE_FLAG(int, deoptimize_every); | 47 DECLARE_FLAG(int, deoptimize_every); |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 ic_data.AddTarget(target); | 1529 ic_data.AddTarget(target); |
| 1529 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; | 1530 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; |
| 1530 return &ic_data; | 1531 return &ic_data; |
| 1531 } | 1532 } |
| 1532 | 1533 |
| 1533 | 1534 |
| 1534 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const { | 1535 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const { |
| 1535 intptr_t threshold; | 1536 intptr_t threshold; |
| 1536 if (is_optimizing()) { | 1537 if (is_optimizing()) { |
| 1537 threshold = FLAG_reoptimization_counter_threshold; | 1538 threshold = FLAG_reoptimization_counter_threshold; |
| 1539 } else if (parsed_function_.function().IsIrregexpFunction()) { |
| 1540 threshold = FLAG_regexp_optimization_counter_threshold; |
| 1538 } else { | 1541 } else { |
| 1539 const intptr_t basic_blocks = flow_graph().preorder().length(); | 1542 const intptr_t basic_blocks = flow_graph().preorder().length(); |
| 1540 ASSERT(basic_blocks > 0); | 1543 ASSERT(basic_blocks > 0); |
| 1541 threshold = FLAG_optimization_counter_scale * basic_blocks + | 1544 threshold = FLAG_optimization_counter_scale * basic_blocks + |
| 1542 FLAG_min_optimization_counter_threshold; | 1545 FLAG_min_optimization_counter_threshold; |
| 1543 if (threshold > FLAG_optimization_counter_threshold) { | 1546 if (threshold > FLAG_optimization_counter_threshold) { |
| 1544 threshold = FLAG_optimization_counter_threshold; | 1547 threshold = FLAG_optimization_counter_threshold; |
| 1545 } | 1548 } |
| 1546 } | 1549 } |
| 1547 return threshold; | 1550 return threshold; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1561 case kUnboxedMint: | 1564 case kUnboxedMint: |
| 1562 return mint_class(); | 1565 return mint_class(); |
| 1563 default: | 1566 default: |
| 1564 UNREACHABLE(); | 1567 UNREACHABLE(); |
| 1565 return Class::ZoneHandle(); | 1568 return Class::ZoneHandle(); |
| 1566 } | 1569 } |
| 1567 } | 1570 } |
| 1568 | 1571 |
| 1569 | 1572 |
| 1570 } // namespace dart | 1573 } // namespace dart |
| OLD | NEW |