Index: runtime/vm/intermediate_language_arm64.cc |
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc |
index 47f908907f79f49d612154cde2a3d6cffb0746b4..fedbd340f9e7ad6df3a9273cfb441a62132c29d1 100644 |
--- a/runtime/vm/intermediate_language_arm64.cc |
+++ b/runtime/vm/intermediate_language_arm64.cc |
@@ -903,9 +903,14 @@ LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, |
void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
- const Register object = locs()->in(0).reg(); |
+ const Register obj = locs()->in(0).reg(); |
const Register result = locs()->out(0).reg(); |
- __ LoadFieldFromOffset(result, object, offset(), PP); |
+ if (object()->definition()->representation() == kUntagged) { |
+ __ LoadFromOffset(result, obj, offset(), PP); |
+ } else { |
+ ASSERT(object()->definition()->representation() == kTagged); |
+ __ LoadFieldFromOffset(result, obj, offset(), PP); |
+ } |
} |
@@ -1149,11 +1154,12 @@ LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate, |
void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
- const Register array = locs()->in(0).reg(); |
+ // The string register points to the backing store for external strings. |
+ const Register str = locs()->in(0).reg(); |
const Location index = locs()->in(1); |
Address element_address = __ ElementAddressForRegIndex( |
- true, IsExternal(), class_id(), index_scale(), array, index.reg()); |
+ true, IsExternal(), class_id(), index_scale(), str, index.reg()); |
// Warning: element_address may use register TMP as base. |
Register result = locs()->out(0).reg(); |