OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 const Register array = locs()->in(0).reg(); | 1003 const Register array = locs()->in(0).reg(); |
1004 ASSERT(locs()->in(1).IsRegister()); // TODO(regis): Revisit. | 1004 ASSERT(locs()->in(1).IsRegister()); // TODO(regis): Revisit. |
1005 const Register index = locs()->in(1).reg(); | 1005 const Register index = locs()->in(1).reg(); |
1006 | 1006 |
1007 Address element_address(kNoRegister, 0); | 1007 Address element_address(kNoRegister, 0); |
1008 | 1008 |
1009 // The array register points to the backing store for external arrays. | 1009 // The array register points to the backing store for external arrays. |
1010 intptr_t offset = 0; | 1010 intptr_t offset = 0; |
1011 if (!IsExternal()) { | 1011 if (!IsExternal()) { |
1012 ASSERT(this->array()->definition()->representation() == kTagged); | 1012 ASSERT(this->array()->definition()->representation() == kTagged); |
1013 offset = FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag; | 1013 offset = Instance::DataOffsetFor(class_id()) - kHeapObjectTag; |
1014 } | 1014 } |
1015 | 1015 |
1016 // Note that index is expected smi-tagged, (i.e, times 2) for all arrays | 1016 // Note that index is expected smi-tagged, (i.e, times 2) for all arrays |
1017 // with index scale factor > 1. E.g., for Uint8Array and OneByteString the | 1017 // with index scale factor > 1. E.g., for Uint8Array and OneByteString the |
1018 // index is expected to be untagged before accessing. | 1018 // index is expected to be untagged before accessing. |
1019 ASSERT(kSmiTagShift == 1); | 1019 ASSERT(kSmiTagShift == 1); |
1020 switch (index_scale()) { | 1020 switch (index_scale()) { |
1021 case 1: | 1021 case 1: |
1022 __ add(index, array, Operand(index, ASR, kSmiTagSize)); | 1022 __ add(index, array, Operand(index, ASR, kSmiTagSize)); |
1023 element_address = Address(index, offset); | 1023 element_address = Address(index, offset); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 const Register array = locs()->in(0).reg(); | 1197 const Register array = locs()->in(0).reg(); |
1198 ASSERT(locs()->in(1).IsRegister()); // TODO(regis): Revisit. | 1198 ASSERT(locs()->in(1).IsRegister()); // TODO(regis): Revisit. |
1199 const Register index = locs()->in(1).reg(); | 1199 const Register index = locs()->in(1).reg(); |
1200 | 1200 |
1201 Address element_address(kNoRegister, 0); | 1201 Address element_address(kNoRegister, 0); |
1202 | 1202 |
1203 // The array register points to the backing store for external arrays. | 1203 // The array register points to the backing store for external arrays. |
1204 intptr_t offset = 0; | 1204 intptr_t offset = 0; |
1205 if (!IsExternal()) { | 1205 if (!IsExternal()) { |
1206 ASSERT(this->array()->definition()->representation() == kTagged); | 1206 ASSERT(this->array()->definition()->representation() == kTagged); |
1207 offset = FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag; | 1207 offset = Instance::DataOffsetFor(class_id()) - kHeapObjectTag; |
1208 } | 1208 } |
1209 | 1209 |
1210 // Note that index is expected smi-tagged, (i.e, times 2) for all arrays | 1210 // Note that index is expected smi-tagged, (i.e, times 2) for all arrays |
1211 // with index scale factor > 1. E.g., for Uint8Array and OneByteString the | 1211 // with index scale factor > 1. E.g., for Uint8Array and OneByteString the |
1212 // index is expected to be untagged before accessing. | 1212 // index is expected to be untagged before accessing. |
1213 ASSERT(kSmiTagShift == 1); | 1213 ASSERT(kSmiTagShift == 1); |
1214 switch (index_scale()) { | 1214 switch (index_scale()) { |
1215 case 1: { | 1215 case 1: { |
1216 __ add(index, array, Operand(index, ASR, kSmiTagSize)); | 1216 __ add(index, array, Operand(index, ASR, kSmiTagSize)); |
1217 element_address = Address(index, offset); | 1217 element_address = Address(index, offset); |
(...skipping 3709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4927 compiler->GenerateCall(token_pos(), | 4927 compiler->GenerateCall(token_pos(), |
4928 &label, | 4928 &label, |
4929 PcDescriptors::kOther, | 4929 PcDescriptors::kOther, |
4930 locs()); | 4930 locs()); |
4931 __ Drop(ArgumentCount()); // Discard arguments. | 4931 __ Drop(ArgumentCount()); // Discard arguments. |
4932 } | 4932 } |
4933 | 4933 |
4934 } // namespace dart | 4934 } // namespace dart |
4935 | 4935 |
4936 #endif // defined TARGET_ARCH_ARM64 | 4936 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |