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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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, 7 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_arm64.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | 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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 } else { 1111 } else {
1112 return FieldAddress(array, 1112 return FieldAddress(array,
1113 index, 1113 index,
1114 ToScaleFactor(index_scale), 1114 ToScaleFactor(index_scale),
1115 Instance::DataOffsetFor(cid)); 1115 Instance::DataOffsetFor(cid));
1116 } 1116 }
1117 } 1117 }
1118 1118
1119 1119
1120 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1120 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1121 Register array = locs()->in(0).reg(); 1121 // The array register points to the backing store for external arrays.
1122 Location index = locs()->in(1); 1122 const Register array = locs()->in(0).reg();
1123 const Location index = locs()->in(1);
1123 1124
1124 Address element_address(kNoRegister, 0); 1125 Address element_address = index.IsRegister()
1125 element_address = index.IsRegister()
1126 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(), 1126 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(),
1127 array, index.reg()) 1127 array, index.reg())
1128 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), 1128 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(),
1129 array, Smi::Cast(index.constant()).Value()); 1129 array, Smi::Cast(index.constant()).Value());
1130 1130
1131 if ((representation() == kUnboxedDouble) || 1131 if ((representation() == kUnboxedDouble) ||
1132 (representation() == kUnboxedFloat32x4) || 1132 (representation() == kUnboxedFloat32x4) ||
1133 (representation() == kUnboxedInt32x4) || 1133 (representation() == kUnboxedInt32x4) ||
1134 (representation() == kUnboxedFloat64x2)) { 1134 (representation() == kUnboxedFloat64x2)) {
1135 XmmRegister result = locs()->out(0).fpu_reg(); 1135 XmmRegister result = locs()->out(0).fpu_reg();
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 break; 1336 break;
1337 default: 1337 default:
1338 UNREACHABLE(); 1338 UNREACHABLE();
1339 return NULL; 1339 return NULL;
1340 } 1340 }
1341 return locs; 1341 return locs;
1342 } 1342 }
1343 1343
1344 1344
1345 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1345 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1346 Register array = locs()->in(0).reg(); 1346 // The array register points to the backing store for external arrays.
1347 Location index = locs()->in(1); 1347 const Register array = locs()->in(0).reg();
1348 const Location index = locs()->in(1);
1348 1349
1349 Address element_address(kNoRegister, 0); 1350 Address element_address = index.IsRegister()
1350 element_address = index.IsRegister()
1351 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(), 1351 ? ElementAddressForRegIndex(IsExternal(), class_id(), index_scale(),
1352 array, index.reg()) 1352 array, index.reg())
1353 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), 1353 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(),
1354 array, Smi::Cast(index.constant()).Value()); 1354 array, Smi::Cast(index.constant()).Value());
1355 1355
1356 if ((index_scale() == 1) && index.IsRegister()) { 1356 if ((index_scale() == 1) && index.IsRegister()) {
1357 __ SmiUntag(index.reg()); 1357 __ SmiUntag(index.reg());
1358 } 1358 }
1359 switch (class_id()) { 1359 switch (class_id()) {
1360 case kArrayCid: 1360 case kArrayCid:
(...skipping 5022 matching lines...) Expand 10 before | Expand all | Expand 10 after
6383 PcDescriptors::kOther, 6383 PcDescriptors::kOther,
6384 locs()); 6384 locs());
6385 __ Drop(ArgumentCount()); // Discard arguments. 6385 __ Drop(ArgumentCount()); // Discard arguments.
6386 } 6386 }
6387 6387
6388 } // namespace dart 6388 } // namespace dart
6389 6389
6390 #undef __ 6390 #undef __
6391 6391
6392 #endif // defined TARGET_ARCH_IA32 6392 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698