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 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 kSaveFPRegs, | 2693 kSaveFPRegs, |
2694 EMIT_REMEMBERED_SET, | 2694 EMIT_REMEMBERED_SET, |
2695 check_needed); | 2695 check_needed); |
2696 } | 2696 } |
2697 | 2697 |
2698 __ bind(&skip_assignment); | 2698 __ bind(&skip_assignment); |
2699 } | 2699 } |
2700 | 2700 |
2701 | 2701 |
2702 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2702 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2703 int offset = instr->hydrogen()->offset(); | 2703 HObjectAccess access = instr->hydrogen()->access(); |
| 2704 int offset = access.offset(); |
2704 Register object = ToRegister(instr->object()); | 2705 Register object = ToRegister(instr->object()); |
2705 if (FLAG_track_double_fields && | 2706 if (FLAG_track_double_fields && |
2706 instr->hydrogen()->representation().IsDouble()) { | 2707 instr->hydrogen()->representation().IsDouble()) { |
2707 XMMRegister result = ToDoubleRegister(instr->result()); | 2708 XMMRegister result = ToDoubleRegister(instr->result()); |
2708 __ movsd(result, FieldOperand(object, offset)); | 2709 __ movsd(result, FieldOperand(object, offset)); |
2709 return; | 2710 return; |
2710 } | 2711 } |
2711 | 2712 |
2712 Register result = ToRegister(instr->result()); | 2713 Register result = ToRegister(instr->result()); |
2713 if (instr->hydrogen()->is_in_object()) { | 2714 if (access.IsInobject()) { |
2714 __ movq(result, FieldOperand(object, offset)); | 2715 __ movq(result, FieldOperand(object, offset)); |
2715 } else { | 2716 } else { |
2716 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2717 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
2717 __ movq(result, FieldOperand(result, offset)); | 2718 __ movq(result, FieldOperand(result, offset)); |
2718 } | 2719 } |
2719 } | 2720 } |
2720 | 2721 |
2721 | 2722 |
2722 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, | 2723 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
2723 Register object, | 2724 Register object, |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3924 Register base = ToRegister(instr->base_object()); | 3925 Register base = ToRegister(instr->base_object()); |
3925 __ lea(result, Operand(base, instr->offset())); | 3926 __ lea(result, Operand(base, instr->offset())); |
3926 } | 3927 } |
3927 | 3928 |
3928 | 3929 |
3929 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 3930 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
3930 Representation representation = instr->representation(); | 3931 Representation representation = instr->representation(); |
3931 | 3932 |
3932 Register object = ToRegister(instr->object()); | 3933 Register object = ToRegister(instr->object()); |
3933 | 3934 |
3934 int offset = instr->offset(); | 3935 HObjectAccess access = instr->hydrogen()->access(); |
| 3936 int offset = access.offset(); |
3935 | 3937 |
3936 Handle<Map> transition = instr->transition(); | 3938 Handle<Map> transition = instr->transition(); |
3937 | 3939 |
3938 if (FLAG_track_fields && representation.IsSmi()) { | 3940 if (FLAG_track_fields && representation.IsSmi()) { |
3939 if (instr->value()->IsConstantOperand()) { | 3941 if (instr->value()->IsConstantOperand()) { |
3940 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 3942 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
3941 if (!IsSmiConstant(operand_value)) { | 3943 if (!IsSmiConstant(operand_value)) { |
3942 DeoptimizeIf(no_condition, instr->environment()); | 3944 DeoptimizeIf(no_condition, instr->environment()); |
3943 } | 3945 } |
3944 } | 3946 } |
3945 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 3947 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
3946 if (instr->value()->IsConstantOperand()) { | 3948 if (instr->value()->IsConstantOperand()) { |
3947 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 3949 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
3948 if (IsInteger32Constant(operand_value)) { | 3950 if (IsInteger32Constant(operand_value)) { |
3949 DeoptimizeIf(no_condition, instr->environment()); | 3951 DeoptimizeIf(no_condition, instr->environment()); |
3950 } | 3952 } |
3951 } else { | 3953 } else { |
3952 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 3954 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
3953 Register value = ToRegister(instr->value()); | 3955 Register value = ToRegister(instr->value()); |
3954 Condition cc = masm()->CheckSmi(value); | 3956 Condition cc = masm()->CheckSmi(value); |
3955 DeoptimizeIf(cc, instr->environment()); | 3957 DeoptimizeIf(cc, instr->environment()); |
3956 } | 3958 } |
3957 } | 3959 } |
3958 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 3960 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
3959 ASSERT(transition.is_null()); | 3961 ASSERT(transition.is_null()); |
3960 ASSERT(instr->is_in_object()); | 3962 ASSERT(access.IsInobject()); |
3961 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 3963 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
3962 XMMRegister value = ToDoubleRegister(instr->value()); | 3964 XMMRegister value = ToDoubleRegister(instr->value()); |
3963 __ movsd(FieldOperand(object, offset), value); | 3965 __ movsd(FieldOperand(object, offset), value); |
3964 return; | 3966 return; |
3965 } | 3967 } |
3966 | 3968 |
3967 if (!transition.is_null()) { | 3969 if (!transition.is_null()) { |
3968 if (transition->CanBeDeprecated()) { | 3970 if (transition->CanBeDeprecated()) { |
3969 transition_maps_.Add(transition, info()->zone()); | 3971 transition_maps_.Add(transition, info()->zone()); |
3970 } | 3972 } |
(...skipping 13 matching lines...) Expand all Loading... |
3984 OMIT_SMI_CHECK); | 3986 OMIT_SMI_CHECK); |
3985 } | 3987 } |
3986 } | 3988 } |
3987 | 3989 |
3988 // Do the store. | 3990 // Do the store. |
3989 HType type = instr->hydrogen()->value()->type(); | 3991 HType type = instr->hydrogen()->value()->type(); |
3990 SmiCheck check_needed = | 3992 SmiCheck check_needed = |
3991 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3993 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
3992 | 3994 |
3993 Register write_register = object; | 3995 Register write_register = object; |
3994 if (!instr->is_in_object()) { | 3996 if (!access.IsInobject()) { |
3995 write_register = ToRegister(instr->temp()); | 3997 write_register = ToRegister(instr->temp()); |
3996 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); | 3998 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); |
3997 } | 3999 } |
3998 | 4000 |
3999 if (instr->value()->IsConstantOperand()) { | 4001 if (instr->value()->IsConstantOperand()) { |
4000 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4002 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
4001 if (operand_value->IsRegister()) { | 4003 if (operand_value->IsRegister()) { |
4002 __ movq(FieldOperand(write_register, offset), | 4004 __ movq(FieldOperand(write_register, offset), |
4003 ToRegister(operand_value)); | 4005 ToRegister(operand_value)); |
4004 } else { | 4006 } else { |
4005 Handle<Object> handle_value = ToHandle(operand_value); | 4007 Handle<Object> handle_value = ToHandle(operand_value); |
4006 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4008 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4007 __ Move(FieldOperand(write_register, offset), handle_value); | 4009 __ Move(FieldOperand(write_register, offset), handle_value); |
4008 } | 4010 } |
4009 } else { | 4011 } else { |
4010 __ movq(FieldOperand(write_register, offset), ToRegister(instr->value())); | 4012 __ movq(FieldOperand(write_register, offset), ToRegister(instr->value())); |
4011 } | 4013 } |
4012 | 4014 |
4013 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4015 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4014 Register value = ToRegister(instr->value()); | 4016 Register value = ToRegister(instr->value()); |
4015 Register temp = instr->is_in_object() ? ToRegister(instr->temp()) : object; | 4017 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
4016 // Update the write barrier for the object for in-object properties. | 4018 // Update the write barrier for the object for in-object properties. |
4017 __ RecordWriteField(write_register, | 4019 __ RecordWriteField(write_register, |
4018 offset, | 4020 offset, |
4019 value, | 4021 value, |
4020 temp, | 4022 temp, |
4021 kSaveFPRegs, | 4023 kSaveFPRegs, |
4022 EMIT_REMEMBERED_SET, | 4024 EMIT_REMEMBERED_SET, |
4023 check_needed); | 4025 check_needed); |
4024 } | 4026 } |
4025 } | 4027 } |
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5690 FixedArray::kHeaderSize - kPointerSize)); | 5692 FixedArray::kHeaderSize - kPointerSize)); |
5691 __ bind(&done); | 5693 __ bind(&done); |
5692 } | 5694 } |
5693 | 5695 |
5694 | 5696 |
5695 #undef __ | 5697 #undef __ |
5696 | 5698 |
5697 } } // namespace v8::internal | 5699 } } // namespace v8::internal |
5698 | 5700 |
5699 #endif // V8_TARGET_ARCH_X64 | 5701 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |