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

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

Issue 297763006: Improve write barriers in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE 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 | « src/hydrogen-instructions.h ('k') | src/ia32/macro-assembler-ia32.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_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/ia32/lithium-codegen-ia32.h" 9 #include "src/ia32/lithium-codegen-ia32.h"
10 #include "src/ic.h" 10 #include "src/ic.h"
(...skipping 3977 matching lines...) Expand 10 before | Expand all | Expand 10 after
3988 ASSERT(!instr->hydrogen()->has_transition()); 3988 ASSERT(!instr->hydrogen()->has_transition());
3989 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 3989 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
3990 XMMRegister value = ToDoubleRegister(instr->value()); 3990 XMMRegister value = ToDoubleRegister(instr->value());
3991 __ movsd(FieldOperand(object, offset), value); 3991 __ movsd(FieldOperand(object, offset), value);
3992 return; 3992 return;
3993 } 3993 }
3994 3994
3995 if (instr->hydrogen()->has_transition()) { 3995 if (instr->hydrogen()->has_transition()) {
3996 Handle<Map> transition = instr->hydrogen()->transition_map(); 3996 Handle<Map> transition = instr->hydrogen()->transition_map();
3997 AddDeprecationDependency(transition); 3997 AddDeprecationDependency(transition);
3998 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { 3998 __ mov(FieldOperand(object, HeapObject::kMapOffset), transition);
3999 __ mov(FieldOperand(object, HeapObject::kMapOffset), transition); 3999 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
4000 } else {
4001 Register temp = ToRegister(instr->temp()); 4000 Register temp = ToRegister(instr->temp());
4002 Register temp_map = ToRegister(instr->temp_map()); 4001 Register temp_map = ToRegister(instr->temp_map());
4003 __ mov(temp_map, transition);
4004 __ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map);
4005 // Update the write barrier for the map field. 4002 // Update the write barrier for the map field.
4006 __ RecordWriteField(object, 4003 __ RecordWriteForMap(object, transition, temp_map, temp, kSaveFPRegs);
4007 HeapObject::kMapOffset,
4008 temp_map,
4009 temp,
4010 kSaveFPRegs,
4011 OMIT_REMEMBERED_SET,
4012 OMIT_SMI_CHECK);
4013 } 4004 }
4014 } 4005 }
4015 4006
4016 // Do the store. 4007 // Do the store.
4017 Register write_register = object; 4008 Register write_register = object;
4018 if (!access.IsInobject()) { 4009 if (!access.IsInobject()) {
4019 write_register = ToRegister(instr->temp()); 4010 write_register = ToRegister(instr->temp());
4020 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); 4011 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
4021 } 4012 }
4022 4013
(...skipping 20 matching lines...) Expand all
4043 if (instr->hydrogen()->NeedsWriteBarrier()) { 4034 if (instr->hydrogen()->NeedsWriteBarrier()) {
4044 Register value = ToRegister(instr->value()); 4035 Register value = ToRegister(instr->value());
4045 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; 4036 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object;
4046 // Update the write barrier for the object for in-object properties. 4037 // Update the write barrier for the object for in-object properties.
4047 __ RecordWriteField(write_register, 4038 __ RecordWriteField(write_register,
4048 offset, 4039 offset,
4049 value, 4040 value,
4050 temp, 4041 temp,
4051 kSaveFPRegs, 4042 kSaveFPRegs,
4052 EMIT_REMEMBERED_SET, 4043 EMIT_REMEMBERED_SET,
4053 instr->hydrogen()->SmiCheckForWriteBarrier()); 4044 instr->hydrogen()->SmiCheckForWriteBarrier(),
4045 instr->hydrogen()->PointersToHereCheckForValue());
4054 } 4046 }
4055 } 4047 }
4056 4048
4057 4049
4058 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4050 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4059 ASSERT(ToRegister(instr->context()).is(esi)); 4051 ASSERT(ToRegister(instr->context()).is(esi));
4060 ASSERT(ToRegister(instr->object()).is(edx)); 4052 ASSERT(ToRegister(instr->object()).is(edx));
4061 ASSERT(ToRegister(instr->value()).is(eax)); 4053 ASSERT(ToRegister(instr->value()).is(eax));
4062 4054
4063 __ mov(ecx, instr->name()); 4055 __ mov(ecx, instr->name());
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4212 SmiCheck check_needed = 4204 SmiCheck check_needed =
4213 instr->hydrogen()->value()->type().IsHeapObject() 4205 instr->hydrogen()->value()->type().IsHeapObject()
4214 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4206 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4215 // Compute address of modified element and store it into key register. 4207 // Compute address of modified element and store it into key register.
4216 __ lea(key, operand); 4208 __ lea(key, operand);
4217 __ RecordWrite(elements, 4209 __ RecordWrite(elements,
4218 key, 4210 key,
4219 value, 4211 value,
4220 kSaveFPRegs, 4212 kSaveFPRegs,
4221 EMIT_REMEMBERED_SET, 4213 EMIT_REMEMBERED_SET,
4222 check_needed); 4214 check_needed,
4215 instr->hydrogen()->PointersToHereCheckForValue());
4223 } 4216 }
4224 } 4217 }
4225 4218
4226 4219
4227 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { 4220 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
4228 // By cases...external, fast-double, fast 4221 // By cases...external, fast-double, fast
4229 if (instr->is_typed_elements()) { 4222 if (instr->is_typed_elements()) {
4230 DoStoreKeyedExternalArray(instr); 4223 DoStoreKeyedExternalArray(instr);
4231 } else if (instr->hydrogen()->value()->representation().IsDouble()) { 4224 } else if (instr->hydrogen()->value()->representation().IsDouble()) {
4232 DoStoreKeyedFixedDoubleArray(instr); 4225 DoStoreKeyedFixedDoubleArray(instr);
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
5649 __ bind(deferred->exit()); 5642 __ bind(deferred->exit());
5650 __ bind(&done); 5643 __ bind(&done);
5651 } 5644 }
5652 5645
5653 5646
5654 #undef __ 5647 #undef __
5655 5648
5656 } } // namespace v8::internal 5649 } } // namespace v8::internal
5657 5650
5658 #endif // V8_TARGET_ARCH_IA32 5651 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698