| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 // TODO(srdjan): Test/support other number types as well. | 158 // TODO(srdjan): Test/support other number types as well. |
| 159 static bool IsNumberCid(intptr_t cid) { | 159 static bool IsNumberCid(intptr_t cid) { |
| 160 return (cid == kSmiCid) || (cid == kDoubleCid); | 160 return (cid == kSmiCid) || (cid == kDoubleCid); |
| 161 } | 161 } |
| 162 | 162 |
| 163 | 163 |
| 164 // Attempt to build ICData for call using propagated class-ids. | 164 // Attempt to build ICData for call using propagated class-ids. |
| 165 bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) { | 165 bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) { |
| 166 ASSERT(call->HasICData()); | 166 ASSERT(call->HasICData()); |
| 167 if (call->ic_data()->NumberOfUsedChecks() > 0) { | 167 if (call->ic_data()->NumberOfChecks() > 0) { |
| 168 // This occurs when an instance call has too many checks, will be converted | 168 // This occurs when an instance call has too many checks, will be converted |
| 169 // to megamorphic call. | 169 // to megamorphic call. |
| 170 return false; | 170 return false; |
| 171 } | 171 } |
| 172 if (FLAG_warn_on_javascript_compatibility) { | 172 if (FLAG_warn_on_javascript_compatibility) { |
| 173 // Do not make the instance call megamorphic if the callee needs to decode | 173 // Do not make the instance call megamorphic if the callee needs to decode |
| 174 // the calling code sequence to lookup the ic data and verify if a warning | 174 // the calling code sequence to lookup the ic data and verify if a warning |
| 175 // has already been issued or not. | 175 // has already been issued or not. |
| 176 // TryCreateICData is only invoked if the ic_data target has not been called | 176 // TryCreateICData is only invoked if the ic_data target has not been called |
| 177 // yet, so no warning can possibly have been issued. | 177 // yet, so no warning can possibly have been issued. |
| (...skipping 8541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8719 | 8719 |
| 8720 // Insert materializations at environment uses. | 8720 // Insert materializations at environment uses. |
| 8721 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 8721 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 8722 CreateMaterializationAt( | 8722 CreateMaterializationAt( |
| 8723 exits_collector_.exits()[i], alloc, *slots); | 8723 exits_collector_.exits()[i], alloc, *slots); |
| 8724 } | 8724 } |
| 8725 } | 8725 } |
| 8726 | 8726 |
| 8727 | 8727 |
| 8728 } // namespace dart | 8728 } // namespace dart |
| OLD | NEW |