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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 DECLARE_FLAG(bool, trace_compiler); | 55 DECLARE_FLAG(bool, trace_compiler); |
56 DECLARE_FLAG(int, inlining_hotness); | 56 DECLARE_FLAG(int, inlining_hotness); |
57 DECLARE_FLAG(int, inlining_size_threshold); | 57 DECLARE_FLAG(int, inlining_size_threshold); |
58 DECLARE_FLAG(int, inlining_callee_size_threshold); | 58 DECLARE_FLAG(int, inlining_callee_size_threshold); |
59 DECLARE_FLAG(int, inline_getters_setters_smaller_than); | 59 DECLARE_FLAG(int, inline_getters_setters_smaller_than); |
60 DECLARE_FLAG(int, inlining_depth_threshold); | 60 DECLARE_FLAG(int, inlining_depth_threshold); |
61 DECLARE_FLAG(int, inlining_caller_size_threshold); | 61 DECLARE_FLAG(int, inlining_caller_size_threshold); |
62 DECLARE_FLAG(int, inlining_constant_arguments_max_size_threshold); | 62 DECLARE_FLAG(int, inlining_constant_arguments_max_size_threshold); |
63 DECLARE_FLAG(int, inlining_constant_arguments_min_size_threshold); | 63 DECLARE_FLAG(int, inlining_constant_arguments_min_size_threshold); |
64 DECLARE_FLAG(int, reload_every); | 64 DECLARE_FLAG(int, reload_every); |
| 65 DECLARE_FLAG(bool, unbox_numeric_fields); |
65 | 66 |
66 static void PrecompilationModeHandler(bool value) { | 67 static void PrecompilationModeHandler(bool value) { |
67 if (value) { | 68 if (value) { |
68 #if defined(TARGET_ARCH_IA32) | 69 #if defined(TARGET_ARCH_IA32) |
69 FATAL("Precompilation not supported on IA32"); | 70 FATAL("Precompilation not supported on IA32"); |
70 #endif | 71 #endif |
71 | 72 |
72 // Flags affecting compilation only: | 73 // Flags affecting compilation only: |
73 // There is no counter feedback in precompilation, so ignore the counter | 74 // There is no counter feedback in precompilation, so ignore the counter |
74 // when making inlining decisions. | 75 // when making inlining decisions. |
(...skipping 12 matching lines...) Expand all Loading... |
87 FLAG_fields_may_be_reset = true; | 88 FLAG_fields_may_be_reset = true; |
88 FLAG_interpret_irregexp = true; | 89 FLAG_interpret_irregexp = true; |
89 FLAG_lazy_dispatchers = false; | 90 FLAG_lazy_dispatchers = false; |
90 FLAG_link_natives_lazily = true; | 91 FLAG_link_natives_lazily = true; |
91 FLAG_optimization_counter_threshold = -1; | 92 FLAG_optimization_counter_threshold = -1; |
92 FLAG_polymorphic_with_deopt = false; | 93 FLAG_polymorphic_with_deopt = false; |
93 FLAG_precompiled_mode = true; | 94 FLAG_precompiled_mode = true; |
94 FLAG_reorder_basic_blocks = false; | 95 FLAG_reorder_basic_blocks = false; |
95 FLAG_use_field_guards = false; | 96 FLAG_use_field_guards = false; |
96 FLAG_use_cha_deopt = false; | 97 FLAG_use_cha_deopt = false; |
| 98 FLAG_unbox_numeric_fields = false; |
97 | 99 |
98 #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) | 100 #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME) |
99 // Set flags affecting runtime accordingly for dart_noopt. | 101 // Set flags affecting runtime accordingly for dart_noopt. |
100 FLAG_collect_code = false; | 102 FLAG_collect_code = false; |
101 FLAG_support_debugger = false; | 103 FLAG_support_debugger = false; |
102 FLAG_deoptimize_alot = false; // Used in some tests. | 104 FLAG_deoptimize_alot = false; // Used in some tests. |
103 FLAG_deoptimize_every = 0; // Used in some tests. | 105 FLAG_deoptimize_every = 0; // Used in some tests. |
104 FLAG_enable_mirrors = false; | 106 FLAG_enable_mirrors = false; |
105 FLAG_load_deferred_eagerly = true; | 107 FLAG_load_deferred_eagerly = true; |
106 FLAG_print_stop_message = false; | 108 FLAG_print_stop_message = false; |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 // An implicit getter must have a specific AST structure. | 1139 // An implicit getter must have a specific AST structure. |
1138 const SequenceNode& sequence_node = *parsed_function().node_sequence(); | 1140 const SequenceNode& sequence_node = *parsed_function().node_sequence(); |
1139 ASSERT(sequence_node.length() == 1); | 1141 ASSERT(sequence_node.length() == 1); |
1140 ASSERT(sequence_node.NodeAt(0)->IsReturnNode()); | 1142 ASSERT(sequence_node.NodeAt(0)->IsReturnNode()); |
1141 const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode(); | 1143 const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode(); |
1142 ASSERT(return_node.value()->IsLoadInstanceFieldNode()); | 1144 ASSERT(return_node.value()->IsLoadInstanceFieldNode()); |
1143 const LoadInstanceFieldNode& load_node = | 1145 const LoadInstanceFieldNode& load_node = |
1144 *return_node.value()->AsLoadInstanceFieldNode(); | 1146 *return_node.value()->AsLoadInstanceFieldNode(); |
1145 // Only intrinsify getter if the field cannot contain a mutable double. | 1147 // Only intrinsify getter if the field cannot contain a mutable double. |
1146 // Reading from a mutable double box requires allocating a fresh double. | 1148 // Reading from a mutable double box requires allocating a fresh double. |
1147 if (!IsPotentialUnboxedField(load_node.field())) { | 1149 if (FLAG_precompiled_mode || |
| 1150 !IsPotentialUnboxedField(load_node.field())) { |
1148 GenerateInlinedGetter(load_node.field().Offset()); | 1151 GenerateInlinedGetter(load_node.field().Offset()); |
1149 return !FLAG_use_field_guards; | 1152 return !FLAG_use_field_guards; |
1150 } | 1153 } |
1151 return false; | 1154 return false; |
1152 } | 1155 } |
1153 if (parsed_function().function().kind() == RawFunction::kImplicitSetter) { | 1156 if (parsed_function().function().kind() == RawFunction::kImplicitSetter) { |
1154 // An implicit setter must have a specific AST structure. | 1157 // An implicit setter must have a specific AST structure. |
1155 // Sequence node has one store node and one return NULL node. | 1158 // Sequence node has one store node and one return NULL node. |
1156 const SequenceNode& sequence_node = *parsed_function().node_sequence(); | 1159 const SequenceNode& sequence_node = *parsed_function().node_sequence(); |
1157 ASSERT(sequence_node.length() == 2); | 1160 ASSERT(sequence_node.length() == 2); |
1158 ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode()); | 1161 ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode()); |
1159 ASSERT(sequence_node.NodeAt(1)->IsReturnNode()); | 1162 ASSERT(sequence_node.NodeAt(1)->IsReturnNode()); |
1160 const StoreInstanceFieldNode& store_node = | 1163 const StoreInstanceFieldNode& store_node = |
1161 *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode(); | 1164 *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode(); |
1162 if (store_node.field().guarded_cid() == kDynamicCid) { | 1165 if (FLAG_precompiled_mode || |
| 1166 (store_node.field().guarded_cid() == kDynamicCid)) { |
1163 GenerateInlinedSetter(store_node.field().Offset()); | 1167 GenerateInlinedSetter(store_node.field().Offset()); |
1164 return !FLAG_use_field_guards; | 1168 return !FLAG_use_field_guards; |
1165 } | 1169 } |
1166 } | 1170 } |
1167 } | 1171 } |
1168 | 1172 |
1169 EnterIntrinsicMode(); | 1173 EnterIntrinsicMode(); |
1170 | 1174 |
1171 Intrinsifier::Intrinsify(parsed_function(), this); | 1175 Intrinsifier::Intrinsify(parsed_function(), this); |
1172 | 1176 |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 | 2002 |
1999 | 2003 |
2000 void FlowGraphCompiler::FrameStateClear() { | 2004 void FlowGraphCompiler::FrameStateClear() { |
2001 ASSERT(!is_optimizing()); | 2005 ASSERT(!is_optimizing()); |
2002 frame_state_.TruncateTo(0); | 2006 frame_state_.TruncateTo(0); |
2003 } | 2007 } |
2004 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 2008 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
2005 | 2009 |
2006 | 2010 |
2007 } // namespace dart | 2011 } // namespace dart |
OLD | NEW |