OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3859 __ store_rax(ToExternalReference(object)); | 3859 __ store_rax(ToExternalReference(object)); |
3860 } else { | 3860 } else { |
3861 Register object = ToRegister(instr->object()); | 3861 Register object = ToRegister(instr->object()); |
3862 __ Store(MemOperand(object, offset), value, representation); | 3862 __ Store(MemOperand(object, offset), value, representation); |
3863 } | 3863 } |
3864 return; | 3864 return; |
3865 } | 3865 } |
3866 | 3866 |
3867 Register object = ToRegister(instr->object()); | 3867 Register object = ToRegister(instr->object()); |
3868 Handle<Map> transition = instr->transition(); | 3868 Handle<Map> transition = instr->transition(); |
| 3869 SmiCheck check_needed = hinstr->value()->IsHeapObject() |
| 3870 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
3869 | 3871 |
3870 if (FLAG_track_fields && representation.IsSmi()) { | 3872 if (FLAG_track_fields && representation.IsSmi()) { |
3871 if (instr->value()->IsConstantOperand()) { | 3873 if (instr->value()->IsConstantOperand()) { |
3872 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 3874 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
3873 if (!IsInteger32Constant(operand_value) && | 3875 if (!IsInteger32Constant(operand_value) && |
3874 !IsSmiConstant(operand_value)) { | 3876 !IsSmiConstant(operand_value)) { |
3875 DeoptimizeIf(no_condition, instr->environment()); | 3877 DeoptimizeIf(no_condition, instr->environment()); |
3876 } | 3878 } |
3877 } | 3879 } |
3878 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 3880 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
3879 if (instr->value()->IsConstantOperand()) { | 3881 if (instr->value()->IsConstantOperand()) { |
3880 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 3882 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
3881 if (IsInteger32Constant(operand_value)) { | 3883 if (IsInteger32Constant(operand_value)) { |
3882 DeoptimizeIf(no_condition, instr->environment()); | 3884 DeoptimizeIf(no_condition, instr->environment()); |
3883 } | 3885 } |
3884 } else { | 3886 } else { |
3885 if (!hinstr->value()->type().IsHeapObject()) { | 3887 if (!hinstr->value()->type().IsHeapObject()) { |
3886 Register value = ToRegister(instr->value()); | 3888 Register value = ToRegister(instr->value()); |
3887 Condition cc = masm()->CheckSmi(value); | 3889 Condition cc = masm()->CheckSmi(value); |
3888 DeoptimizeIf(cc, instr->environment()); | 3890 DeoptimizeIf(cc, instr->environment()); |
| 3891 |
| 3892 // We know that value is a smi now, so we can omit the check below. |
| 3893 check_needed = OMIT_SMI_CHECK; |
3889 } | 3894 } |
3890 } | 3895 } |
3891 } else if (representation.IsDouble()) { | 3896 } else if (representation.IsDouble()) { |
3892 ASSERT(transition.is_null()); | 3897 ASSERT(transition.is_null()); |
3893 ASSERT(access.IsInobject()); | 3898 ASSERT(access.IsInobject()); |
3894 ASSERT(!hinstr->NeedsWriteBarrier()); | 3899 ASSERT(!hinstr->NeedsWriteBarrier()); |
3895 XMMRegister value = ToDoubleRegister(instr->value()); | 3900 XMMRegister value = ToDoubleRegister(instr->value()); |
3896 __ movsd(FieldOperand(object, offset), value); | 3901 __ movsd(FieldOperand(object, offset), value); |
3897 return; | 3902 return; |
3898 } | 3903 } |
(...skipping 10 matching lines...) Expand all Loading... |
3909 HeapObject::kMapOffset, | 3914 HeapObject::kMapOffset, |
3910 kScratchRegister, | 3915 kScratchRegister, |
3911 temp, | 3916 temp, |
3912 kSaveFPRegs, | 3917 kSaveFPRegs, |
3913 OMIT_REMEMBERED_SET, | 3918 OMIT_REMEMBERED_SET, |
3914 OMIT_SMI_CHECK); | 3919 OMIT_SMI_CHECK); |
3915 } | 3920 } |
3916 } | 3921 } |
3917 | 3922 |
3918 // Do the store. | 3923 // Do the store. |
3919 SmiCheck check_needed = hinstr->value()->IsHeapObject() | |
3920 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
3921 | |
3922 Register write_register = object; | 3924 Register write_register = object; |
3923 if (!access.IsInobject()) { | 3925 if (!access.IsInobject()) { |
3924 write_register = ToRegister(instr->temp()); | 3926 write_register = ToRegister(instr->temp()); |
3925 __ movp(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); | 3927 __ movp(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); |
3926 } | 3928 } |
3927 | 3929 |
3928 if (representation.IsSmi() && | 3930 if (representation.IsSmi() && |
3929 hinstr->value()->representation().IsInteger32()) { | 3931 hinstr->value()->representation().IsInteger32()) { |
3930 ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); | 3932 ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); |
3931 #ifdef DEBUG | 3933 #ifdef DEBUG |
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5548 FixedArray::kHeaderSize - kPointerSize)); | 5550 FixedArray::kHeaderSize - kPointerSize)); |
5549 __ bind(&done); | 5551 __ bind(&done); |
5550 } | 5552 } |
5551 | 5553 |
5552 | 5554 |
5553 #undef __ | 5555 #undef __ |
5554 | 5556 |
5555 } } // namespace v8::internal | 5557 } } // namespace v8::internal |
5556 | 5558 |
5557 #endif // V8_TARGET_ARCH_X64 | 5559 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |