| 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 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2792 | 2792 |
| 2793 __ bind(&skip_assignment); | 2793 __ bind(&skip_assignment); |
| 2794 } | 2794 } |
| 2795 | 2795 |
| 2796 | 2796 |
| 2797 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2797 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2798 HObjectAccess access = instr->hydrogen()->access(); | 2798 HObjectAccess access = instr->hydrogen()->access(); |
| 2799 int offset = access.offset(); | 2799 int offset = access.offset(); |
| 2800 | 2800 |
| 2801 if (access.IsExternalMemory()) { | 2801 if (access.IsExternalMemory()) { |
| 2802 ASSERT(!access.representation().IsInteger32()); |
| 2802 Register result = ToRegister(instr->result()); | 2803 Register result = ToRegister(instr->result()); |
| 2803 if (instr->object()->IsConstantOperand()) { | 2804 if (instr->object()->IsConstantOperand()) { |
| 2804 ASSERT(result.is(rax)); | 2805 ASSERT(result.is(rax)); |
| 2805 __ load_rax(ToExternalReference(LConstantOperand::cast(instr->object()))); | 2806 __ load_rax(ToExternalReference(LConstantOperand::cast(instr->object()))); |
| 2806 } else { | 2807 } else { |
| 2807 Register object = ToRegister(instr->object()); | 2808 Register object = ToRegister(instr->object()); |
| 2808 __ movq(result, MemOperand(object, offset)); | 2809 __ movq(result, MemOperand(object, offset)); |
| 2809 } | 2810 } |
| 2810 return; | 2811 return; |
| 2811 } | 2812 } |
| 2812 | 2813 |
| 2813 Register object = ToRegister(instr->object()); | 2814 Register object = ToRegister(instr->object()); |
| 2814 if (FLAG_track_double_fields && | 2815 if (FLAG_track_double_fields && |
| 2815 instr->hydrogen()->representation().IsDouble()) { | 2816 instr->hydrogen()->representation().IsDouble()) { |
| 2816 XMMRegister result = ToDoubleRegister(instr->result()); | 2817 XMMRegister result = ToDoubleRegister(instr->result()); |
| 2817 __ movsd(result, FieldOperand(object, offset)); | 2818 __ movsd(result, FieldOperand(object, offset)); |
| 2818 return; | 2819 return; |
| 2819 } | 2820 } |
| 2820 | 2821 |
| 2821 Register result = ToRegister(instr->result()); | 2822 Register result = ToRegister(instr->result()); |
| 2822 if (access.IsInobject()) { | 2823 if (access.IsInobject()) { |
| 2823 __ movq(result, FieldOperand(object, offset)); | 2824 if (access.representation().IsInteger32()) { |
| 2825 __ movl(result, FieldOperand(object, offset)); |
| 2826 } else { |
| 2827 __ movq(result, FieldOperand(object, offset)); |
| 2828 } |
| 2824 } else { | 2829 } else { |
| 2825 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); | 2830 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
| 2826 __ movq(result, FieldOperand(result, offset)); | 2831 if (access.representation().IsInteger32()) { |
| 2832 __ movl(result, FieldOperand(result, offset)); |
| 2833 } else { |
| 2834 __ movq(result, FieldOperand(result, offset)); |
| 2835 } |
| 2827 } | 2836 } |
| 2828 } | 2837 } |
| 2829 | 2838 |
| 2830 | 2839 |
| 2831 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2840 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 2832 ASSERT(ToRegister(instr->object()).is(rax)); | 2841 ASSERT(ToRegister(instr->object()).is(rax)); |
| 2833 ASSERT(ToRegister(instr->result()).is(rax)); | 2842 ASSERT(ToRegister(instr->result()).is(rax)); |
| 2834 | 2843 |
| 2835 __ Move(rcx, instr->name()); | 2844 __ Move(rcx, instr->name()); |
| 2836 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); | 2845 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3929 } | 3938 } |
| 3930 | 3939 |
| 3931 | 3940 |
| 3932 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 3941 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
| 3933 Representation representation = instr->representation(); | 3942 Representation representation = instr->representation(); |
| 3934 | 3943 |
| 3935 HObjectAccess access = instr->hydrogen()->access(); | 3944 HObjectAccess access = instr->hydrogen()->access(); |
| 3936 int offset = access.offset(); | 3945 int offset = access.offset(); |
| 3937 | 3946 |
| 3938 if (access.IsExternalMemory()) { | 3947 if (access.IsExternalMemory()) { |
| 3948 ASSERT(!access.representation().IsInteger32()); |
| 3939 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 3949 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
| 3940 Register value = ToRegister(instr->value()); | 3950 Register value = ToRegister(instr->value()); |
| 3941 if (instr->object()->IsConstantOperand()) { | 3951 if (instr->object()->IsConstantOperand()) { |
| 3942 ASSERT(value.is(rax)); | 3952 ASSERT(value.is(rax)); |
| 3943 LConstantOperand* object = LConstantOperand::cast(instr->object()); | 3953 LConstantOperand* object = LConstantOperand::cast(instr->object()); |
| 3944 __ store_rax(ToExternalReference(object)); | 3954 __ store_rax(ToExternalReference(object)); |
| 3945 } else { | 3955 } else { |
| 3946 Register object = ToRegister(instr->object()); | 3956 Register object = ToRegister(instr->object()); |
| 3947 __ movq(MemOperand(object, offset), value); | 3957 __ movq(MemOperand(object, offset), value); |
| 3948 } | 3958 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4006 | 4016 |
| 4007 Register write_register = object; | 4017 Register write_register = object; |
| 4008 if (!access.IsInobject()) { | 4018 if (!access.IsInobject()) { |
| 4009 write_register = ToRegister(instr->temp()); | 4019 write_register = ToRegister(instr->temp()); |
| 4010 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); | 4020 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); |
| 4011 } | 4021 } |
| 4012 | 4022 |
| 4013 if (instr->value()->IsConstantOperand()) { | 4023 if (instr->value()->IsConstantOperand()) { |
| 4014 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); | 4024 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); |
| 4015 if (operand_value->IsRegister()) { | 4025 if (operand_value->IsRegister()) { |
| 4016 __ movq(FieldOperand(write_register, offset), | 4026 if (access.representation().IsInteger32()) { |
| 4017 ToRegister(operand_value)); | 4027 __ movl(FieldOperand(write_register, offset), |
| 4028 ToRegister(operand_value)); |
| 4029 } else { |
| 4030 __ movq(FieldOperand(write_register, offset), |
| 4031 ToRegister(operand_value)); |
| 4032 } |
| 4018 } else { | 4033 } else { |
| 4019 Handle<Object> handle_value = ToHandle(operand_value); | 4034 Handle<Object> handle_value = ToHandle(operand_value); |
| 4020 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4035 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
| 4021 __ Move(FieldOperand(write_register, offset), handle_value); | 4036 __ Move(FieldOperand(write_register, offset), handle_value); |
| 4022 } | 4037 } |
| 4023 } else { | 4038 } else { |
| 4024 __ movq(FieldOperand(write_register, offset), ToRegister(instr->value())); | 4039 if (access.representation().IsInteger32()) { |
| 4040 __ movl(FieldOperand(write_register, offset), ToRegister(instr->value())); |
| 4041 } else { |
| 4042 __ movq(FieldOperand(write_register, offset), ToRegister(instr->value())); |
| 4043 } |
| 4025 } | 4044 } |
| 4026 | 4045 |
| 4027 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4046 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 4028 Register value = ToRegister(instr->value()); | 4047 Register value = ToRegister(instr->value()); |
| 4029 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; | 4048 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; |
| 4030 // Update the write barrier for the object for in-object properties. | 4049 // Update the write barrier for the object for in-object properties. |
| 4031 __ RecordWriteField(write_register, | 4050 __ RecordWriteField(write_register, |
| 4032 offset, | 4051 offset, |
| 4033 value, | 4052 value, |
| 4034 temp, | 4053 temp, |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5501 FixedArray::kHeaderSize - kPointerSize)); | 5520 FixedArray::kHeaderSize - kPointerSize)); |
| 5502 __ bind(&done); | 5521 __ bind(&done); |
| 5503 } | 5522 } |
| 5504 | 5523 |
| 5505 | 5524 |
| 5506 #undef __ | 5525 #undef __ |
| 5507 | 5526 |
| 5508 } } // namespace v8::internal | 5527 } } // namespace v8::internal |
| 5509 | 5528 |
| 5510 #endif // V8_TARGET_ARCH_X64 | 5529 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |