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/cha.h" | 9 #include "vm/cha.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { | 121 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { |
122 Instruction* current = it.Current(); | 122 Instruction* current = it.Current(); |
123 if (current->IsBranch()) { | 123 if (current->IsBranch()) { |
124 current = current->AsBranch()->comparison(); | 124 current = current->AsBranch()->comparison(); |
125 } | 125 } |
126 // In optimized code, ICData is always set in the instructions. | 126 // In optimized code, ICData is always set in the instructions. |
127 const ICData* ic_data = NULL; | 127 const ICData* ic_data = NULL; |
128 if (current->IsInstanceCall()) { | 128 if (current->IsInstanceCall()) { |
129 ic_data = current->AsInstanceCall()->ic_data(); | 129 ic_data = current->AsInstanceCall()->ic_data(); |
130 ASSERT(ic_data != NULL); | 130 ASSERT(ic_data != NULL); |
131 } else if (current->IsEqualityCompare()) { | |
132 ic_data = current->AsEqualityCompare()->ic_data(); | |
133 ASSERT(ic_data != NULL); | |
134 } | 131 } |
135 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) { | 132 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) { |
136 may_reoptimize_ = true; | 133 may_reoptimize_ = true; |
137 } | 134 } |
138 if (is_leaf && !current->IsCheckStackOverflow()) { | 135 if (is_leaf && !current->IsCheckStackOverflow()) { |
139 // Note that we do not care if the code contains instructions that | 136 // Note that we do not care if the code contains instructions that |
140 // can deoptimize. | 137 // can deoptimize. |
141 LocationSummary* locs = current->locs(); | 138 LocationSummary* locs = current->locs(); |
142 if ((locs != NULL) && locs->can_call()) { | 139 if ((locs != NULL) && locs->can_call()) { |
143 is_leaf = false; | 140 is_leaf = false; |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 | 1202 |
1206 for (int i = 0; i < len; i++) { | 1203 for (int i = 0; i < len; i++) { |
1207 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1204 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
1208 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1205 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
1209 ic_data.GetCountAt(i))); | 1206 ic_data.GetCountAt(i))); |
1210 } | 1207 } |
1211 sorted->Sort(HighestCountFirst); | 1208 sorted->Sort(HighestCountFirst); |
1212 } | 1209 } |
1213 | 1210 |
1214 } // namespace dart | 1211 } // namespace dart |
OLD | NEW |