OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 case kTypedDataInt8ArrayCid: | 713 case kTypedDataInt8ArrayCid: |
714 case kExternalOneByteStringCid: | 714 case kExternalOneByteStringCid: |
715 case kExternalTypedDataUint8ArrayCid: | 715 case kExternalTypedDataUint8ArrayCid: |
716 ASSERT(index_scale() == 1); | 716 ASSERT(index_scale() == 1); |
717 if (IsExternal()) { | 717 if (IsExternal()) { |
718 __ StoreIndexedExternalUint8(array, index, value); | 718 __ StoreIndexedExternalUint8(array, index, value); |
719 } else { | 719 } else { |
720 __ StoreIndexedUint8(array, index, value); | 720 __ StoreIndexedUint8(array, index, value); |
721 } | 721 } |
722 break; | 722 break; |
| 723 case kOneByteStringCid: |
| 724 ASSERT(index_scale() == 1); |
| 725 __ StoreIndexedOneByteString(array, index, value); |
| 726 break; |
723 case kTypedDataInt32ArrayCid: | 727 case kTypedDataInt32ArrayCid: |
724 case kTypedDataUint32ArrayCid: { | 728 case kTypedDataUint32ArrayCid: { |
725 if (IsExternal()) { | 729 if (IsExternal()) { |
726 Unsupported(compiler); | 730 Unsupported(compiler); |
727 UNREACHABLE(); | 731 UNREACHABLE(); |
728 } | 732 } |
729 if (index_scale() == 1) { | 733 if (index_scale() == 1) { |
730 __ StoreIndexedUint32(array, index, value); | 734 __ StoreIndexedUint32(array, index, value); |
731 } else { | 735 } else { |
732 __ ShlImm(temp, index, Utils::ShiftForPowerOfTwo(index_scale())); | 736 __ ShlImm(temp, index, Utils::ShiftForPowerOfTwo(index_scale())); |
(...skipping 25 matching lines...) Expand all Loading... |
758 | 762 |
759 EMIT_NATIVE_CODE(LoadIndexed, 2, Location::RequiresRegister(), | 763 EMIT_NATIVE_CODE(LoadIndexed, 2, Location::RequiresRegister(), |
760 LocationSummary::kNoCall, 1) { | 764 LocationSummary::kNoCall, 1) { |
761 ASSERT(compiler->is_optimizing()); | 765 ASSERT(compiler->is_optimizing()); |
762 const Register array = locs()->in(0).reg(); | 766 const Register array = locs()->in(0).reg(); |
763 const Register index = locs()->in(1).reg(); | 767 const Register index = locs()->in(1).reg(); |
764 const Register temp = locs()->temp(0).reg(); | 768 const Register temp = locs()->temp(0).reg(); |
765 const Register result = locs()->out(0).reg(); | 769 const Register result = locs()->out(0).reg(); |
766 switch (class_id()) { | 770 switch (class_id()) { |
767 case kArrayCid: | 771 case kArrayCid: |
| 772 case kImmutableArrayCid: |
768 __ LoadIndexed(result, array, index); | 773 __ LoadIndexed(result, array, index); |
769 break; | 774 break; |
770 case kTypedDataUint8ArrayCid: | 775 case kTypedDataUint8ArrayCid: |
771 case kTypedDataUint8ClampedArrayCid: | 776 case kTypedDataUint8ClampedArrayCid: |
772 case kExternalOneByteStringCid: | 777 case kExternalOneByteStringCid: |
773 case kExternalTypedDataUint8ArrayCid: | 778 case kExternalTypedDataUint8ArrayCid: |
774 case kExternalTypedDataUint8ClampedArrayCid: | 779 case kExternalTypedDataUint8ClampedArrayCid: |
775 ASSERT(index_scale() == 1); | 780 ASSERT(index_scale() == 1); |
776 if (IsExternal()) { | 781 if (IsExternal()) { |
777 __ LoadIndexedExternalUint8(result, array, index); | 782 __ LoadIndexedExternalUint8(result, array, index); |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 __ IfULe(length, index); | 1743 __ IfULe(length, index); |
1739 compiler->EmitDeopt(deopt_id(), | 1744 compiler->EmitDeopt(deopt_id(), |
1740 ICData::kDeoptCheckArrayBound, | 1745 ICData::kDeoptCheckArrayBound, |
1741 (generalized_ ? ICData::kGeneralized : 0) | | 1746 (generalized_ ? ICData::kGeneralized : 0) | |
1742 (licm_hoisted_ ? ICData::kHoisted : 0)); | 1747 (licm_hoisted_ ? ICData::kHoisted : 0)); |
1743 } | 1748 } |
1744 | 1749 |
1745 } // namespace dart | 1750 } // namespace dart |
1746 | 1751 |
1747 #endif // defined TARGET_ARCH_DBC | 1752 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |