Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: src/x87/lithium-codegen-x87.cc

Issue 314983002: X87: Improve write barriers in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/x87/lithium-codegen-x87.h" 9 #include "src/x87/lithium-codegen-x87.h"
10 #include "src/ic.h" 10 #include "src/ic.h"
(...skipping 3886 matching lines...) Expand 10 before | Expand all | Expand 10 after
3897 ASSERT(!instr->hydrogen()->has_transition()); 3897 ASSERT(!instr->hydrogen()->has_transition());
3898 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 3898 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
3899 X87Register value = ToX87Register(instr->value()); 3899 X87Register value = ToX87Register(instr->value());
3900 X87Mov(FieldOperand(object, offset), value); 3900 X87Mov(FieldOperand(object, offset), value);
3901 return; 3901 return;
3902 } 3902 }
3903 3903
3904 if (instr->hydrogen()->has_transition()) { 3904 if (instr->hydrogen()->has_transition()) {
3905 Handle<Map> transition = instr->hydrogen()->transition_map(); 3905 Handle<Map> transition = instr->hydrogen()->transition_map();
3906 AddDeprecationDependency(transition); 3906 AddDeprecationDependency(transition);
3907 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { 3907 __ mov(FieldOperand(object, HeapObject::kMapOffset), transition);
3908 __ mov(FieldOperand(object, HeapObject::kMapOffset), transition); 3908 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
3909 } else {
3910 Register temp = ToRegister(instr->temp()); 3909 Register temp = ToRegister(instr->temp());
3911 Register temp_map = ToRegister(instr->temp_map()); 3910 Register temp_map = ToRegister(instr->temp_map());
3912 __ mov(temp_map, transition); 3911 __ mov(temp_map, transition);
3913 __ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map); 3912 __ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map);
3914 // Update the write barrier for the map field. 3913 // Update the write barrier for the map field.
3915 __ RecordWriteField(object, 3914 __ RecordWriteForMap(object, transition, temp_map, temp);
3916 HeapObject::kMapOffset,
3917 temp_map,
3918 temp,
3919 OMIT_REMEMBERED_SET,
3920 OMIT_SMI_CHECK);
3921 } 3915 }
3922 } 3916 }
3923 3917
3924 // Do the store. 3918 // Do the store.
3925 Register write_register = object; 3919 Register write_register = object;
3926 if (!access.IsInobject()) { 3920 if (!access.IsInobject()) {
3927 write_register = ToRegister(instr->temp()); 3921 write_register = ToRegister(instr->temp());
3928 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); 3922 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
3929 } 3923 }
3930 3924
(...skipping 19 matching lines...) Expand all
3950 3944
3951 if (instr->hydrogen()->NeedsWriteBarrier()) { 3945 if (instr->hydrogen()->NeedsWriteBarrier()) {
3952 Register value = ToRegister(instr->value()); 3946 Register value = ToRegister(instr->value());
3953 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; 3947 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object;
3954 // Update the write barrier for the object for in-object properties. 3948 // Update the write barrier for the object for in-object properties.
3955 __ RecordWriteField(write_register, 3949 __ RecordWriteField(write_register,
3956 offset, 3950 offset,
3957 value, 3951 value,
3958 temp, 3952 temp,
3959 EMIT_REMEMBERED_SET, 3953 EMIT_REMEMBERED_SET,
3960 instr->hydrogen()->SmiCheckForWriteBarrier()); 3954 instr->hydrogen()->SmiCheckForWriteBarrier(),
3955 instr->hydrogen()->PointersToHereCheckForValue());
3961 } 3956 }
3962 } 3957 }
3963 3958
3964 3959
3965 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 3960 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
3966 ASSERT(ToRegister(instr->context()).is(esi)); 3961 ASSERT(ToRegister(instr->context()).is(esi));
3967 ASSERT(ToRegister(instr->object()).is(edx)); 3962 ASSERT(ToRegister(instr->object()).is(edx));
3968 ASSERT(ToRegister(instr->value()).is(eax)); 3963 ASSERT(ToRegister(instr->value()).is(eax));
3969 3964
3970 __ mov(ecx, instr->name()); 3965 __ mov(ecx, instr->name());
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 ASSERT(!instr->key()->IsConstantOperand()); 4143 ASSERT(!instr->key()->IsConstantOperand());
4149 SmiCheck check_needed = 4144 SmiCheck check_needed =
4150 instr->hydrogen()->value()->type().IsHeapObject() 4145 instr->hydrogen()->value()->type().IsHeapObject()
4151 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4146 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4152 // Compute address of modified element and store it into key register. 4147 // Compute address of modified element and store it into key register.
4153 __ lea(key, operand); 4148 __ lea(key, operand);
4154 __ RecordWrite(elements, 4149 __ RecordWrite(elements,
4155 key, 4150 key,
4156 value, 4151 value,
4157 EMIT_REMEMBERED_SET, 4152 EMIT_REMEMBERED_SET,
4158 check_needed); 4153 check_needed,
4154 instr->hydrogen()->PointersToHereCheckForValue());
4159 } 4155 }
4160 } 4156 }
4161 4157
4162 4158
4163 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { 4159 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
4164 // By cases...external, fast-double, fast 4160 // By cases...external, fast-double, fast
4165 if (instr->is_typed_elements()) { 4161 if (instr->is_typed_elements()) {
4166 DoStoreKeyedExternalArray(instr); 4162 DoStoreKeyedExternalArray(instr);
4167 } else if (instr->hydrogen()->value()->representation().IsDouble()) { 4163 } else if (instr->hydrogen()->value()->representation().IsDouble()) {
4168 DoStoreKeyedFixedDoubleArray(instr); 4164 DoStoreKeyedFixedDoubleArray(instr);
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
5682 __ bind(deferred->exit()); 5678 __ bind(deferred->exit());
5683 __ bind(&done); 5679 __ bind(&done);
5684 } 5680 }
5685 5681
5686 5682
5687 #undef __ 5683 #undef __
5688 5684
5689 } } // namespace v8::internal 5685 } } // namespace v8::internal
5690 5686
5691 #endif // V8_TARGET_ARCH_X87 5687 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698