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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 DECLARE_FLAG(bool, background_compilation); | 50 DECLARE_FLAG(bool, background_compilation); |
51 DECLARE_FLAG(bool, code_comments); | 51 DECLARE_FLAG(bool, code_comments); |
52 DECLARE_FLAG(bool, deoptimize_alot); | 52 DECLARE_FLAG(bool, deoptimize_alot); |
53 DECLARE_FLAG(int, deoptimize_every); | 53 DECLARE_FLAG(int, deoptimize_every); |
54 DECLARE_FLAG(charp, deoptimize_filter); | 54 DECLARE_FLAG(charp, deoptimize_filter); |
55 DECLARE_FLAG(bool, disassemble); | 55 DECLARE_FLAG(bool, disassemble); |
56 DECLARE_FLAG(bool, disassemble_optimized); | 56 DECLARE_FLAG(bool, disassemble_optimized); |
57 DECLARE_FLAG(bool, emit_edge_counters); | 57 DECLARE_FLAG(bool, emit_edge_counters); |
58 DECLARE_FLAG(bool, fields_may_be_reset); | 58 DECLARE_FLAG(bool, fields_may_be_reset); |
59 DECLARE_FLAG(bool, guess_other_cid); | 59 DECLARE_FLAG(bool, guess_icdata_cid); |
60 DECLARE_FLAG(bool, ic_range_profiling); | 60 DECLARE_FLAG(bool, ic_range_profiling); |
61 DECLARE_FLAG(bool, intrinsify); | 61 DECLARE_FLAG(bool, intrinsify); |
62 DECLARE_FLAG(bool, load_deferred_eagerly); | 62 DECLARE_FLAG(bool, load_deferred_eagerly); |
63 DECLARE_FLAG(int, optimization_counter_threshold); | 63 DECLARE_FLAG(int, optimization_counter_threshold); |
64 DECLARE_FLAG(bool, propagate_ic_data); | 64 DECLARE_FLAG(bool, propagate_ic_data); |
65 DECLARE_FLAG(int, regexp_optimization_counter_threshold); | 65 DECLARE_FLAG(int, regexp_optimization_counter_threshold); |
66 DECLARE_FLAG(int, reoptimization_counter_threshold); | 66 DECLARE_FLAG(int, reoptimization_counter_threshold); |
67 DECLARE_FLAG(int, stacktrace_every); | 67 DECLARE_FLAG(int, stacktrace_every); |
68 DECLARE_FLAG(charp, stacktrace_filter); | 68 DECLARE_FLAG(charp, stacktrace_filter); |
69 DECLARE_FLAG(bool, support_debugger); | 69 DECLARE_FLAG(bool, support_debugger); |
(...skipping 21 matching lines...) Expand all Loading... |
91 FLAG_optimization_counter_threshold = -1; | 91 FLAG_optimization_counter_threshold = -1; |
92 FLAG_use_field_guards = false; | 92 FLAG_use_field_guards = false; |
93 FLAG_use_osr = false; | 93 FLAG_use_osr = false; |
94 FLAG_emit_edge_counters = false; | 94 FLAG_emit_edge_counters = false; |
95 FLAG_support_debugger = false; | 95 FLAG_support_debugger = false; |
96 FLAG_ic_range_profiling = false; | 96 FLAG_ic_range_profiling = false; |
97 FLAG_collect_code = false; | 97 FLAG_collect_code = false; |
98 FLAG_load_deferred_eagerly = true; | 98 FLAG_load_deferred_eagerly = true; |
99 FLAG_deoptimize_alot = false; // Used in some tests. | 99 FLAG_deoptimize_alot = false; // Used in some tests. |
100 FLAG_deoptimize_every = 0; // Used in some tests. | 100 FLAG_deoptimize_every = 0; // Used in some tests. |
101 FLAG_guess_other_cid = true; | |
102 Compiler::set_always_optimize(true); | 101 Compiler::set_always_optimize(true); |
103 // Triggers assert if we try to recompile (e.g., because of deferred | 102 // Triggers assert if we try to recompile (e.g., because of deferred |
104 // loading, deoptimization, ...). Noopt mode simulates behavior | 103 // loading, deoptimization, ...). Noopt mode simulates behavior |
105 // of precompiled code, therefore do not allow recompilation. | 104 // of precompiled code, therefore do not allow recompilation. |
106 Compiler::set_allow_recompilation(false); | 105 Compiler::set_allow_recompilation(false); |
107 // Precompilation finalizes all classes and thus allows CHA optimizations. | 106 // Precompilation finalizes all classes and thus allows CHA optimizations. |
108 // Do not require CHA triggered deoptimization. | 107 // Do not require CHA triggered deoptimization. |
109 FLAG_use_cha_deopt = false; | 108 FLAG_use_cha_deopt = false; |
110 // Calling the PrintStopMessage stub is not supported in precompiled code | 109 // Calling the PrintStopMessage stub is not supported in precompiled code |
111 // since it is done at places where no pool pointer is loaded. | 110 // since it is done at places where no pool pointer is loaded. |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1766 ICData::kDeoptPolymorphicInstanceCallTestFail); | 1765 ICData::kDeoptPolymorphicInstanceCallTestFail); |
1767 Label ok; | 1766 Label ok; |
1768 EmitTestAndCall(ic_data, argument_count, argument_names, | 1767 EmitTestAndCall(ic_data, argument_count, argument_names, |
1769 deopt, // No cid match. | 1768 deopt, // No cid match. |
1770 &ok, // Found cid. | 1769 &ok, // Found cid. |
1771 deopt_id, token_pos, locs); | 1770 deopt_id, token_pos, locs); |
1772 assembler()->Bind(&ok); | 1771 assembler()->Bind(&ok); |
1773 } else { | 1772 } else { |
1774 // Instead of deoptimizing, do a megamorphic call when no matching | 1773 // Instead of deoptimizing, do a megamorphic call when no matching |
1775 // cid found. | 1774 // cid found. |
1776 Label megamorphic, ok; | 1775 Label ok; |
| 1776 MegamorphicSlowPath* slow_path = |
| 1777 new MegamorphicSlowPath(ic_data, argument_count, deopt_id, |
| 1778 token_pos, locs, CurrentTryIndex()); |
| 1779 AddSlowPathCode(slow_path); |
1777 EmitTestAndCall(ic_data, argument_count, argument_names, | 1780 EmitTestAndCall(ic_data, argument_count, argument_names, |
1778 &megamorphic, // No cid match. | 1781 slow_path->entry_label(), // No cid match. |
1779 &ok, // Found cid. | 1782 &ok, // Found cid. |
1780 deopt_id, token_pos, locs); | 1783 deopt_id, token_pos, locs); |
1781 // Fall through if last test is match. | 1784 |
1782 assembler()->Jump(&ok); | 1785 assembler()->Bind(slow_path->exit_label()); |
1783 assembler()->Bind(&megamorphic); | |
1784 EmitMegamorphicInstanceCall(ic_data, argument_count, deopt_id, | |
1785 token_pos, locs); | |
1786 assembler()->Bind(&ok); | 1786 assembler()->Bind(&ok); |
1787 } | 1787 } |
1788 } | 1788 } |
1789 | 1789 |
1790 | 1790 |
1791 #if defined(DEBUG) | 1791 #if defined(DEBUG) |
1792 void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) { | 1792 void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) { |
1793 ASSERT(!is_optimizing()); | 1793 ASSERT(!is_optimizing()); |
1794 | 1794 |
1795 switch (instr->tag()) { | 1795 switch (instr->tag()) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1856 | 1856 |
1857 | 1857 |
1858 void FlowGraphCompiler::FrameStateClear() { | 1858 void FlowGraphCompiler::FrameStateClear() { |
1859 ASSERT(!is_optimizing()); | 1859 ASSERT(!is_optimizing()); |
1860 frame_state_.TruncateTo(0); | 1860 frame_state_.TruncateTo(0); |
1861 } | 1861 } |
1862 #endif | 1862 #endif |
1863 | 1863 |
1864 | 1864 |
1865 } // namespace dart | 1865 } // namespace dart |
OLD | NEW |