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

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

Issue 306483013: X87: Avoid HeapObject check in HStoreNamedField. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | src/x87/lithium-x87.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 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 "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "x87/lithium-codegen-x87.h" 9 #include "x87/lithium-codegen-x87.h"
10 #include "ic.h" 10 #include "ic.h"
(...skipping 3870 matching lines...) Expand 10 before | Expand all | Expand 10 after
3881 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); 3881 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
3882 __ mov(operand, Immediate(ToInteger32(operand_value))); 3882 __ mov(operand, Immediate(ToInteger32(operand_value)));
3883 } else { 3883 } else {
3884 Register value = ToRegister(instr->value()); 3884 Register value = ToRegister(instr->value());
3885 __ Store(value, operand, representation); 3885 __ Store(value, operand, representation);
3886 } 3886 }
3887 return; 3887 return;
3888 } 3888 }
3889 3889
3890 Register object = ToRegister(instr->object()); 3890 Register object = ToRegister(instr->object());
3891 SmiCheck check_needed = 3891 __ AssertNotSmi(object);
3892 instr->hydrogen()->value()->IsHeapObject() 3892 ASSERT(!representation.IsSmi() ||
3893 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 3893 !instr->value()->IsConstantOperand() ||
3894 3894 IsSmi(LConstantOperand::cast(instr->value())));
3895 ASSERT(!(representation.IsSmi() && 3895 if (representation.IsDouble()) {
3896 instr->value()->IsConstantOperand() &&
3897 !IsSmi(LConstantOperand::cast(instr->value()))));
3898 if (representation.IsHeapObject()) {
3899 if (instr->value()->IsConstantOperand()) {
3900 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
3901 if (chunk_->LookupConstant(operand_value)->HasSmiValue()) {
3902 DeoptimizeIf(no_condition, instr->environment());
3903 }
3904 } else {
3905 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
3906 Register value = ToRegister(instr->value());
3907 __ test(value, Immediate(kSmiTagMask));
3908 DeoptimizeIf(zero, instr->environment());
3909
3910 // We know now that value is not a smi, so we can omit the check below.
3911 check_needed = OMIT_SMI_CHECK;
3912 }
3913 }
3914 } else if (representation.IsDouble()) {
3915 ASSERT(access.IsInobject()); 3896 ASSERT(access.IsInobject());
3916 ASSERT(!instr->hydrogen()->has_transition()); 3897 ASSERT(!instr->hydrogen()->has_transition());
3917 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 3898 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
3918 X87Register value = ToX87Register(instr->value()); 3899 X87Register value = ToX87Register(instr->value());
3919 X87Mov(FieldOperand(object, offset), value); 3900 X87Mov(FieldOperand(object, offset), value);
3920 return; 3901 return;
3921 } 3902 }
3922 3903
3923 if (instr->hydrogen()->has_transition()) { 3904 if (instr->hydrogen()->has_transition()) {
3924 Handle<Map> transition = instr->hydrogen()->transition_map(); 3905 Handle<Map> transition = instr->hydrogen()->transition_map();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3969 3950
3970 if (instr->hydrogen()->NeedsWriteBarrier()) { 3951 if (instr->hydrogen()->NeedsWriteBarrier()) {
3971 Register value = ToRegister(instr->value()); 3952 Register value = ToRegister(instr->value());
3972 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; 3953 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object;
3973 // Update the write barrier for the object for in-object properties. 3954 // Update the write barrier for the object for in-object properties.
3974 __ RecordWriteField(write_register, 3955 __ RecordWriteField(write_register,
3975 offset, 3956 offset,
3976 value, 3957 value,
3977 temp, 3958 temp,
3978 EMIT_REMEMBERED_SET, 3959 EMIT_REMEMBERED_SET,
3979 check_needed); 3960 instr->hydrogen()->SmiCheckForWriteBarrier());
3980 } 3961 }
3981 } 3962 }
3982 3963
3983 3964
3984 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 3965 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
3985 ASSERT(ToRegister(instr->context()).is(esi)); 3966 ASSERT(ToRegister(instr->context()).is(esi));
3986 ASSERT(ToRegister(instr->object()).is(edx)); 3967 ASSERT(ToRegister(instr->object()).is(edx));
3987 ASSERT(ToRegister(instr->value()).is(eax)); 3968 ASSERT(ToRegister(instr->value()).is(eax));
3988 3969
3989 __ mov(ecx, instr->name()); 3970 __ mov(ecx, instr->name());
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
5710 __ bind(deferred->exit()); 5691 __ bind(deferred->exit());
5711 __ bind(&done); 5692 __ bind(&done);
5712 } 5693 }
5713 5694
5714 5695
5715 #undef __ 5696 #undef __
5716 5697
5717 } } // namespace v8::internal 5698 } } // namespace v8::internal
5718 5699
5719 #endif // V8_TARGET_ARCH_X87 5700 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/lithium-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698