Index: runtime/vm/intermediate_language_ia32.cc |
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc |
index ccf4a25ee3494cd324e7b04d0327546e73522cf0..8318279e298a77e37d958e0e1f6344dc14e61e92 100644 |
--- a/runtime/vm/intermediate_language_ia32.cc |
+++ b/runtime/vm/intermediate_language_ia32.cc |
@@ -939,9 +939,14 @@ LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, |
void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
- Register object = locs()->in(0).reg(); |
+ Register obj = locs()->in(0).reg(); |
Register result = locs()->out(0).reg(); |
- __ movl(result, FieldAddress(object, offset())); |
+ if (object()->definition()->representation() == kUntagged) { |
+ __ movl(result, Address(obj, offset())); |
+ } else { |
+ ASSERT(object()->definition()->representation() == kTagged); |
+ __ movl(result, FieldAddress(obj, offset())); |
+ } |
} |
@@ -3725,11 +3730,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 = Assembler::ElementAddressForRegIndex( |
- IsExternal(), class_id(), index_scale(), array, index.reg()); |
+ IsExternal(), class_id(), index_scale(), str, index.reg()); |
if ((index_scale() == 1)) { |
__ SmiUntag(index.reg()); |