OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4257 Register write_register = object; | 4257 Register write_register = object; |
4258 if (!instr->is_in_object()) { | 4258 if (!instr->is_in_object()) { |
4259 write_register = ToRegister(instr->temp()); | 4259 write_register = ToRegister(instr->temp()); |
4260 __ mov(write_register, | 4260 __ mov(write_register, |
4261 FieldOperand(object, JSObject::kPropertiesOffset)); | 4261 FieldOperand(object, JSObject::kPropertiesOffset)); |
4262 } | 4262 } |
4263 | 4263 |
4264 if (instr->value()->IsConstantOperand()) { | 4264 if (instr->value()->IsConstantOperand()) { |
4265 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4265 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4266 if (IsInteger32(operand_value)) { | 4266 if (IsInteger32(operand_value)) { |
4267 int const_value = ToInteger32(operand_value); | 4267 // In lithium register preparation, we made sure that the constant integer |
4268 __ mov(FieldOperand(write_register, offset), Immediate(const_value)); | 4268 // operand fits into smi range. |
| 4269 Smi* smi_value = Smi::FromInt(ToInteger32(operand_value)); |
| 4270 __ mov(FieldOperand(write_register, offset), Immediate(smi_value)); |
| 4271 } else if (operand_value->IsRegister()) { |
| 4272 __ mov(FieldOperand(write_register, offset), ToRegister(operand_value)); |
4269 } else { | 4273 } else { |
4270 if (operand_value->IsRegister()) { | 4274 Handle<Object> handle_value = ToHandle(operand_value); |
4271 __ mov(FieldOperand(write_register, offset), ToRegister(operand_value)); | 4275 __ mov(FieldOperand(write_register, offset), handle_value); |
4272 } else { | |
4273 Handle<Object> handle_value = ToHandle(operand_value); | |
4274 __ mov(FieldOperand(write_register, offset), handle_value); | |
4275 } | |
4276 } | 4276 } |
4277 } else { | 4277 } else { |
4278 __ mov(FieldOperand(write_register, offset), ToRegister(instr->value())); | 4278 __ mov(FieldOperand(write_register, offset), ToRegister(instr->value())); |
4279 } | 4279 } |
4280 | 4280 |
4281 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4281 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4282 Register value = ToRegister(instr->value()); | 4282 Register value = ToRegister(instr->value()); |
4283 Register temp = instr->is_in_object() ? ToRegister(instr->temp()) : object; | 4283 Register temp = instr->is_in_object() ? ToRegister(instr->temp()) : object; |
4284 // Update the write barrier for the object for in-object properties. | 4284 // Update the write barrier for the object for in-object properties. |
4285 __ RecordWriteField(write_register, | 4285 __ RecordWriteField(write_register, |
(...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6576 FixedArray::kHeaderSize - kPointerSize)); | 6576 FixedArray::kHeaderSize - kPointerSize)); |
6577 __ bind(&done); | 6577 __ bind(&done); |
6578 } | 6578 } |
6579 | 6579 |
6580 | 6580 |
6581 #undef __ | 6581 #undef __ |
6582 | 6582 |
6583 } } // namespace v8::internal | 6583 } } // namespace v8::internal |
6584 | 6584 |
6585 #endif // V8_TARGET_ARCH_IA32 | 6585 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |