Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 494daa617bcb7b7a9eee62f9e27896aca2bb37ac..6470fcb66728ae14279a267d31e58b8e993e858a 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -2166,9 +2166,10 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { |
LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
- ASSERT(instr->representation().IsTagged()); |
LOperand* obj = UseRegisterAtStart(instr->object()); |
- return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
+ LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL; |
+ ASSERT(temp == NULL || FLAG_track_double_fields); |
+ return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp)); |
} |
@@ -2441,8 +2442,12 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
LOperand* val; |
if (needs_write_barrier) { |
val = UseTempRegister(instr->value()); |
- } else if (StoreConstantValueAllowed(instr->value())) { |
+ } else if (StoreConstantValueAllowed(instr->value()) && |
+ !(FLAG_track_double_fields && |
+ instr->field_representation().IsDouble())) { |
val = UseRegisterOrConstant(instr->value()); |
+ } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
+ val = UseTempRegister(instr->value()); |
} else { |
val = UseRegister(instr->value()); |
} |
@@ -2455,7 +2460,13 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
// We need a temporary register for write barrier of the map field. |
LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; |
- return new(zone()) LStoreNamedField(obj, val, temp, temp_map); |
+ LStoreNamedField* result = |
+ new(zone()) LStoreNamedField(obj, val, temp, temp_map); |
+ if ((FLAG_track_fields && instr->field_representation().IsSmi()) || |
+ (FLAG_track_double_fields && instr->field_representation().IsDouble())) { |
+ return AssignEnvironment(result); |
+ } |
+ return result; |
} |