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

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

Issue 294223003: Last cross-platform cleanup in preparation of improved ARM code for indexed (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
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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 locs->set_out(0, Location::RequiresRegister()); 948 locs->set_out(0, Location::RequiresRegister());
949 } 949 }
950 return locs; 950 return locs;
951 } 951 }
952 952
953 953
954 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 954 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
955 Register array = locs()->in(0).reg(); 955 Register array = locs()->in(0).reg();
956 Location index = locs()->in(1); 956 Location index = locs()->in(1);
957 957
958 const bool is_external =
959 (this->array()->definition()->representation() == kUntagged);
960 Address element_address(kNoRegister, 0); 958 Address element_address(kNoRegister, 0);
961 959 element_address = index.IsRegister()
962 if (is_external) { 960 ? compiler->ElementAddressForRegIndex(
963 element_address = index.IsRegister() 961 true, // Load.
964 ? compiler->ExternalElementAddressForRegIndex( 962 IsExternal(), class_id(), index_scale(), array, index.reg())
965 index_scale(), array, index.reg()) 963 : compiler->ElementAddressForIntIndex(
966 : compiler->ExternalElementAddressForIntIndex( 964 true, // Load.
967 index_scale(), array, Smi::Cast(index.constant()).Value()); 965 IsExternal(), class_id(), index_scale(), array,
968 } else { 966 Smi::Cast(index.constant()).Value());
969 ASSERT(this->array()->definition()->representation() == kTagged);
970 element_address = index.IsRegister()
971 ? compiler->ElementAddressForRegIndex(
972 class_id(), index_scale(), array, index.reg())
973 : compiler->ElementAddressForIntIndex(
974 class_id(), index_scale(), array,
975 Smi::Cast(index.constant()).Value());
976 }
977 967
978 if ((representation() == kUnboxedDouble) || 968 if ((representation() == kUnboxedDouble) ||
979 (representation() == kUnboxedFloat32x4) || 969 (representation() == kUnboxedFloat32x4) ||
980 (representation() == kUnboxedInt32x4) || 970 (representation() == kUnboxedInt32x4) ||
981 (representation() == kUnboxedFloat64x2)) { 971 (representation() == kUnboxedFloat64x2)) {
982 if ((index_scale() == 1) && index.IsRegister()) { 972 if ((index_scale() == 1) && index.IsRegister()) {
983 __ SmiUntag(index.reg()); 973 __ SmiUntag(index.reg());
984 } 974 }
985 975
986 XmmRegister result = locs()->out(0).fpu_reg(); 976 XmmRegister result = locs()->out(0).fpu_reg();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 return NULL; 1121 return NULL;
1132 } 1122 }
1133 return locs; 1123 return locs;
1134 } 1124 }
1135 1125
1136 1126
1137 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1127 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1138 Register array = locs()->in(0).reg(); 1128 Register array = locs()->in(0).reg();
1139 Location index = locs()->in(1); 1129 Location index = locs()->in(1);
1140 1130
1141 const bool is_external =
1142 (this->array()->definition()->representation() == kUntagged);
1143 Address element_address(kNoRegister, 0); 1131 Address element_address(kNoRegister, 0);
1144 if (is_external) { 1132 element_address = index.IsRegister()
1145 element_address = index.IsRegister() 1133 ? compiler->ElementAddressForRegIndex(
1146 ? compiler->ExternalElementAddressForRegIndex( 1134 false, // Store.
1147 index_scale(), array, index.reg()) 1135 IsExternal(), class_id(), index_scale(), array, index.reg())
1148 : compiler->ExternalElementAddressForIntIndex( 1136 : compiler->ElementAddressForIntIndex(
1149 index_scale(), array, Smi::Cast(index.constant()).Value()); 1137 false, // Store.
1150 } else { 1138 IsExternal(), class_id(), index_scale(), array,
1151 ASSERT(this->array()->definition()->representation() == kTagged); 1139 Smi::Cast(index.constant()).Value());
1152 element_address = index.IsRegister()
1153 ? compiler->ElementAddressForRegIndex(
1154 class_id(), index_scale(), array, index.reg())
1155 : compiler->ElementAddressForIntIndex(
1156 class_id(), index_scale(), array,
1157 Smi::Cast(index.constant()).Value());
1158 }
1159 1140
1160 if ((index_scale() == 1) && index.IsRegister()) { 1141 if ((index_scale() == 1) && index.IsRegister()) {
1161 __ SmiUntag(index.reg()); 1142 __ SmiUntag(index.reg());
1162 } 1143 }
1163 switch (class_id()) { 1144 switch (class_id()) {
1164 case kArrayCid: 1145 case kArrayCid:
1165 if (ShouldEmitStoreBarrier()) { 1146 if (ShouldEmitStoreBarrier()) {
1166 Register value = locs()->in(2).reg(); 1147 Register value = locs()->in(2).reg();
1167 __ StoreIntoObject(array, element_address, value); 1148 __ StoreIntoObject(array, element_address, value);
1168 } else if (locs()->in(2).IsConstant()) { 1149 } else if (locs()->in(2).IsConstant()) {
(...skipping 4613 matching lines...) Expand 10 before | Expand all | Expand 10 after
5782 PcDescriptors::kOther, 5763 PcDescriptors::kOther,
5783 locs()); 5764 locs());
5784 __ Drop(ArgumentCount()); // Discard arguments. 5765 __ Drop(ArgumentCount()); // Discard arguments.
5785 } 5766 }
5786 5767
5787 } // namespace dart 5768 } // namespace dart
5788 5769
5789 #undef __ 5770 #undef __
5790 5771
5791 #endif // defined TARGET_ARCH_X64 5772 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/flow_graph_compiler_ia32.cc ('K') | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698