OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2703 kSaveFPRegs, | 2703 kSaveFPRegs, |
2704 EMIT_REMEMBERED_SET, | 2704 EMIT_REMEMBERED_SET, |
2705 check_needed); | 2705 check_needed); |
2706 } | 2706 } |
2707 | 2707 |
2708 __ bind(&skip_assignment); | 2708 __ bind(&skip_assignment); |
2709 } | 2709 } |
2710 | 2710 |
2711 | 2711 |
2712 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2712 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2713 int offset = instr->hydrogen()->offset(); | 2713 HObjectAccess access = instr->hydrogen()->access(); |
| 2714 int offset = access.offset(); |
2714 Register object = ToRegister(instr->object()); | 2715 Register object = ToRegister(instr->object()); |
2715 if (instr->hydrogen()->representation().IsDouble()) { | 2716 if (instr->hydrogen()->representation().IsDouble()) { |
2716 DoubleRegister result = ToDoubleRegister(instr->result()); | 2717 DoubleRegister result = ToDoubleRegister(instr->result()); |
2717 __ ldc1(result, FieldMemOperand(object, offset)); | 2718 __ ldc1(result, FieldMemOperand(object, offset)); |
2718 return; | 2719 return; |
2719 } | 2720 } |
2720 | 2721 |
2721 Register result = ToRegister(instr->result()); | 2722 Register result = ToRegister(instr->result()); |
2722 if (instr->hydrogen()->is_in_object()) { | 2723 if (access.IsInobject()) { |
2723 __ lw(result, FieldMemOperand(object, offset)); | 2724 __ lw(result, FieldMemOperand(object, offset)); |
2724 } else { | 2725 } else { |
2725 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2726 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
2726 __ lw(result, FieldMemOperand(result, offset)); | 2727 __ lw(result, FieldMemOperand(result, offset)); |
2727 } | 2728 } |
2728 } | 2729 } |
2729 | 2730 |
2730 | 2731 |
2731 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, | 2732 void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
2732 Register object, | 2733 Register object, |
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3914 Register base = ToRegister(instr->base_object()); | 3915 Register base = ToRegister(instr->base_object()); |
3915 __ Addu(result, base, Operand(instr->offset())); | 3916 __ Addu(result, base, Operand(instr->offset())); |
3916 } | 3917 } |
3917 | 3918 |
3918 | 3919 |
3919 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 3920 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
3920 Representation representation = instr->representation(); | 3921 Representation representation = instr->representation(); |
3921 | 3922 |
3922 Register object = ToRegister(instr->object()); | 3923 Register object = ToRegister(instr->object()); |
3923 Register scratch = scratch0(); | 3924 Register scratch = scratch0(); |
3924 int offset = instr->offset(); | 3925 HObjectAccess access = instr->hydrogen()->access(); |
| 3926 int offset = access.offset(); |
3925 | 3927 |
3926 Handle<Map> transition = instr->transition(); | 3928 Handle<Map> transition = instr->transition(); |
3927 | 3929 |
3928 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 3930 if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
3929 Register value = ToRegister(instr->value()); | 3931 Register value = ToRegister(instr->value()); |
3930 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 3932 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
3931 __ And(scratch, value, Operand(kSmiTagMask)); | 3933 __ And(scratch, value, Operand(kSmiTagMask)); |
3932 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); | 3934 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); |
3933 } | 3935 } |
3934 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 3936 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
3935 ASSERT(transition.is_null()); | 3937 ASSERT(transition.is_null()); |
3936 ASSERT(instr->is_in_object()); | 3938 ASSERT(access.IsInobject()); |
3937 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 3939 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
3938 DoubleRegister value = ToDoubleRegister(instr->value()); | 3940 DoubleRegister value = ToDoubleRegister(instr->value()); |
3939 __ sdc1(value, FieldMemOperand(object, offset)); | 3941 __ sdc1(value, FieldMemOperand(object, offset)); |
3940 return; | 3942 return; |
3941 } | 3943 } |
3942 | 3944 |
3943 if (!transition.is_null()) { | 3945 if (!transition.is_null()) { |
3944 if (transition->CanBeDeprecated()) { | 3946 if (transition->CanBeDeprecated()) { |
3945 transition_maps_.Add(transition, info()->zone()); | 3947 transition_maps_.Add(transition, info()->zone()); |
3946 } | 3948 } |
(...skipping 12 matching lines...) Expand all Loading... |
3959 OMIT_SMI_CHECK); | 3961 OMIT_SMI_CHECK); |
3960 } | 3962 } |
3961 } | 3963 } |
3962 | 3964 |
3963 // Do the store. | 3965 // Do the store. |
3964 Register value = ToRegister(instr->value()); | 3966 Register value = ToRegister(instr->value()); |
3965 ASSERT(!object.is(value)); | 3967 ASSERT(!object.is(value)); |
3966 HType type = instr->hydrogen()->value()->type(); | 3968 HType type = instr->hydrogen()->value()->type(); |
3967 SmiCheck check_needed = | 3969 SmiCheck check_needed = |
3968 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3970 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
3969 if (instr->is_in_object()) { | 3971 if (access.IsInobject()) { |
3970 __ sw(value, FieldMemOperand(object, offset)); | 3972 __ sw(value, FieldMemOperand(object, offset)); |
3971 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3973 if (instr->hydrogen()->NeedsWriteBarrier()) { |
3972 // Update the write barrier for the object for in-object properties. | 3974 // Update the write barrier for the object for in-object properties. |
3973 __ RecordWriteField(object, | 3975 __ RecordWriteField(object, |
3974 offset, | 3976 offset, |
3975 value, | 3977 value, |
3976 scratch, | 3978 scratch, |
3977 GetRAState(), | 3979 GetRAState(), |
3978 kSaveFPRegs, | 3980 kSaveFPRegs, |
3979 EMIT_REMEMBERED_SET, | 3981 EMIT_REMEMBERED_SET, |
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5763 __ Subu(scratch, result, scratch); | 5765 __ Subu(scratch, result, scratch); |
5764 __ lw(result, FieldMemOperand(scratch, | 5766 __ lw(result, FieldMemOperand(scratch, |
5765 FixedArray::kHeaderSize - kPointerSize)); | 5767 FixedArray::kHeaderSize - kPointerSize)); |
5766 __ bind(&done); | 5768 __ bind(&done); |
5767 } | 5769 } |
5768 | 5770 |
5769 | 5771 |
5770 #undef __ | 5772 #undef __ |
5771 | 5773 |
5772 } } // namespace v8::internal | 5774 } } // namespace v8::internal |
OLD | NEW |