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

Side by Side Diff: src/arm64/lithium-codegen-arm64.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/arm/macro-assembler-arm.cc ('k') | src/arm64/macro-assembler-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/stub-cache.h" 10 #include "src/stub-cache.h"
(...skipping 5302 matching lines...) Expand 10 before | Expand all | Expand 10 after
5313 if (instr->hydrogen()->NeedsWriteBarrier()) { 5313 if (instr->hydrogen()->NeedsWriteBarrier()) {
5314 ASSERT(representation.IsTagged()); 5314 ASSERT(representation.IsTagged());
5315 // This assignment may cause element_addr to alias store_base. 5315 // This assignment may cause element_addr to alias store_base.
5316 Register element_addr = scratch; 5316 Register element_addr = scratch;
5317 SmiCheck check_needed = 5317 SmiCheck check_needed =
5318 instr->hydrogen()->value()->type().IsHeapObject() 5318 instr->hydrogen()->value()->type().IsHeapObject()
5319 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 5319 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
5320 // Compute address of modified element and store it into key register. 5320 // Compute address of modified element and store it into key register.
5321 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand()); 5321 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand());
5322 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(), 5322 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(),
5323 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed); 5323 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed,
5324 instr->hydrogen()->PointersToHereCheckForValue());
5324 } 5325 }
5325 } 5326 }
5326 5327
5327 5328
5328 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { 5329 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
5329 ASSERT(ToRegister(instr->context()).is(cp)); 5330 ASSERT(ToRegister(instr->context()).is(cp));
5330 ASSERT(ToRegister(instr->object()).Is(x2)); 5331 ASSERT(ToRegister(instr->object()).Is(x2));
5331 ASSERT(ToRegister(instr->key()).Is(x1)); 5332 ASSERT(ToRegister(instr->key()).Is(x1));
5332 ASSERT(ToRegister(instr->value()).Is(x0)); 5333 ASSERT(ToRegister(instr->value()).Is(x0));
5333 5334
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5372 5373
5373 if (instr->hydrogen()->has_transition()) { 5374 if (instr->hydrogen()->has_transition()) {
5374 Handle<Map> transition = instr->hydrogen()->transition_map(); 5375 Handle<Map> transition = instr->hydrogen()->transition_map();
5375 AddDeprecationDependency(transition); 5376 AddDeprecationDependency(transition);
5376 // Store the new map value. 5377 // Store the new map value.
5377 Register new_map_value = ToRegister(instr->temp0()); 5378 Register new_map_value = ToRegister(instr->temp0());
5378 __ Mov(new_map_value, Operand(transition)); 5379 __ Mov(new_map_value, Operand(transition));
5379 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); 5380 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset));
5380 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { 5381 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
5381 // Update the write barrier for the map field. 5382 // Update the write barrier for the map field.
5382 __ RecordWriteField(object, 5383 __ RecordWriteForMap(object,
5383 HeapObject::kMapOffset, 5384 new_map_value,
5384 new_map_value, 5385 ToRegister(instr->temp1()),
5385 ToRegister(instr->temp1()), 5386 GetLinkRegisterState(),
5386 GetLinkRegisterState(), 5387 kSaveFPRegs);
5387 kSaveFPRegs,
5388 OMIT_REMEMBERED_SET,
5389 OMIT_SMI_CHECK);
5390 } 5388 }
5391 } 5389 }
5392 5390
5393 // Do the store. 5391 // Do the store.
5394 Register destination; 5392 Register destination;
5395 if (access.IsInobject()) { 5393 if (access.IsInobject()) {
5396 destination = object; 5394 destination = object;
5397 } else { 5395 } else {
5398 Register temp0 = ToRegister(instr->temp0()); 5396 Register temp0 = ToRegister(instr->temp0());
5399 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5397 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset));
(...skipping 21 matching lines...) Expand all
5421 __ Store(value, FieldMemOperand(destination, offset), representation); 5419 __ Store(value, FieldMemOperand(destination, offset), representation);
5422 } 5420 }
5423 if (instr->hydrogen()->NeedsWriteBarrier()) { 5421 if (instr->hydrogen()->NeedsWriteBarrier()) {
5424 __ RecordWriteField(destination, 5422 __ RecordWriteField(destination,
5425 offset, 5423 offset,
5426 value, // Clobbered. 5424 value, // Clobbered.
5427 ToRegister(instr->temp1()), // Clobbered. 5425 ToRegister(instr->temp1()), // Clobbered.
5428 GetLinkRegisterState(), 5426 GetLinkRegisterState(),
5429 kSaveFPRegs, 5427 kSaveFPRegs,
5430 EMIT_REMEMBERED_SET, 5428 EMIT_REMEMBERED_SET,
5431 instr->hydrogen()->SmiCheckForWriteBarrier()); 5429 instr->hydrogen()->SmiCheckForWriteBarrier(),
5430 instr->hydrogen()->PointersToHereCheckForValue());
5432 } 5431 }
5433 } 5432 }
5434 5433
5435 5434
5436 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 5435 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
5437 ASSERT(ToRegister(instr->context()).is(cp)); 5436 ASSERT(ToRegister(instr->context()).is(cp));
5438 ASSERT(ToRegister(instr->value()).is(x0)); 5437 ASSERT(ToRegister(instr->value()).is(x0));
5439 ASSERT(ToRegister(instr->object()).is(x1)); 5438 ASSERT(ToRegister(instr->object()).is(x1));
5440 5439
5441 // Name must be in x2. 5440 // Name must be in x2.
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
5753 5752
5754 Label not_applicable; 5753 Label not_applicable;
5755 5754
5756 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { 5755 if (IsSimpleMapChangeTransition(from_kind, to_kind)) {
5757 Register temp1 = ToRegister(instr->temp1()); 5756 Register temp1 = ToRegister(instr->temp1());
5758 Register new_map = ToRegister(instr->temp2()); 5757 Register new_map = ToRegister(instr->temp2());
5759 __ CheckMap(object, temp1, from_map, &not_applicable, DONT_DO_SMI_CHECK); 5758 __ CheckMap(object, temp1, from_map, &not_applicable, DONT_DO_SMI_CHECK);
5760 __ Mov(new_map, Operand(to_map)); 5759 __ Mov(new_map, Operand(to_map));
5761 __ Str(new_map, FieldMemOperand(object, HeapObject::kMapOffset)); 5760 __ Str(new_map, FieldMemOperand(object, HeapObject::kMapOffset));
5762 // Write barrier. 5761 // Write barrier.
5763 __ RecordWriteField(object, HeapObject::kMapOffset, new_map, temp1, 5762 __ RecordWriteForMap(object, new_map, temp1, GetLinkRegisterState(),
5764 GetLinkRegisterState(), kDontSaveFPRegs); 5763 kDontSaveFPRegs);
5765 } else { 5764 } else {
5766 { 5765 {
5767 UseScratchRegisterScope temps(masm()); 5766 UseScratchRegisterScope temps(masm());
5768 // Use the temp register only in a restricted scope - the codegen checks 5767 // Use the temp register only in a restricted scope - the codegen checks
5769 // that we do not use any register across a call. 5768 // that we do not use any register across a call.
5770 __ CheckMap(object, temps.AcquireX(), from_map, &not_applicable, 5769 __ CheckMap(object, temps.AcquireX(), from_map, &not_applicable,
5771 DONT_DO_SMI_CHECK); 5770 DONT_DO_SMI_CHECK);
5772 } 5771 }
5773 ASSERT(object.is(x0)); 5772 ASSERT(object.is(x0));
5774 ASSERT(ToRegister(instr->context()).is(cp)); 5773 ASSERT(ToRegister(instr->context()).is(cp));
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
6034 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 6033 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
6035 // Index is equal to negated out of object property index plus 1. 6034 // Index is equal to negated out of object property index plus 1.
6036 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 6035 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
6037 __ Ldr(result, FieldMemOperand(result, 6036 __ Ldr(result, FieldMemOperand(result,
6038 FixedArray::kHeaderSize - kPointerSize)); 6037 FixedArray::kHeaderSize - kPointerSize));
6039 __ Bind(deferred->exit()); 6038 __ Bind(deferred->exit());
6040 __ Bind(&done); 6039 __ Bind(&done);
6041 } 6040 }
6042 6041
6043 } } // namespace v8::internal 6042 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/arm64/macro-assembler-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698