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 12 matching lines...) Expand all Loading... | |
23 #include "vm/raw_object.h" | 23 #include "vm/raw_object.h" |
24 #include "vm/stack_frame.h" | 24 #include "vm/stack_frame.h" |
25 #include "vm/stub_code.h" | 25 #include "vm/stub_code.h" |
26 #include "vm/symbols.h" | 26 #include "vm/symbols.h" |
27 | 27 |
28 namespace dart { | 28 namespace dart { |
29 | 29 |
30 DEFINE_FLAG(bool, always_megamorphic_calls, false, | 30 DEFINE_FLAG(bool, always_megamorphic_calls, false, |
31 "Instance call always as megamorphic."); | 31 "Instance call always as megamorphic."); |
32 DEFINE_FLAG(bool, trace_inlining_intervals, false, | 32 DEFINE_FLAG(bool, trace_inlining_intervals, false, |
33 "Inlining interval diagnostics"); | 33 "Inlining interval diagnostics");; |
hausner
2015/05/06 16:39:55
Two is better than one?
srdjan
2015/05/06 20:00:47
:-) removed.
| |
34 DEFINE_FLAG(bool, eager_info_computation, false, | |
35 "Eagerly compute various informations (local var descriptors)."); | |
34 DEFINE_FLAG(bool, enable_simd_inline, true, | 36 DEFINE_FLAG(bool, enable_simd_inline, true, |
35 "Enable inlining of SIMD related method calls."); | 37 "Enable inlining of SIMD related method calls."); |
36 DEFINE_FLAG(int, min_optimization_counter_threshold, 5000, | 38 DEFINE_FLAG(int, min_optimization_counter_threshold, 5000, |
37 "The minimum invocation count for a function."); | 39 "The minimum invocation count for a function."); |
38 DEFINE_FLAG(int, optimization_counter_scale, 2000, | 40 DEFINE_FLAG(int, optimization_counter_scale, 2000, |
39 "The scale of invocation count, by size of the function."); | 41 "The scale of invocation count, by size of the function."); |
40 DEFINE_FLAG(bool, source_lines, false, "Emit source line as assembly comment."); | 42 DEFINE_FLAG(bool, source_lines, false, "Emit source line as assembly comment."); |
41 DEFINE_FLAG(bool, use_megamorphic_stub, true, "Out of line megamorphic lookup"); | 43 DEFINE_FLAG(bool, use_megamorphic_stub, true, "Out of line megamorphic lookup"); |
42 | 44 |
43 DECLARE_FLAG(bool, code_comments); | 45 DECLARE_FLAG(bool, code_comments); |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
917 | 919 |
918 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { | 920 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { |
919 if (code.is_optimized()) { | 921 if (code.is_optimized()) { |
920 // Optimized code does not need variable descriptors. They are | 922 // Optimized code does not need variable descriptors. They are |
921 // only stored in the unoptimized version. | 923 // only stored in the unoptimized version. |
922 code.set_var_descriptors(Object::empty_var_descriptors()); | 924 code.set_var_descriptors(Object::empty_var_descriptors()); |
923 return; | 925 return; |
924 } | 926 } |
925 LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle(); | 927 LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle(); |
926 if (parsed_function().node_sequence() == NULL) { | 928 if (parsed_function().node_sequence() == NULL) { |
929 // TODO(srdjan): Implement lazy local var descriptors if Irregexp functions. | |
927 ASSERT(flow_graph().IsIrregexpFunction()); | 930 ASSERT(flow_graph().IsIrregexpFunction()); |
928 var_descs = LocalVarDescriptors::New(1); | 931 var_descs = LocalVarDescriptors::New(1); |
929 RawLocalVarDescriptors::VarInfo info; | 932 RawLocalVarDescriptors::VarInfo info; |
930 info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); | 933 info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); |
931 info.scope_id = 0; | 934 info.scope_id = 0; |
932 info.begin_pos = 0; | 935 info.begin_pos = 0; |
933 info.end_pos = 0; | 936 info.end_pos = 0; |
934 info.set_index(parsed_function().current_context_var()->index()); | 937 info.set_index(parsed_function().current_context_var()->index()); |
935 var_descs.SetVar(0, Symbols::CurrentContextVar(), &info); | 938 var_descs.SetVar(0, Symbols::CurrentContextVar(), &info); |
936 } else { | 939 } else { |
937 var_descs = | 940 if (FLAG_eager_info_computation) { |
938 parsed_function_.node_sequence()->scope()->GetVarDescriptors( | 941 var_descs = |
939 parsed_function_.function()); | 942 parsed_function_.node_sequence()->scope()->GetVarDescriptors( |
943 parsed_function_.function()); | |
944 } | |
940 } | 945 } |
941 code.set_var_descriptors(var_descs); | 946 code.set_var_descriptors(var_descs); |
942 } | 947 } |
943 | 948 |
944 | 949 |
945 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) { | 950 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) { |
946 ASSERT(code.static_calls_target_table() == Array::null()); | 951 ASSERT(code.static_calls_target_table() == Array::null()); |
947 code.set_static_calls_target_table( | 952 code.set_static_calls_target_table( |
948 Array::Handle(Array::MakeArray(static_calls_target_table_))); | 953 Array::Handle(Array::MakeArray(static_calls_target_table_))); |
949 } | 954 } |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1719 | 1724 |
1720 | 1725 |
1721 void FlowGraphCompiler::FrameStateClear() { | 1726 void FlowGraphCompiler::FrameStateClear() { |
1722 ASSERT(!is_optimizing()); | 1727 ASSERT(!is_optimizing()); |
1723 frame_state_.TruncateTo(0); | 1728 frame_state_.TruncateTo(0); |
1724 } | 1729 } |
1725 #endif | 1730 #endif |
1726 | 1731 |
1727 | 1732 |
1728 } // namespace dart | 1733 } // namespace dart |
OLD | NEW |