| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 bool opt) const { | 896 bool opt) const { |
| 897 const intptr_t kNumInputs = 1; | 897 const intptr_t kNumInputs = 1; |
| 898 return LocationSummary::Make(isolate, | 898 return LocationSummary::Make(isolate, |
| 899 kNumInputs, | 899 kNumInputs, |
| 900 Location::RequiresRegister(), | 900 Location::RequiresRegister(), |
| 901 LocationSummary::kNoCall); | 901 LocationSummary::kNoCall); |
| 902 } | 902 } |
| 903 | 903 |
| 904 | 904 |
| 905 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 905 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 906 const Register object = locs()->in(0).reg(); | 906 const Register obj = locs()->in(0).reg(); |
| 907 const Register result = locs()->out(0).reg(); | 907 const Register result = locs()->out(0).reg(); |
| 908 __ LoadFieldFromOffset(result, object, offset(), PP); | 908 if (object()->definition()->representation() == kUntagged) { |
| 909 __ LoadFromOffset(result, obj, offset(), PP); |
| 910 } else { |
| 911 ASSERT(object()->definition()->representation() == kTagged); |
| 912 __ LoadFieldFromOffset(result, obj, offset(), PP); |
| 913 } |
| 909 } | 914 } |
| 910 | 915 |
| 911 | 916 |
| 912 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, | 917 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, |
| 913 bool opt) const { | 918 bool opt) const { |
| 914 const intptr_t kNumInputs = 1; | 919 const intptr_t kNumInputs = 1; |
| 915 return LocationSummary::Make(isolate, | 920 return LocationSummary::Make(isolate, |
| 916 kNumInputs, | 921 kNumInputs, |
| 917 Location::RequiresRegister(), | 922 Location::RequiresRegister(), |
| 918 LocationSummary::kNoCall); | 923 LocationSummary::kNoCall); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 LocationSummary* summary = new(isolate) LocationSummary( | 1147 LocationSummary* summary = new(isolate) LocationSummary( |
| 1143 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1148 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1144 summary->set_in(0, Location::RequiresRegister()); | 1149 summary->set_in(0, Location::RequiresRegister()); |
| 1145 summary->set_in(1, Location::RequiresRegister()); | 1150 summary->set_in(1, Location::RequiresRegister()); |
| 1146 summary->set_out(0, Location::RequiresRegister()); | 1151 summary->set_out(0, Location::RequiresRegister()); |
| 1147 return summary; | 1152 return summary; |
| 1148 } | 1153 } |
| 1149 | 1154 |
| 1150 | 1155 |
| 1151 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1156 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1152 const Register array = locs()->in(0).reg(); | 1157 // The string register points to the backing store for external strings. |
| 1158 const Register str = locs()->in(0).reg(); |
| 1153 const Location index = locs()->in(1); | 1159 const Location index = locs()->in(1); |
| 1154 | 1160 |
| 1155 Address element_address = __ ElementAddressForRegIndex( | 1161 Address element_address = __ ElementAddressForRegIndex( |
| 1156 true, IsExternal(), class_id(), index_scale(), array, index.reg()); | 1162 true, IsExternal(), class_id(), index_scale(), str, index.reg()); |
| 1157 // Warning: element_address may use register TMP as base. | 1163 // Warning: element_address may use register TMP as base. |
| 1158 | 1164 |
| 1159 Register result = locs()->out(0).reg(); | 1165 Register result = locs()->out(0).reg(); |
| 1160 switch (class_id()) { | 1166 switch (class_id()) { |
| 1161 case kOneByteStringCid: | 1167 case kOneByteStringCid: |
| 1162 case kExternalOneByteStringCid: | 1168 case kExternalOneByteStringCid: |
| 1163 switch (element_count()) { | 1169 switch (element_count()) { |
| 1164 case 1: __ ldr(result, element_address, kUnsignedByte); break; | 1170 case 1: __ ldr(result, element_address, kUnsignedByte); break; |
| 1165 case 2: __ ldr(result, element_address, kUnsignedHalfword); break; | 1171 case 2: __ ldr(result, element_address, kUnsignedHalfword); break; |
| 1166 case 4: __ ldr(result, element_address, kUnsignedWord); break; | 1172 case 4: __ ldr(result, element_address, kUnsignedWord); break; |
| (...skipping 4418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5585 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 5591 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 5586 #if defined(DEBUG) | 5592 #if defined(DEBUG) |
| 5587 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); | 5593 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); |
| 5588 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); | 5594 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); |
| 5589 #endif | 5595 #endif |
| 5590 } | 5596 } |
| 5591 | 5597 |
| 5592 } // namespace dart | 5598 } // namespace dart |
| 5593 | 5599 |
| 5594 #endif // defined TARGET_ARCH_ARM64 | 5600 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |