Chromium Code Reviews| Index: src/x64/lithium-x64.cc |
| diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
| index 6094dbb94774edecd4f37dc833dc4b46e23c1893..1a76e2c4b27c106a785005cc682861900a6af6e5 100644 |
| --- a/src/x64/lithium-x64.cc |
| +++ b/src/x64/lithium-x64.cc |
| @@ -2036,10 +2036,19 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind( |
| LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
| bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| - |
| - LOperand* obj = needs_write_barrier |
| - ? UseTempRegister(instr->object()) |
| - : UseRegisterAtStart(instr->object()); |
| + bool needs_write_barrier_for_map = !instr->transition().is_null() && |
| + instr->NeedsWriteBarrierForMap(); |
| + |
| + LOperand* obj; |
| + if (needs_write_barrier) { |
| + obj = instr->is_in_object() |
| + ? UseRegister(instr->object()) |
| + : UseTempRegister(instr->object()); |
|
Vyacheslav Egorov (Google)
2012/05/29 15:09:26
I don't think it has to be temp anymore. RecordWri
Michael Starzinger
2012/05/29 16:35:49
See response to previous comment.
|
| + } else { |
| + obj = needs_write_barrier_for_map |
| + ? UseRegister(instr->object()) |
| + : UseRegisterAtStart(instr->object()); |
| + } |
| LOperand* val = needs_write_barrier |
| ? UseTempRegister(instr->value()) |
| @@ -2047,10 +2056,13 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
| // We only need a scratch register if we have a write barrier or we |
| // have a store into the properties array (not in-object-property). |
| - LOperand* temp = (!instr->is_in_object() || needs_write_barrier) |
| - ? TempRegister() : NULL; |
| + LOperand* temp = (!instr->is_in_object() || needs_write_barrier || |
|
Vyacheslav Egorov (Google)
2012/05/29 15:09:26
I wonder if we can use designated scratch kScratch
Michael Starzinger
2012/05/29 16:35:49
Done.
|
| + needs_write_barrier_for_map) ? TempRegister() : NULL; |
| + |
| + // 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); |
| + return new(zone()) LStoreNamedField(obj, val, temp, temp_map); |
| } |