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