| 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 "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 bool opt) const { | 882 bool opt) const { |
| 883 const intptr_t kNumInputs = 1; | 883 const intptr_t kNumInputs = 1; |
| 884 return LocationSummary::Make(isolate, | 884 return LocationSummary::Make(isolate, |
| 885 kNumInputs, | 885 kNumInputs, |
| 886 Location::RequiresRegister(), | 886 Location::RequiresRegister(), |
| 887 LocationSummary::kNoCall); | 887 LocationSummary::kNoCall); |
| 888 } | 888 } |
| 889 | 889 |
| 890 | 890 |
| 891 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 891 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 892 Register object = locs()->in(0).reg(); | 892 Register obj = locs()->in(0).reg(); |
| 893 Register result = locs()->out(0).reg(); | 893 Register result = locs()->out(0).reg(); |
| 894 __ movq(result, FieldAddress(object, offset())); | 894 if (object()->definition()->representation() == kUntagged) { |
| 895 __ movq(result, Address(obj, offset())); |
| 896 } else { |
| 897 ASSERT(object()->definition()->representation() == kTagged); |
| 898 __ movq(result, FieldAddress(obj, offset())); |
| 899 } |
| 895 } | 900 } |
| 896 | 901 |
| 897 | 902 |
| 898 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, | 903 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, |
| 899 bool opt) const { | 904 bool opt) const { |
| 900 const intptr_t kNumInputs = 1; | 905 const intptr_t kNumInputs = 1; |
| 901 return LocationSummary::Make(isolate, | 906 return LocationSummary::Make(isolate, |
| 902 kNumInputs, | 907 kNumInputs, |
| 903 Location::RequiresRegister(), | 908 Location::RequiresRegister(), |
| 904 LocationSummary::kNoCall); | 909 LocationSummary::kNoCall); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 // The smi index is either untagged (element size == 1), or it is left smi | 1146 // The smi index is either untagged (element size == 1), or it is left smi |
| 1142 // tagged (for all element sizes > 1). | 1147 // tagged (for all element sizes > 1). |
| 1143 summary->set_in(1, index_scale() == 1 ? Location::WritableRegister() | 1148 summary->set_in(1, index_scale() == 1 ? Location::WritableRegister() |
| 1144 : Location::RequiresRegister()); | 1149 : Location::RequiresRegister()); |
| 1145 summary->set_out(0, Location::RequiresRegister()); | 1150 summary->set_out(0, Location::RequiresRegister()); |
| 1146 return summary; | 1151 return summary; |
| 1147 } | 1152 } |
| 1148 | 1153 |
| 1149 | 1154 |
| 1150 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1155 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1151 const Register array = locs()->in(0).reg(); | 1156 // The string register points to the backing store for external strings. |
| 1157 const Register str = locs()->in(0).reg(); |
| 1152 const Location index = locs()->in(1); | 1158 const Location index = locs()->in(1); |
| 1153 | 1159 |
| 1154 Address element_address = Assembler::ElementAddressForRegIndex( | 1160 Address element_address = Assembler::ElementAddressForRegIndex( |
| 1155 IsExternal(), class_id(), index_scale(), array, index.reg()); | 1161 IsExternal(), class_id(), index_scale(), str, index.reg()); |
| 1156 | 1162 |
| 1157 if ((index_scale() == 1)) { | 1163 if ((index_scale() == 1)) { |
| 1158 __ SmiUntag(index.reg()); | 1164 __ SmiUntag(index.reg()); |
| 1159 } | 1165 } |
| 1160 Register result = locs()->out(0).reg(); | 1166 Register result = locs()->out(0).reg(); |
| 1161 switch (class_id()) { | 1167 switch (class_id()) { |
| 1162 case kOneByteStringCid: | 1168 case kOneByteStringCid: |
| 1163 case kExternalOneByteStringCid: | 1169 case kExternalOneByteStringCid: |
| 1164 switch (element_count()) { | 1170 switch (element_count()) { |
| 1165 case 1: __ movzxb(result, element_address); break; | 1171 case 1: __ movzxb(result, element_address); break; |
| (...skipping 5218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6384 __ movq(R10, Immediate(kInvalidObjectPointer)); | 6390 __ movq(R10, Immediate(kInvalidObjectPointer)); |
| 6385 __ movq(RBX, Immediate(kInvalidObjectPointer)); | 6391 __ movq(RBX, Immediate(kInvalidObjectPointer)); |
| 6386 #endif | 6392 #endif |
| 6387 } | 6393 } |
| 6388 | 6394 |
| 6389 } // namespace dart | 6395 } // namespace dart |
| 6390 | 6396 |
| 6391 #undef __ | 6397 #undef __ |
| 6392 | 6398 |
| 6393 #endif // defined TARGET_ARCH_X64 | 6399 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |