| 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/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 GrowableArray<intptr_t> class_ids(call->ic_data()->num_args_tested()); | 118 GrowableArray<intptr_t> class_ids(call->ic_data()->num_args_tested()); |
| 119 ASSERT(call->ic_data()->num_args_tested() <= call->ArgumentCount()); | 119 ASSERT(call->ic_data()->num_args_tested() <= call->ArgumentCount()); |
| 120 for (intptr_t i = 0; i < call->ic_data()->num_args_tested(); i++) { | 120 for (intptr_t i = 0; i < call->ic_data()->num_args_tested(); i++) { |
| 121 const intptr_t cid = call->PushArgumentAt(i)->value()->Type()->ToCid(); | 121 const intptr_t cid = call->PushArgumentAt(i)->value()->Type()->ToCid(); |
| 122 class_ids.Add(cid); | 122 class_ids.Add(cid); |
| 123 } | 123 } |
| 124 | 124 |
| 125 const Token::Kind op_kind = call->token_kind(); | 125 const Token::Kind op_kind = call->token_kind(); |
| 126 if (Token::IsRelationalOperator(op_kind) || | 126 if (Token::IsRelationalOperator(op_kind) || |
| 127 Token::IsRelationalOperator(op_kind) || | 127 Token::IsEqualityOperator(op_kind) || |
| 128 Token::IsBinaryOperator(op_kind)) { | 128 Token::IsBinaryOperator(op_kind)) { |
| 129 // Guess cid: if one of the inputs is a number assume that the other | 129 // Guess cid: if one of the inputs is a number assume that the other |
| 130 // is a number of same type. | 130 // is a number of same type. |
| 131 const intptr_t cid_0 = class_ids[0]; | 131 const intptr_t cid_0 = class_ids[0]; |
| 132 const intptr_t cid_1 = class_ids[1]; | 132 const intptr_t cid_1 = class_ids[1]; |
| 133 if ((cid_0 == kDynamicCid) && (IsNumberCid(cid_1))) { | 133 if ((cid_0 == kDynamicCid) && (IsNumberCid(cid_1))) { |
| 134 class_ids[0] = cid_1; | 134 class_ids[0] = cid_1; |
| 135 } else if (IsNumberCid(cid_0) && (cid_1 == kDynamicCid)) { | 135 } else if (IsNumberCid(cid_0) && (cid_1 == kDynamicCid)) { |
| 136 class_ids[1] = cid_0; | 136 class_ids[1] = cid_0; |
| 137 } | 137 } |
| (...skipping 8145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8283 } | 8283 } |
| 8284 | 8284 |
| 8285 // Insert materializations at environment uses. | 8285 // Insert materializations at environment uses. |
| 8286 for (intptr_t i = 0; i < exits.length(); i++) { | 8286 for (intptr_t i = 0; i < exits.length(); i++) { |
| 8287 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 8287 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
| 8288 } | 8288 } |
| 8289 } | 8289 } |
| 8290 | 8290 |
| 8291 | 8291 |
| 8292 } // namespace dart | 8292 } // namespace dart |
| OLD | NEW |