| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "x64/lithium-codegen-x64.h" | 9 #include "x64/lithium-codegen-x64.h" |
| 10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
| (...skipping 3972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3983 LConstantOperand* object = LConstantOperand::cast(instr->object()); | 3983 LConstantOperand* object = LConstantOperand::cast(instr->object()); |
| 3984 __ store_rax(ToExternalReference(object)); | 3984 __ store_rax(ToExternalReference(object)); |
| 3985 } else { | 3985 } else { |
| 3986 Register object = ToRegister(instr->object()); | 3986 Register object = ToRegister(instr->object()); |
| 3987 __ Store(MemOperand(object, offset), value, representation); | 3987 __ Store(MemOperand(object, offset), value, representation); |
| 3988 } | 3988 } |
| 3989 return; | 3989 return; |
| 3990 } | 3990 } |
| 3991 | 3991 |
| 3992 Register object = ToRegister(instr->object()); | 3992 Register object = ToRegister(instr->object()); |
| 3993 SmiCheck check_needed = hinstr->value()->IsHeapObject() | 3993 __ AssertNotSmi(object); |
| 3994 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
| 3995 | 3994 |
| 3996 ASSERT(!(representation.IsSmi() && | 3995 ASSERT(!representation.IsSmi() || |
| 3997 instr->value()->IsConstantOperand() && | 3996 !instr->value()->IsConstantOperand() || |
| 3998 !IsInteger32Constant(LConstantOperand::cast(instr->value())))); | 3997 IsInteger32Constant(LConstantOperand::cast(instr->value()))); |
| 3999 if (representation.IsHeapObject()) { | 3998 if (representation.IsDouble()) { |
| 4000 if (instr->value()->IsConstantOperand()) { | |
| 4001 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | |
| 4002 if (chunk_->LookupConstant(operand_value)->HasSmiValue()) { | |
| 4003 DeoptimizeIf(no_condition, instr->environment()); | |
| 4004 } | |
| 4005 } else { | |
| 4006 if (!hinstr->value()->type().IsHeapObject()) { | |
| 4007 Register value = ToRegister(instr->value()); | |
| 4008 Condition cc = masm()->CheckSmi(value); | |
| 4009 DeoptimizeIf(cc, instr->environment()); | |
| 4010 | |
| 4011 // We know now that value is not a smi, so we can omit the check below. | |
| 4012 check_needed = OMIT_SMI_CHECK; | |
| 4013 } | |
| 4014 } | |
| 4015 } else if (representation.IsDouble()) { | |
| 4016 ASSERT(access.IsInobject()); | 3999 ASSERT(access.IsInobject()); |
| 4017 ASSERT(!hinstr->has_transition()); | 4000 ASSERT(!hinstr->has_transition()); |
| 4018 ASSERT(!hinstr->NeedsWriteBarrier()); | 4001 ASSERT(!hinstr->NeedsWriteBarrier()); |
| 4019 XMMRegister value = ToDoubleRegister(instr->value()); | 4002 XMMRegister value = ToDoubleRegister(instr->value()); |
| 4020 __ movsd(FieldOperand(object, offset), value); | 4003 __ movsd(FieldOperand(object, offset), value); |
| 4021 return; | 4004 return; |
| 4022 } | 4005 } |
| 4023 | 4006 |
| 4024 if (hinstr->has_transition()) { | 4007 if (hinstr->has_transition()) { |
| 4025 Handle<Map> transition = hinstr->transition_map(); | 4008 Handle<Map> transition = hinstr->transition_map(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4090 if (hinstr->NeedsWriteBarrier()) { | 4073 if (hinstr->NeedsWriteBarrier()) { |
| 4091 Register value = ToRegister(instr->value()); | 4074 Register value = ToRegister(instr->value()); |
| 4092 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; | 4075 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
| 4093 // Update the write barrier for the object for in-object properties. | 4076 // Update the write barrier for the object for in-object properties. |
| 4094 __ RecordWriteField(write_register, | 4077 __ RecordWriteField(write_register, |
| 4095 offset, | 4078 offset, |
| 4096 value, | 4079 value, |
| 4097 temp, | 4080 temp, |
| 4098 kSaveFPRegs, | 4081 kSaveFPRegs, |
| 4099 EMIT_REMEMBERED_SET, | 4082 EMIT_REMEMBERED_SET, |
| 4100 check_needed); | 4083 hinstr->SmiCheckForWriteBarrier()); |
| 4101 } | 4084 } |
| 4102 } | 4085 } |
| 4103 | 4086 |
| 4104 | 4087 |
| 4105 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4088 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 4106 ASSERT(ToRegister(instr->context()).is(rsi)); | 4089 ASSERT(ToRegister(instr->context()).is(rsi)); |
| 4107 ASSERT(ToRegister(instr->object()).is(rdx)); | 4090 ASSERT(ToRegister(instr->object()).is(rdx)); |
| 4108 ASSERT(ToRegister(instr->value()).is(rax)); | 4091 ASSERT(ToRegister(instr->value()).is(rax)); |
| 4109 | 4092 |
| 4110 __ Move(rcx, instr->hydrogen()->name()); | 4093 __ Move(rcx, instr->hydrogen()->name()); |
| (...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5704 __ bind(deferred->exit()); | 5687 __ bind(deferred->exit()); |
| 5705 __ bind(&done); | 5688 __ bind(&done); |
| 5706 } | 5689 } |
| 5707 | 5690 |
| 5708 | 5691 |
| 5709 #undef __ | 5692 #undef __ |
| 5710 | 5693 |
| 5711 } } // namespace v8::internal | 5694 } } // namespace v8::internal |
| 5712 | 5695 |
| 5713 #endif // V8_TARGET_ARCH_X64 | 5696 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |