Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index b240de7f11dc8d88bf09467090e2cf8a95130056..d2fed7dc265b16ec76c3ed2de8bf63cf09f6f658 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -2114,8 +2114,10 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
- return DefineAsRegister( |
- new(zone()) LLoadNamedField(UseRegisterAtStart(instr->object()))); |
+ LOperand* obj = UseRegisterAtStart(instr->object()); |
+ LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL; |
+ ASSERT(temp == NULL || FLAG_track_double_fields); |
+ return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp)); |
} |
@@ -2319,14 +2321,20 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
: UseRegisterAtStart(instr->object()); |
} |
- LOperand* val = needs_write_barrier |
- ? UseTempRegister(instr->value()) |
- : UseRegister(instr->value()); |
+ LOperand* val = |
+ needs_write_barrier || |
+ (FLAG_track_fields && instr->field_representation().IsSmi()) |
+ ? UseTempRegister(instr->value()) : UseRegister(instr->value()); |
// We need a temporary register for write barrier of the map field. |
LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL; |
- return new(zone()) LStoreNamedField(obj, val, temp); |
+ LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); |
+ if ((FLAG_track_fields && instr->field_representation().IsSmi()) || |
+ (FLAG_track_double_fields && instr->field_representation().IsDouble())) { |
+ return AssignEnvironment(result); |
+ } |
+ return result; |
} |