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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2969 __ load_rax(ToExternalReference(LConstantOperand::cast(instr->object()))); | 2969 __ load_rax(ToExternalReference(LConstantOperand::cast(instr->object()))); |
2970 } else { | 2970 } else { |
2971 Register object = ToRegister(instr->object()); | 2971 Register object = ToRegister(instr->object()); |
2972 __ Load(result, MemOperand(object, offset), access.representation()); | 2972 __ Load(result, MemOperand(object, offset), access.representation()); |
2973 } | 2973 } |
2974 return; | 2974 return; |
2975 } | 2975 } |
2976 | 2976 |
2977 Register object = ToRegister(instr->object()); | 2977 Register object = ToRegister(instr->object()); |
2978 if (instr->hydrogen()->representation().IsDouble()) { | 2978 if (instr->hydrogen()->representation().IsDouble()) { |
2979 DCHECK(access.IsInobject()); | |
2980 XMMRegister result = ToDoubleRegister(instr->result()); | 2979 XMMRegister result = ToDoubleRegister(instr->result()); |
2981 __ movsd(result, FieldOperand(object, offset)); | 2980 __ movsd(result, FieldOperand(object, offset)); |
2982 return; | 2981 return; |
2983 } | 2982 } |
2984 | 2983 |
2985 Register result = ToRegister(instr->result()); | 2984 Register result = ToRegister(instr->result()); |
2986 if (!access.IsInobject()) { | 2985 if (!access.IsInobject()) { |
2987 __ movp(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2986 __ movp(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
2988 object = result; | 2987 object = result; |
2989 } | 2988 } |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4116 } | 4115 } |
4117 return; | 4116 return; |
4118 } | 4117 } |
4119 | 4118 |
4120 Register object = ToRegister(instr->object()); | 4119 Register object = ToRegister(instr->object()); |
4121 __ AssertNotSmi(object); | 4120 __ AssertNotSmi(object); |
4122 | 4121 |
4123 DCHECK(!representation.IsSmi() || | 4122 DCHECK(!representation.IsSmi() || |
4124 !instr->value()->IsConstantOperand() || | 4123 !instr->value()->IsConstantOperand() || |
4125 IsInteger32Constant(LConstantOperand::cast(instr->value()))); | 4124 IsInteger32Constant(LConstantOperand::cast(instr->value()))); |
4126 if (!FLAG_unbox_double_fields && representation.IsDouble()) { | 4125 if (representation.IsDouble()) { |
4127 DCHECK(access.IsInobject()); | 4126 DCHECK(access.IsInobject()); |
4128 DCHECK(!hinstr->has_transition()); | 4127 DCHECK(!hinstr->has_transition()); |
4129 DCHECK(!hinstr->NeedsWriteBarrier()); | 4128 DCHECK(!hinstr->NeedsWriteBarrier()); |
4130 XMMRegister value = ToDoubleRegister(instr->value()); | 4129 XMMRegister value = ToDoubleRegister(instr->value()); |
4131 __ movsd(FieldOperand(object, offset), value); | 4130 __ movsd(FieldOperand(object, offset), value); |
4132 return; | 4131 return; |
4133 } | 4132 } |
4134 | 4133 |
4135 if (hinstr->has_transition()) { | 4134 if (hinstr->has_transition()) { |
4136 Handle<Map> transition = hinstr->transition_map(); | 4135 Handle<Map> transition = hinstr->transition_map(); |
(...skipping 29 matching lines...) Expand all Loading... |
4166 } | 4165 } |
4167 // Store int value directly to upper half of the smi. | 4166 // Store int value directly to upper half of the smi. |
4168 STATIC_ASSERT(kSmiTag == 0); | 4167 STATIC_ASSERT(kSmiTag == 0); |
4169 DCHECK(kSmiTagSize + kSmiShiftSize == 32); | 4168 DCHECK(kSmiTagSize + kSmiShiftSize == 32); |
4170 offset += kPointerSize / 2; | 4169 offset += kPointerSize / 2; |
4171 representation = Representation::Integer32(); | 4170 representation = Representation::Integer32(); |
4172 } | 4171 } |
4173 | 4172 |
4174 Operand operand = FieldOperand(write_register, offset); | 4173 Operand operand = FieldOperand(write_register, offset); |
4175 | 4174 |
4176 if (FLAG_unbox_double_fields && representation.IsDouble()) { | 4175 if (instr->value()->IsRegister()) { |
4177 DCHECK(access.IsInobject()); | |
4178 XMMRegister value = ToDoubleRegister(instr->value()); | |
4179 __ movsd(operand, value); | |
4180 | |
4181 } else if (instr->value()->IsRegister()) { | |
4182 Register value = ToRegister(instr->value()); | 4176 Register value = ToRegister(instr->value()); |
4183 __ Store(operand, value, representation); | 4177 __ Store(operand, value, representation); |
4184 } else { | 4178 } else { |
4185 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4179 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4186 if (IsInteger32Constant(operand_value)) { | 4180 if (IsInteger32Constant(operand_value)) { |
4187 DCHECK(!hinstr->NeedsWriteBarrier()); | 4181 DCHECK(!hinstr->NeedsWriteBarrier()); |
4188 int32_t value = ToInteger32(operand_value); | 4182 int32_t value = ToInteger32(operand_value); |
4189 if (representation.IsSmi()) { | 4183 if (representation.IsSmi()) { |
4190 __ Move(operand, Smi::FromInt(value)); | 4184 __ Move(operand, Smi::FromInt(value)); |
4191 | 4185 |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5889 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5883 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5890 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5884 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5891 } | 5885 } |
5892 | 5886 |
5893 | 5887 |
5894 #undef __ | 5888 #undef __ |
5895 | 5889 |
5896 } } // namespace v8::internal | 5890 } } // namespace v8::internal |
5897 | 5891 |
5898 #endif // V8_TARGET_ARCH_X64 | 5892 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |