| 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->IsRelationalOp()) { | |
| 132 ic_data = current->AsRelationalOp()->ic_data(); | |
| 133 ASSERT(ic_data != NULL); | |
| 134 } else if (current->IsEqualityCompare()) { | 131 } else if (current->IsEqualityCompare()) { |
| 135 ic_data = current->AsEqualityCompare()->ic_data(); | 132 ic_data = current->AsEqualityCompare()->ic_data(); |
| 136 ASSERT(ic_data != NULL); | 133 ASSERT(ic_data != NULL); |
| 137 } | 134 } |
| 138 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) { | 135 if ((ic_data != NULL) && (ic_data->NumberOfChecks() == 0)) { |
| 139 may_reoptimize_ = true; | 136 may_reoptimize_ = true; |
| 140 } | 137 } |
| 141 if (is_leaf && !current->IsCheckStackOverflow()) { | 138 if (is_leaf && !current->IsCheckStackOverflow()) { |
| 142 // Note that we do not care if the code contains instructions that | 139 // Note that we do not care if the code contains instructions that |
| 143 // can deoptimize. | 140 // can deoptimize. |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 | 1142 |
| 1146 for (int i = 0; i < len; i++) { | 1143 for (int i = 0; i < len; i++) { |
| 1147 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), | 1144 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), |
| 1148 &Function::ZoneHandle(ic_data.GetTargetAt(i)), | 1145 &Function::ZoneHandle(ic_data.GetTargetAt(i)), |
| 1149 ic_data.GetCountAt(i))); | 1146 ic_data.GetCountAt(i))); |
| 1150 } | 1147 } |
| 1151 sorted->Sort(HighestCountFirst); | 1148 sorted->Sort(HighestCountFirst); |
| 1152 } | 1149 } |
| 1153 | 1150 |
| 1154 } // namespace dart | 1151 } // namespace dart |
| OLD | NEW |