| 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/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 switch (class_id) { | 752 switch (class_id) { |
| 753 case kArrayCid: | 753 case kArrayCid: |
| 754 case kImmutableArrayCid: | 754 case kImmutableArrayCid: |
| 755 case kGrowableObjectArrayCid: | 755 case kGrowableObjectArrayCid: |
| 756 case kFloat32ArrayCid: | 756 case kFloat32ArrayCid: |
| 757 case kFloat64ArrayCid: | 757 case kFloat64ArrayCid: |
| 758 case kInt8ArrayCid: | 758 case kInt8ArrayCid: |
| 759 case kUint8ArrayCid: | 759 case kUint8ArrayCid: |
| 760 case kUint8ClampedArrayCid: | 760 case kUint8ClampedArrayCid: |
| 761 case kExternalUint8ArrayCid: | 761 case kExternalUint8ArrayCid: |
| 762 case kExternalUint8ClampedArrayCid: |
| 762 case kInt16ArrayCid: | 763 case kInt16ArrayCid: |
| 763 case kUint16ArrayCid: | 764 case kUint16ArrayCid: |
| 764 break; | 765 break; |
| 765 case kInt32ArrayCid: | 766 case kInt32ArrayCid: |
| 766 case kUint32ArrayCid: | 767 case kUint32ArrayCid: |
| 767 // Check if elements fit into a smi or the platform supports unboxed | 768 // Check if elements fit into a smi or the platform supports unboxed |
| 768 // mints. | 769 // mints. |
| 769 if ((kSmiBits < 32) && !FlowGraphCompiler::SupportsUnboxedMints()) { | 770 if ((kSmiBits < 32) && !FlowGraphCompiler::SupportsUnboxedMints()) { |
| 770 return false; | 771 return false; |
| 771 } | 772 } |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 call->ReplaceWith(d2d_instr, current_iterator()); | 1463 call->ReplaceWith(d2d_instr, current_iterator()); |
| 1463 RemovePushArguments(call); | 1464 RemovePushArguments(call); |
| 1464 } | 1465 } |
| 1465 return true; | 1466 return true; |
| 1466 default: | 1467 default: |
| 1467 // Unsupported method. | 1468 // Unsupported method. |
| 1468 return false; | 1469 return false; |
| 1469 } | 1470 } |
| 1470 } | 1471 } |
| 1471 | 1472 |
| 1472 if (IsSupportedByteArrayCid(class_ids[0]) && ic_data.NumberOfChecks() == 1) { | 1473 if (IsSupportedByteArrayCid(class_ids[0]) && |
| 1474 (ic_data.NumberOfChecks() == 1)) { |
| 1473 Definition* array_op = NULL; | 1475 Definition* array_op = NULL; |
| 1474 switch (recognized_kind) { | 1476 switch (recognized_kind) { |
| 1475 case MethodRecognizer::kByteArrayBaseGetInt8: | 1477 case MethodRecognizer::kByteArrayBaseGetInt8: |
| 1476 array_op = BuildByteArrayViewLoad(call, class_ids[0], kInt8ArrayCid); | 1478 array_op = BuildByteArrayViewLoad(call, class_ids[0], kInt8ArrayCid); |
| 1477 break; | 1479 break; |
| 1478 case MethodRecognizer::kByteArrayBaseGetUint8: | 1480 case MethodRecognizer::kByteArrayBaseGetUint8: |
| 1479 array_op = BuildByteArrayViewLoad(call, class_ids[0], kUint8ArrayCid); | 1481 array_op = BuildByteArrayViewLoad(call, class_ids[0], kUint8ArrayCid); |
| 1480 break; | 1482 break; |
| 1481 case MethodRecognizer::kByteArrayBaseGetInt16: | 1483 case MethodRecognizer::kByteArrayBaseGetInt16: |
| 1482 array_op = BuildByteArrayViewLoad(call, class_ids[0], kInt16ArrayCid); | 1484 array_op = BuildByteArrayViewLoad(call, class_ids[0], kInt16ArrayCid); |
| (...skipping 3194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4677 | 4679 |
| 4678 if (FLAG_trace_constant_propagation) { | 4680 if (FLAG_trace_constant_propagation) { |
| 4679 OS::Print("\n==== After constant propagation ====\n"); | 4681 OS::Print("\n==== After constant propagation ====\n"); |
| 4680 FlowGraphPrinter printer(*graph_); | 4682 FlowGraphPrinter printer(*graph_); |
| 4681 printer.PrintBlocks(); | 4683 printer.PrintBlocks(); |
| 4682 } | 4684 } |
| 4683 } | 4685 } |
| 4684 | 4686 |
| 4685 | 4687 |
| 4686 } // namespace dart | 4688 } // namespace dart |
| OLD | NEW |