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

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

Issue 290993007: Cross-platform cleanup in preparation of better ARM code for indexed load/store. (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/flow_graph_compiler.h ('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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 } 1027 }
1028 1028
1029 1029
1030 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1030 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1031 Register array = locs()->in(0).reg(); 1031 Register array = locs()->in(0).reg();
1032 Location index = locs()->in(1); 1032 Location index = locs()->in(1);
1033 1033
1034 Address element_address(kNoRegister, 0); 1034 Address element_address(kNoRegister, 0);
1035 if (IsExternal()) { 1035 if (IsExternal()) {
1036 element_address = index.IsRegister() 1036 element_address = index.IsRegister()
1037 ? FlowGraphCompiler::ExternalElementAddressForRegIndex( 1037 ? compiler->ExternalElementAddressForRegIndex(
1038 index_scale(), array, index.reg()) 1038 index_scale(), array, index.reg())
1039 : FlowGraphCompiler::ExternalElementAddressForIntIndex( 1039 : compiler->ExternalElementAddressForIntIndex(
1040 index_scale(), array, Smi::Cast(index.constant()).Value()); 1040 index_scale(), array, Smi::Cast(index.constant()).Value());
1041 } else { 1041 } else {
1042 ASSERT(this->array()->definition()->representation() == kTagged); 1042 ASSERT(this->array()->definition()->representation() == kTagged);
1043 element_address = index.IsRegister() 1043 element_address = index.IsRegister()
1044 ? FlowGraphCompiler::ElementAddressForRegIndex( 1044 ? compiler->ElementAddressForRegIndex(
1045 class_id(), index_scale(), array, index.reg()) 1045 class_id(), index_scale(), array, index.reg())
1046 : FlowGraphCompiler::ElementAddressForIntIndex( 1046 : compiler->ElementAddressForIntIndex(
1047 class_id(), index_scale(), array, 1047 class_id(), index_scale(), array,
1048 Smi::Cast(index.constant()).Value()); 1048 Smi::Cast(index.constant()).Value());
1049 } 1049 }
1050 1050
1051 if ((representation() == kUnboxedDouble) || 1051 if ((representation() == kUnboxedDouble) ||
1052 (representation() == kUnboxedMint) || 1052 (representation() == kUnboxedMint) ||
1053 (representation() == kUnboxedFloat32x4) || 1053 (representation() == kUnboxedFloat32x4) ||
1054 (representation() == kUnboxedInt32x4) || 1054 (representation() == kUnboxedInt32x4) ||
1055 (representation() == kUnboxedFloat64x2)) { 1055 (representation() == kUnboxedFloat64x2)) {
1056 XmmRegister result = locs()->out(0).fpu_reg(); 1056 XmmRegister result = locs()->out(0).fpu_reg();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 } 1236 }
1237 1237
1238 1238
1239 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1239 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1240 Register array = locs()->in(0).reg(); 1240 Register array = locs()->in(0).reg();
1241 Location index = locs()->in(1); 1241 Location index = locs()->in(1);
1242 1242
1243 Address element_address(kNoRegister, 0); 1243 Address element_address(kNoRegister, 0);
1244 if (IsExternal()) { 1244 if (IsExternal()) {
1245 element_address = index.IsRegister() 1245 element_address = index.IsRegister()
1246 ? FlowGraphCompiler::ExternalElementAddressForRegIndex( 1246 ? compiler->ExternalElementAddressForRegIndex(
1247 index_scale(), array, index.reg()) 1247 index_scale(), array, index.reg())
1248 : FlowGraphCompiler::ExternalElementAddressForIntIndex( 1248 : compiler->ExternalElementAddressForIntIndex(
1249 index_scale(), array, Smi::Cast(index.constant()).Value()); 1249 index_scale(), array, Smi::Cast(index.constant()).Value());
1250 } else { 1250 } else {
1251 ASSERT(this->array()->definition()->representation() == kTagged); 1251 ASSERT(this->array()->definition()->representation() == kTagged);
1252 element_address = index.IsRegister() 1252 element_address = index.IsRegister()
1253 ? FlowGraphCompiler::ElementAddressForRegIndex( 1253 ? compiler->ElementAddressForRegIndex(
1254 class_id(), index_scale(), array, index.reg()) 1254 class_id(), index_scale(), array, index.reg())
1255 : FlowGraphCompiler::ElementAddressForIntIndex( 1255 : compiler->ElementAddressForIntIndex(
1256 class_id(), index_scale(), array, 1256 class_id(), index_scale(), array,
1257 Smi::Cast(index.constant()).Value()); 1257 Smi::Cast(index.constant()).Value());
1258 } 1258 }
1259 1259
1260 if ((index_scale() == 1) && index.IsRegister()) { 1260 if ((index_scale() == 1) && index.IsRegister()) {
1261 __ SmiUntag(index.reg()); 1261 __ SmiUntag(index.reg());
1262 } 1262 }
1263 switch (class_id()) { 1263 switch (class_id()) {
1264 case kArrayCid: 1264 case kArrayCid:
1265 if (ShouldEmitStoreBarrier()) { 1265 if (ShouldEmitStoreBarrier()) {
(...skipping 4926 matching lines...) Expand 10 before | Expand all | Expand 10 after
6192 PcDescriptors::kOther, 6192 PcDescriptors::kOther,
6193 locs()); 6193 locs());
6194 __ Drop(ArgumentCount()); // Discard arguments. 6194 __ Drop(ArgumentCount()); // Discard arguments.
6195 } 6195 }
6196 6196
6197 } // namespace dart 6197 } // namespace dart
6198 6198
6199 #undef __ 6199 #undef __
6200 6200
6201 #endif // defined TARGET_ARCH_IA32 6201 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698