| 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/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 Register result = locs()->out().reg(); | 1038 Register result = locs()->out().reg(); |
| 1039 Address element_address = index.IsRegister() | 1039 Address element_address = index.IsRegister() |
| 1040 ? FlowGraphCompiler::ExternalElementAddressForRegIndex( | 1040 ? FlowGraphCompiler::ExternalElementAddressForRegIndex( |
| 1041 class_id(), result, index.reg()) | 1041 class_id(), result, index.reg()) |
| 1042 : FlowGraphCompiler::ExternalElementAddressForIntIndex( | 1042 : FlowGraphCompiler::ExternalElementAddressForIntIndex( |
| 1043 class_id(), result, Smi::Cast(index.constant()).Value()); | 1043 class_id(), result, Smi::Cast(index.constant()).Value()); |
| 1044 if (index.IsRegister()) { | 1044 if (index.IsRegister()) { |
| 1045 __ SmiUntag(index.reg()); | 1045 __ SmiUntag(index.reg()); |
| 1046 } | 1046 } |
| 1047 __ movq(result, | 1047 __ movq(result, |
| 1048 FieldAddress(array, ExternalUint8Array::external_data_offset())); | 1048 FieldAddress(array, ExternalUint8Array::data_offset())); |
| 1049 __ movq(result, | |
| 1050 Address(result, ExternalByteArrayData<uint8_t>::data_offset())); | |
| 1051 __ movzxb(result, element_address); | 1049 __ movzxb(result, element_address); |
| 1052 __ SmiTag(result); | 1050 __ SmiTag(result); |
| 1053 if (index.IsRegister()) { | 1051 if (index.IsRegister()) { |
| 1054 __ SmiTag(index.reg()); // Re-tag. | 1052 __ SmiTag(index.reg()); // Re-tag. |
| 1055 } | 1053 } |
| 1056 return; | 1054 return; |
| 1057 } | 1055 } |
| 1058 | 1056 |
| 1059 FieldAddress element_address = index.IsRegister() ? | 1057 FieldAddress element_address = index.IsRegister() ? |
| 1060 FlowGraphCompiler::ElementAddressForRegIndex( | 1058 FlowGraphCompiler::ElementAddressForRegIndex( |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2994 PcDescriptors::kOther, | 2992 PcDescriptors::kOther, |
| 2995 locs()); | 2993 locs()); |
| 2996 __ Drop(2); // Discard type arguments and receiver. | 2994 __ Drop(2); // Discard type arguments and receiver. |
| 2997 } | 2995 } |
| 2998 | 2996 |
| 2999 } // namespace dart | 2997 } // namespace dart |
| 3000 | 2998 |
| 3001 #undef __ | 2999 #undef __ |
| 3002 | 3000 |
| 3003 #endif // defined TARGET_ARCH_X64 | 3001 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |