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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 return InlineSetIndexed(kind, target, call, receiver, token_pos, | 1437 return InlineSetIndexed(kind, target, call, receiver, token_pos, |
1438 value_check, entry, last); | 1438 value_check, entry, last); |
1439 case MethodRecognizer::kInt8ArraySetIndexed: | 1439 case MethodRecognizer::kInt8ArraySetIndexed: |
1440 case MethodRecognizer::kUint8ArraySetIndexed: | 1440 case MethodRecognizer::kUint8ArraySetIndexed: |
1441 case MethodRecognizer::kUint8ClampedArraySetIndexed: | 1441 case MethodRecognizer::kUint8ClampedArraySetIndexed: |
1442 case MethodRecognizer::kExternalUint8ArraySetIndexed: | 1442 case MethodRecognizer::kExternalUint8ArraySetIndexed: |
1443 case MethodRecognizer::kExternalUint8ClampedArraySetIndexed: | 1443 case MethodRecognizer::kExternalUint8ClampedArraySetIndexed: |
1444 case MethodRecognizer::kInt16ArraySetIndexed: | 1444 case MethodRecognizer::kInt16ArraySetIndexed: |
1445 case MethodRecognizer::kUint16ArraySetIndexed: | 1445 case MethodRecognizer::kUint16ArraySetIndexed: |
1446 // Optimistically assume Smi. | 1446 // Optimistically assume Smi. |
1447 // TODO(srdjan): Check deopt reason to prevent repeated deoptimizations. | 1447 if (ic_data.HasDeoptReason(ICData::kDeoptCheckSmi)) { |
| 1448 // Optimistic assumption failed at least once. |
| 1449 return false; |
| 1450 } |
1448 value_check = ic_data.AsUnaryClassChecksForCid(kSmiCid, target); | 1451 value_check = ic_data.AsUnaryClassChecksForCid(kSmiCid, target); |
1449 return InlineSetIndexed(kind, target, call, receiver, token_pos, | 1452 return InlineSetIndexed(kind, target, call, receiver, token_pos, |
1450 value_check, entry, last); | 1453 value_check, entry, last); |
1451 case MethodRecognizer::kInt32ArraySetIndexed: | 1454 case MethodRecognizer::kInt32ArraySetIndexed: |
1452 case MethodRecognizer::kUint32ArraySetIndexed: { | 1455 case MethodRecognizer::kUint32ArraySetIndexed: { |
1453 // Value check not needed for Int32 and Uint32 arrays because they | 1456 // Value check not needed for Int32 and Uint32 arrays because they |
1454 // implicitly contain unboxing instructions which check for right type. | 1457 // implicitly contain unboxing instructions which check for right type. |
1455 ICData& value_check = ICData::Handle(); | 1458 ICData& value_check = ICData::Handle(); |
1456 return InlineSetIndexed(kind, target, call, receiver, token_pos, | 1459 return InlineSetIndexed(kind, target, call, receiver, token_pos, |
1457 value_check, entry, last); | 1460 value_check, entry, last); |
(...skipping 7206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8664 | 8667 |
8665 // Insert materializations at environment uses. | 8668 // Insert materializations at environment uses. |
8666 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 8669 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
8667 CreateMaterializationAt( | 8670 CreateMaterializationAt( |
8668 exits_collector_.exits()[i], alloc, *slots); | 8671 exits_collector_.exits()[i], alloc, *slots); |
8669 } | 8672 } |
8670 } | 8673 } |
8671 | 8674 |
8672 | 8675 |
8673 } // namespace dart | 8676 } // namespace dart |
OLD | NEW |