Index: src/a64/lithium-a64.cc |
diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc |
index cf89c09f5b2515d2dbc0b6cabe667b10245eb9ea..ce77209910d33131d5ea6607a585d9ccd6f05df2 100644 |
--- a/src/a64/lithium-a64.cc |
+++ b/src/a64/lithium-a64.cc |
@@ -2231,17 +2231,27 @@ LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
- // TODO(jbramley): Optimize register usage in this instruction. For now, it |
- // allocates everything that it might need because it keeps changing in the |
- // merge and keeping it valid is time-consuming. |
- |
// TODO(jbramley): It might be beneficial to allow value to be a constant in |
// some cases. x64 makes use of this with FLAG_track_fields, for example. |
LOperand* object = UseRegister(instr->object()); |
ulan
2014/03/07 15:16:26
This is difficult to understand and to keep in syn
|
- LOperand* value = UseRegisterAndClobber(instr->value()); |
- LOperand* temp0 = TempRegister(); |
- LOperand* temp1 = TempRegister(); |
+ LOperand* value; |
+ LOperand* temp0 = NULL; |
+ LOperand* temp1 = NULL; |
+ if (instr->NeedsWriteBarrier()) { |
+ value = UseRegisterAndClobber(instr->value()); |
+ temp0 = TempRegister(); |
+ temp1 = TempRegister(); |
+ } else { |
+ value = UseRegister(instr->value()); |
+ if (!(instr->access().IsExternalMemory() || |
+ instr->field_representation().IsDouble())) { |
+ temp0 = TempRegister(); |
+ if (instr->NeedsWriteBarrierForMap()) { |
+ temp1 = TempRegister(); |
+ } |
+ } |
+ } |
LStoreNamedField* result = |
new(zone()) LStoreNamedField(object, value, temp0, temp1); |