OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4049 HObjectAccess access = instr->hydrogen()->access(); | 4049 HObjectAccess access = instr->hydrogen()->access(); |
4050 int offset = access.offset(); | 4050 int offset = access.offset(); |
4051 | 4051 |
4052 if (access.IsExternalMemory()) { | 4052 if (access.IsExternalMemory()) { |
4053 Register value = ToRegister(instr->value()); | 4053 Register value = ToRegister(instr->value()); |
4054 MemOperand operand = MemOperand(object, offset); | 4054 MemOperand operand = MemOperand(object, offset); |
4055 __ Store(value, operand, representation); | 4055 __ Store(value, operand, representation); |
4056 return; | 4056 return; |
4057 } | 4057 } |
4058 | 4058 |
4059 SmiCheck check_needed = | 4059 __ AssertNotSmi(object); |
4060 instr->hydrogen()->value()->IsHeapObject() | |
4061 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
4062 | 4060 |
4063 ASSERT(!(representation.IsSmi() && | 4061 ASSERT(!representation.IsSmi() || |
4064 instr->value()->IsConstantOperand() && | 4062 !instr->value()->IsConstantOperand() || |
4065 !IsSmi(LConstantOperand::cast(instr->value())))); | 4063 IsSmi(LConstantOperand::cast(instr->value()))); |
4066 if (representation.IsHeapObject()) { | 4064 if (representation.IsDouble()) { |
4067 Register value = ToRegister(instr->value()); | |
4068 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | |
4069 __ SmiTst(value, scratch); | |
4070 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); | |
4071 | |
4072 // We know now that value is not a smi, so we can omit the check below. | |
4073 check_needed = OMIT_SMI_CHECK; | |
4074 } | |
4075 } else if (representation.IsDouble()) { | |
4076 ASSERT(access.IsInobject()); | 4065 ASSERT(access.IsInobject()); |
4077 ASSERT(!instr->hydrogen()->has_transition()); | 4066 ASSERT(!instr->hydrogen()->has_transition()); |
4078 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4067 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4079 DoubleRegister value = ToDoubleRegister(instr->value()); | 4068 DoubleRegister value = ToDoubleRegister(instr->value()); |
4080 __ sdc1(value, FieldMemOperand(object, offset)); | 4069 __ sdc1(value, FieldMemOperand(object, offset)); |
4081 return; | 4070 return; |
4082 } | 4071 } |
4083 | 4072 |
4084 if (instr->hydrogen()->has_transition()) { | 4073 if (instr->hydrogen()->has_transition()) { |
4085 Handle<Map> transition = instr->hydrogen()->transition_map(); | 4074 Handle<Map> transition = instr->hydrogen()->transition_map(); |
(...skipping 21 matching lines...) Expand all Loading... |
4107 __ Store(value, operand, representation); | 4096 __ Store(value, operand, representation); |
4108 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4097 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4109 // Update the write barrier for the object for in-object properties. | 4098 // Update the write barrier for the object for in-object properties. |
4110 __ RecordWriteField(object, | 4099 __ RecordWriteField(object, |
4111 offset, | 4100 offset, |
4112 value, | 4101 value, |
4113 scratch, | 4102 scratch, |
4114 GetRAState(), | 4103 GetRAState(), |
4115 kSaveFPRegs, | 4104 kSaveFPRegs, |
4116 EMIT_REMEMBERED_SET, | 4105 EMIT_REMEMBERED_SET, |
4117 check_needed); | 4106 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4118 } | 4107 } |
4119 } else { | 4108 } else { |
4120 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4109 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4121 MemOperand operand = FieldMemOperand(scratch, offset); | 4110 MemOperand operand = FieldMemOperand(scratch, offset); |
4122 __ Store(value, operand, representation); | 4111 __ Store(value, operand, representation); |
4123 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4112 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4124 // Update the write barrier for the properties array. | 4113 // Update the write barrier for the properties array. |
4125 // object is used as a scratch register. | 4114 // object is used as a scratch register. |
4126 __ RecordWriteField(scratch, | 4115 __ RecordWriteField(scratch, |
4127 offset, | 4116 offset, |
4128 value, | 4117 value, |
4129 object, | 4118 object, |
4130 GetRAState(), | 4119 GetRAState(), |
4131 kSaveFPRegs, | 4120 kSaveFPRegs, |
4132 EMIT_REMEMBERED_SET, | 4121 EMIT_REMEMBERED_SET, |
4133 check_needed); | 4122 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4134 } | 4123 } |
4135 } | 4124 } |
4136 } | 4125 } |
4137 | 4126 |
4138 | 4127 |
4139 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4128 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4140 ASSERT(ToRegister(instr->context()).is(cp)); | 4129 ASSERT(ToRegister(instr->context()).is(cp)); |
4141 ASSERT(ToRegister(instr->object()).is(a1)); | 4130 ASSERT(ToRegister(instr->object()).is(a1)); |
4142 ASSERT(ToRegister(instr->value()).is(a0)); | 4131 ASSERT(ToRegister(instr->value()).is(a0)); |
4143 | 4132 |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5888 __ lw(result, FieldMemOperand(scratch, | 5877 __ lw(result, FieldMemOperand(scratch, |
5889 FixedArray::kHeaderSize - kPointerSize)); | 5878 FixedArray::kHeaderSize - kPointerSize)); |
5890 __ bind(deferred->exit()); | 5879 __ bind(deferred->exit()); |
5891 __ bind(&done); | 5880 __ bind(&done); |
5892 } | 5881 } |
5893 | 5882 |
5894 | 5883 |
5895 #undef __ | 5884 #undef __ |
5896 | 5885 |
5897 } } // namespace v8::internal | 5886 } } // namespace v8::internal |
OLD | NEW |