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

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

Issue 299373005: Avoid HeapObject check in HStoreNamedField. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix condition on arm64. 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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/arm64/macro-assembler-arm64.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 5302 matching lines...) Expand 10 before | Expand all | Expand 10 after
5313 Register object = ToRegister(instr->object()); 5313 Register object = ToRegister(instr->object());
5314 HObjectAccess access = instr->hydrogen()->access(); 5314 HObjectAccess access = instr->hydrogen()->access();
5315 int offset = access.offset(); 5315 int offset = access.offset();
5316 5316
5317 if (access.IsExternalMemory()) { 5317 if (access.IsExternalMemory()) {
5318 ASSERT(!instr->hydrogen()->has_transition()); 5318 ASSERT(!instr->hydrogen()->has_transition());
5319 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 5319 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
5320 Register value = ToRegister(instr->value()); 5320 Register value = ToRegister(instr->value());
5321 __ Store(value, MemOperand(object, offset), representation); 5321 __ Store(value, MemOperand(object, offset), representation);
5322 return; 5322 return;
5323 } else if (representation.IsDouble()) { 5323 }
5324
5325 __ AssertNotSmi(object);
5326
5327 if (representation.IsDouble()) {
5324 ASSERT(access.IsInobject()); 5328 ASSERT(access.IsInobject());
5325 ASSERT(!instr->hydrogen()->has_transition()); 5329 ASSERT(!instr->hydrogen()->has_transition());
5326 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 5330 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
5327 FPRegister value = ToDoubleRegister(instr->value()); 5331 FPRegister value = ToDoubleRegister(instr->value());
5328 __ Str(value, FieldMemOperand(object, offset)); 5332 __ Str(value, FieldMemOperand(object, offset));
5329 return; 5333 return;
5330 } 5334 }
5331 5335
5332 Register value = ToRegister(instr->value()); 5336 Register value = ToRegister(instr->value());
5333 5337
5334 SmiCheck check_needed = instr->hydrogen()->value()->IsHeapObject() 5338 ASSERT(!representation.IsSmi() ||
5335 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 5339 !instr->value()->IsConstantOperand() ||
5336 5340 IsInteger32Constant(LConstantOperand::cast(instr->value())));
5337 ASSERT(!(representation.IsSmi() &&
5338 instr->value()->IsConstantOperand() &&
5339 !IsInteger32Constant(LConstantOperand::cast(instr->value()))));
5340 if (representation.IsHeapObject() &&
5341 !instr->hydrogen()->value()->type().IsHeapObject()) {
5342 DeoptimizeIfSmi(value, instr->environment());
5343
5344 // We know now that value is not a smi, so we can omit the check below.
5345 check_needed = OMIT_SMI_CHECK;
5346 }
5347 5341
5348 if (instr->hydrogen()->has_transition()) { 5342 if (instr->hydrogen()->has_transition()) {
5349 Handle<Map> transition = instr->hydrogen()->transition_map(); 5343 Handle<Map> transition = instr->hydrogen()->transition_map();
5350 AddDeprecationDependency(transition); 5344 AddDeprecationDependency(transition);
5351 // Store the new map value. 5345 // Store the new map value.
5352 Register new_map_value = ToRegister(instr->temp0()); 5346 Register new_map_value = ToRegister(instr->temp0());
5353 __ Mov(new_map_value, Operand(transition)); 5347 __ Mov(new_map_value, Operand(transition));
5354 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset)); 5348 __ Str(new_map_value, FieldMemOperand(object, HeapObject::kMapOffset));
5355 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { 5349 if (instr->hydrogen()->NeedsWriteBarrierForMap()) {
5356 // Update the write barrier for the map field. 5350 // Update the write barrier for the map field.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
5396 __ Store(value, FieldMemOperand(destination, offset), representation); 5390 __ Store(value, FieldMemOperand(destination, offset), representation);
5397 } 5391 }
5398 if (instr->hydrogen()->NeedsWriteBarrier()) { 5392 if (instr->hydrogen()->NeedsWriteBarrier()) {
5399 __ RecordWriteField(destination, 5393 __ RecordWriteField(destination,
5400 offset, 5394 offset,
5401 value, // Clobbered. 5395 value, // Clobbered.
5402 ToRegister(instr->temp1()), // Clobbered. 5396 ToRegister(instr->temp1()), // Clobbered.
5403 GetLinkRegisterState(), 5397 GetLinkRegisterState(),
5404 kSaveFPRegs, 5398 kSaveFPRegs,
5405 EMIT_REMEMBERED_SET, 5399 EMIT_REMEMBERED_SET,
5406 check_needed); 5400 instr->hydrogen()->SmiCheckForWriteBarrier());
5407 } 5401 }
5408 } 5402 }
5409 5403
5410 5404
5411 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 5405 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
5412 ASSERT(ToRegister(instr->context()).is(cp)); 5406 ASSERT(ToRegister(instr->context()).is(cp));
5413 ASSERT(ToRegister(instr->value()).is(x0)); 5407 ASSERT(ToRegister(instr->value()).is(x0));
5414 ASSERT(ToRegister(instr->object()).is(x1)); 5408 ASSERT(ToRegister(instr->object()).is(x1));
5415 5409
5416 // Name must be in x2. 5410 // Name must be in x2.
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
6018 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 6012 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
6019 // Index is equal to negated out of object property index plus 1. 6013 // Index is equal to negated out of object property index plus 1.
6020 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); 6014 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2));
6021 __ Ldr(result, FieldMemOperand(result, 6015 __ Ldr(result, FieldMemOperand(result,
6022 FixedArray::kHeaderSize - kPointerSize)); 6016 FixedArray::kHeaderSize - kPointerSize));
6023 __ Bind(deferred->exit()); 6017 __ Bind(deferred->exit());
6024 __ Bind(&done); 6018 __ Bind(&done);
6025 } 6019 }
6026 6020
6027 } } // namespace v8::internal 6021 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/arm64/macro-assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698