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

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

Issue 295743002: Refactor transitioning stores. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/hydrogen.cc » ('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 "v8.h" 5 #include "v8.h"
6 6
7 #include "arm64/lithium-codegen-arm64.h" 7 #include "arm64/lithium-codegen-arm64.h"
8 #include "arm64/lithium-gap-resolver-arm64.h" 8 #include "arm64/lithium-gap-resolver-arm64.h"
9 #include "code-stubs.h" 9 #include "code-stubs.h"
10 #include "stub-cache.h" 10 #include "stub-cache.h"
(...skipping 5284 matching lines...) Expand 10 before | Expand all | Expand 10 after
5295 5295
5296 5296
5297 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { 5297 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
5298 Representation representation = instr->representation(); 5298 Representation representation = instr->representation();
5299 5299
5300 Register object = ToRegister(instr->object()); 5300 Register object = ToRegister(instr->object());
5301 HObjectAccess access = instr->hydrogen()->access(); 5301 HObjectAccess access = instr->hydrogen()->access();
5302 int offset = access.offset(); 5302 int offset = access.offset();
5303 5303
5304 if (access.IsExternalMemory()) { 5304 if (access.IsExternalMemory()) {
5305 ASSERT(!instr->hydrogen()->has_transition());
5306 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 5305 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
5307 Register value = ToRegister(instr->value()); 5306 Register value = ToRegister(instr->value());
5308 __ Store(value, MemOperand(object, offset), representation); 5307 __ Store(value, MemOperand(object, offset), representation);
5309 return; 5308 return;
5310 } else if (representation.IsDouble()) { 5309 } else if (representation.IsDouble()) {
5311 ASSERT(access.IsInobject()); 5310 ASSERT(access.IsInobject());
5312 ASSERT(!instr->hydrogen()->has_transition());
5313 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 5311 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
5314 FPRegister value = ToDoubleRegister(instr->value()); 5312 FPRegister value = ToDoubleRegister(instr->value());
5315 __ Str(value, FieldMemOperand(object, offset)); 5313 __ Str(value, FieldMemOperand(object, offset));
5316 return; 5314 return;
5317 } 5315 }
5318 5316
5319 Register value = ToRegister(instr->value()); 5317 Register value = ToRegister(instr->value());
5320 5318
5321 SmiCheck check_needed = instr->hydrogen()->value()->IsHeapObject() 5319 SmiCheck check_needed = instr->hydrogen()->value()->IsHeapObject()
5322 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 5320 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
5323 5321
5324 ASSERT(!(representation.IsSmi() && 5322 ASSERT(!(representation.IsSmi() &&
5325 instr->value()->IsConstantOperand() && 5323 instr->value()->IsConstantOperand() &&
5326 !IsInteger32Constant(LConstantOperand::cast(instr->value())))); 5324 !IsInteger32Constant(LConstantOperand::cast(instr->value()))));
5327 if (representation.IsHeapObject() && 5325 if (representation.IsHeapObject() &&
5328 !instr->hydrogen()->value()->type().IsHeapObject()) { 5326 !instr->hydrogen()->value()->type().IsHeapObject()) {
5329 DeoptimizeIfSmi(value, instr->environment()); 5327 DeoptimizeIfSmi(value, instr->environment());
5330 5328
5331 // We know now that value is not a smi, so we can omit the check below. 5329 // We know now that value is not a smi, so we can omit the check below.
5332 check_needed = OMIT_SMI_CHECK; 5330 check_needed = OMIT_SMI_CHECK;
5333 } 5331 }
5334 5332
5335 if (instr->hydrogen()->has_transition()) {
5336 Handle<Map> transition = instr->hydrogen()->transition_map();
5337 AddDeprecationDependency(transition);
5338 // Store the new map value.
5339 Register new_map_value = ToRegister(instr->temp0());
5340 __ Mov(new_map_value, Operand(transition));
5341 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset));
5342 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
5343 // Update the write barrier for the map field.
5344 __ RecordWriteField(object,
5345 HeapObject::kMapOffset,
5346 new_map_value,
5347 ToRegister(instr->temp1()),
5348 GetLinkRegisterState(),
5349 kSaveFPRegs,
5350 OMIT_REMEMBERED_SET,
5351 OMIT_SMI_CHECK);
5352 }
5353 }
5354
5355 // Do the store. 5333 // Do the store.
5356 Register destination; 5334 Register destination;
5357 if (access.IsInobject()) { 5335 if (access.IsInobject()) {
5358 destination = object; 5336 destination = object;
5359 } else { 5337 } else {
5360 Register temp0 = ToRegister(instr->temp0()); 5338 Register temp0 = ToRegister(instr->temp0());
5361 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5339 __ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset));
5362 destination = temp0; 5340 destination = temp0;
5363 } 5341 }
5364 5342
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
6005 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 5983 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
6006 // Index is equal to negated out of object property index plus 1. 5984 // Index is equal to negated out of object property index plus 1.
6007 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 5985 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
6008 __ Ldr(result, FieldMemOperand(result, 5986 __ Ldr(result, FieldMemOperand(result,
6009 FixedArray::kHeaderSize - kPointerSize)); 5987 FixedArray::kHeaderSize - kPointerSize));
6010 __ Bind(deferred->exit()); 5988 __ Bind(deferred->exit());
6011 __ Bind(&done); 5989 __ Bind(&done);
6012 } 5990 }
6013 5991
6014 } } // namespace v8::internal 5992 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698