OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "ia32/lithium-codegen-ia32.h" | 9 #include "ia32/lithium-codegen-ia32.h" |
10 #include "ic.h" | 10 #include "ic.h" |
(...skipping 3960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3971 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 3971 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
3972 __ mov(operand, Immediate(ToInteger32(operand_value))); | 3972 __ mov(operand, Immediate(ToInteger32(operand_value))); |
3973 } else { | 3973 } else { |
3974 Register value = ToRegister(instr->value()); | 3974 Register value = ToRegister(instr->value()); |
3975 __ Store(value, operand, representation); | 3975 __ Store(value, operand, representation); |
3976 } | 3976 } |
3977 return; | 3977 return; |
3978 } | 3978 } |
3979 | 3979 |
3980 Register object = ToRegister(instr->object()); | 3980 Register object = ToRegister(instr->object()); |
3981 SmiCheck check_needed = | 3981 __ AssertNotSmi(object); |
3982 instr->hydrogen()->value()->IsHeapObject() | |
3983 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
3984 | 3982 |
3985 ASSERT(!(representation.IsSmi() && | 3983 ASSERT(!representation.IsSmi() || |
3986 instr->value()->IsConstantOperand() && | 3984 !instr->value()->IsConstantOperand() || |
3987 !IsSmi(LConstantOperand::cast(instr->value())))); | 3985 IsSmi(LConstantOperand::cast(instr->value()))); |
3988 if (representation.IsHeapObject()) { | 3986 if (representation.IsDouble()) { |
3989 if (instr->value()->IsConstantOperand()) { | |
3990 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | |
3991 if (chunk_->LookupConstant(operand_value)->HasSmiValue()) { | |
3992 DeoptimizeIf(no_condition, instr->environment()); | |
3993 } | |
3994 } else { | |
3995 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | |
3996 Register value = ToRegister(instr->value()); | |
3997 __ test(value, Immediate(kSmiTagMask)); | |
3998 DeoptimizeIf(zero, instr->environment()); | |
3999 | |
4000 // We know now that value is not a smi, so we can omit the check below. | |
4001 check_needed = OMIT_SMI_CHECK; | |
4002 } | |
4003 } | |
4004 } else if (representation.IsDouble()) { | |
4005 ASSERT(access.IsInobject()); | 3987 ASSERT(access.IsInobject()); |
4006 ASSERT(!instr->hydrogen()->has_transition()); | 3988 ASSERT(!instr->hydrogen()->has_transition()); |
4007 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 3989 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4008 XMMRegister value = ToDoubleRegister(instr->value()); | 3990 XMMRegister value = ToDoubleRegister(instr->value()); |
4009 __ movsd(FieldOperand(object, offset), value); | 3991 __ movsd(FieldOperand(object, offset), value); |
4010 return; | 3992 return; |
4011 } | 3993 } |
4012 | 3994 |
4013 if (instr->hydrogen()->has_transition()) { | 3995 if (instr->hydrogen()->has_transition()) { |
4014 Handle<Map> transition = instr->hydrogen()->transition_map(); | 3996 Handle<Map> transition = instr->hydrogen()->transition_map(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4061 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4043 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4062 Register value = ToRegister(instr->value()); | 4044 Register value = ToRegister(instr->value()); |
4063 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; | 4045 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
4064 // Update the write barrier for the object for in-object properties. | 4046 // Update the write barrier for the object for in-object properties. |
4065 __ RecordWriteField(write_register, | 4047 __ RecordWriteField(write_register, |
4066 offset, | 4048 offset, |
4067 value, | 4049 value, |
4068 temp, | 4050 temp, |
4069 kSaveFPRegs, | 4051 kSaveFPRegs, |
4070 EMIT_REMEMBERED_SET, | 4052 EMIT_REMEMBERED_SET, |
4071 check_needed); | 4053 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4072 } | 4054 } |
4073 } | 4055 } |
4074 | 4056 |
4075 | 4057 |
4076 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4058 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4077 ASSERT(ToRegister(instr->context()).is(esi)); | 4059 ASSERT(ToRegister(instr->context()).is(esi)); |
4078 ASSERT(ToRegister(instr->object()).is(edx)); | 4060 ASSERT(ToRegister(instr->object()).is(edx)); |
4079 ASSERT(ToRegister(instr->value()).is(eax)); | 4061 ASSERT(ToRegister(instr->value()).is(eax)); |
4080 | 4062 |
4081 __ mov(ecx, instr->name()); | 4063 __ mov(ecx, instr->name()); |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5676 __ bind(deferred->exit()); | 5658 __ bind(deferred->exit()); |
5677 __ bind(&done); | 5659 __ bind(&done); |
5678 } | 5660 } |
5679 | 5661 |
5680 | 5662 |
5681 #undef __ | 5663 #undef __ |
5682 | 5664 |
5683 } } // namespace v8::internal | 5665 } } // namespace v8::internal |
5684 | 5666 |
5685 #endif // V8_TARGET_ARCH_IA32 | 5667 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |