Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: runtime/vm/intermediate_language_x64.cc

Issue 300143007: Generate better ARM64 code for indexed loads and stores. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 } else { 1024 } else {
1025 return FieldAddress(array, 1025 return FieldAddress(array,
1026 index, 1026 index,
1027 ToScaleFactor(index_scale), 1027 ToScaleFactor(index_scale),
1028 Instance::DataOffsetFor(cid)); 1028 Instance::DataOffsetFor(cid));
1029 } 1029 }
1030 } 1030 }
1031 1031
1032 1032
1033 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1033 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1034 Register array = locs()->in(0).reg(); 1034 // The array register points to the backing store for external arrays.
1035 Location index = locs()->in(1); 1035 const Register array = locs()->in(0).reg();
1036 const Location index = locs()->in(1);
1036 1037
1037 Address element_address(kNoRegister, 0); 1038 Address element_address = index.IsRegister()
1038 element_address = index.IsRegister()
1039 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(), 1039 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(),
1040 array, index.reg()) 1040 array, index.reg())
1041 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), 1041 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(),
1042 array, Smi::Cast(index.constant()).Value()); 1042 array, Smi::Cast(index.constant()).Value());
1043 1043
1044 if ((representation() == kUnboxedDouble) || 1044 if ((representation() == kUnboxedDouble) ||
1045 (representation() == kUnboxedFloat32x4) || 1045 (representation() == kUnboxedFloat32x4) ||
1046 (representation() == kUnboxedInt32x4) || 1046 (representation() == kUnboxedInt32x4) ||
1047 (representation() == kUnboxedFloat64x2)) { 1047 (representation() == kUnboxedFloat64x2)) {
1048 if ((index_scale() == 1) && index.IsRegister()) { 1048 if ((index_scale() == 1) && index.IsRegister()) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 break; 1195 break;
1196 default: 1196 default:
1197 UNREACHABLE(); 1197 UNREACHABLE();
1198 return NULL; 1198 return NULL;
1199 } 1199 }
1200 return locs; 1200 return locs;
1201 } 1201 }
1202 1202
1203 1203
1204 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1204 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1205 Register array = locs()->in(0).reg(); 1205 // The array register points to the backing store for external arrays.
1206 Location index = locs()->in(1); 1206 const Register array = locs()->in(0).reg();
1207 const Location index = locs()->in(1);
1207 1208
1208 Address element_address(kNoRegister, 0); 1209 Address element_address = index.IsRegister()
1209 element_address = index.IsRegister()
1210 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(), 1210 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(),
1211 array, index.reg()) 1211 array, index.reg())
1212 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), 1212 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(),
1213 array, Smi::Cast(index.constant()).Value()); 1213 array, Smi::Cast(index.constant()).Value());
1214 1214
1215 if ((index_scale() == 1) && index.IsRegister()) { 1215 if ((index_scale() == 1) && index.IsRegister()) {
1216 __ SmiUntag(index.reg()); 1216 __ SmiUntag(index.reg());
1217 } 1217 }
1218 switch (class_id()) { 1218 switch (class_id()) {
1219 case kArrayCid: 1219 case kArrayCid:
(...skipping 4702 matching lines...) Expand 10 before | Expand all | Expand 10 after
5922 PcDescriptors::kOther, 5922 PcDescriptors::kOther,
5923 locs()); 5923 locs());
5924 __ Drop(ArgumentCount()); // Discard arguments. 5924 __ Drop(ArgumentCount()); // Discard arguments.
5925 } 5925 }
5926 5926
5927 } // namespace dart 5927 } // namespace dart
5928 5928
5929 #undef __ 5929 #undef __
5930 5930
5931 #endif // defined TARGET_ARCH_X64 5931 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698