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

Side by Side Diff: src/x64/lithium-codegen-x64.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/ia32/macro-assembler-ia32.cc ('k') | src/x64/lithium-x64.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 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "x64/lithium-codegen-x64.h" 9 #include "x64/lithium-codegen-x64.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 3982 matching lines...) Expand 10 before | Expand all | Expand 10 after
3993 LConstantOperand* object = LConstantOperand::cast(instr->object()); 3993 LConstantOperand* object = LConstantOperand::cast(instr->object());
3994 __ store_rax(ToExternalReference(object)); 3994 __ store_rax(ToExternalReference(object));
3995 } else { 3995 } else {
3996 Register object = ToRegister(instr->object()); 3996 Register object = ToRegister(instr->object());
3997 __ Store(MemOperand(object, offset), value, representation); 3997 __ Store(MemOperand(object, offset), value, representation);
3998 } 3998 }
3999 return; 3999 return;
4000 } 4000 }
4001 4001
4002 Register object = ToRegister(instr->object()); 4002 Register object = ToRegister(instr->object());
4003 SmiCheck check_needed = hinstr->value()->IsHeapObject() 4003 __ AssertNotSmi(object);
4004 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4005 4004
4006 ASSERT(!(representation.IsSmi() && 4005 ASSERT(!representation.IsSmi() ||
4007 instr->value()->IsConstantOperand() && 4006 !instr->value()->IsConstantOperand() ||
4008 !IsInteger32Constant(LConstantOperand::cast(instr->value())))); 4007 IsInteger32Constant(LConstantOperand::cast(instr->value())));
4009 if (representation.IsHeapObject()) { 4008 if (representation.IsDouble()) {
4010 if (instr->value()->IsConstantOperand()) {
4011 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4012 if (chunk_->LookupConstant(operand_value)->HasSmiValue()) {
4013 DeoptimizeIf(no_condition, instr->environment());
4014 }
4015 } else {
4016 if (!hinstr->value()->type().IsHeapObject()) {
4017 Register value = ToRegister(instr->value());
4018 Condition cc = masm()->CheckSmi(value);
4019 DeoptimizeIf(cc, instr->environment());
4020
4021 // We know now that value is not a smi, so we can omit the check below.
4022 check_needed = OMIT_SMI_CHECK;
4023 }
4024 }
4025 } else if (representation.IsDouble()) {
4026 ASSERT(access.IsInobject()); 4009 ASSERT(access.IsInobject());
4027 ASSERT(!hinstr->has_transition()); 4010 ASSERT(!hinstr->has_transition());
4028 ASSERT(!hinstr->NeedsWriteBarrier()); 4011 ASSERT(!hinstr->NeedsWriteBarrier());
4029 XMMRegister value = ToDoubleRegister(instr->value()); 4012 XMMRegister value = ToDoubleRegister(instr->value());
4030 __ movsd(FieldOperand(object, offset), value); 4013 __ movsd(FieldOperand(object, offset), value);
4031 return; 4014 return;
4032 } 4015 }
4033 4016
4034 if (hinstr->has_transition()) { 4017 if (hinstr->has_transition()) {
4035 Handle<Map> transition = hinstr->transition_map(); 4018 Handle<Map> transition = hinstr->transition_map();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
4100 if (hinstr->NeedsWriteBarrier()) { 4083 if (hinstr->NeedsWriteBarrier()) {
4101 Register value = ToRegister(instr->value()); 4084 Register value = ToRegister(instr->value());
4102 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; 4085 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object;
4103 // Update the write barrier for the object for in-object properties. 4086 // Update the write barrier for the object for in-object properties.
4104 __ RecordWriteField(write_register, 4087 __ RecordWriteField(write_register,
4105 offset, 4088 offset,
4106 value, 4089 value,
4107 temp, 4090 temp,
4108 kSaveFPRegs, 4091 kSaveFPRegs,
4109 EMIT_REMEMBERED_SET, 4092 EMIT_REMEMBERED_SET,
4110 check_needed); 4093 hinstr->SmiCheckForWriteBarrier());
4111 } 4094 }
4112 } 4095 }
4113 4096
4114 4097
4115 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 4098 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
4116 ASSERT(ToRegister(instr->context()).is(rsi)); 4099 ASSERT(ToRegister(instr->context()).is(rsi));
4117 ASSERT(ToRegister(instr->object()).is(rdx)); 4100 ASSERT(ToRegister(instr->object()).is(rdx));
4118 ASSERT(ToRegister(instr->value()).is(rax)); 4101 ASSERT(ToRegister(instr->value()).is(rax));
4119 4102
4120 __ Move(rcx, instr->hydrogen()->name()); 4103 __ Move(rcx, instr->hydrogen()->name());
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
5711 __ bind(deferred->exit()); 5694 __ bind(deferred->exit());
5712 __ bind(&done); 5695 __ bind(&done);
5713 } 5696 }
5714 5697
5715 5698
5716 #undef __ 5699 #undef __
5717 5700
5718 } } // namespace v8::internal 5701 } } // namespace v8::internal
5719 5702
5720 #endif // V8_TARGET_ARCH_X64 5703 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698