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 4048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4059 HObjectAccess access = instr->hydrogen()->access(); | 4059 HObjectAccess access = instr->hydrogen()->access(); |
4060 int offset = access.offset(); | 4060 int offset = access.offset(); |
4061 | 4061 |
4062 if (access.IsExternalMemory()) { | 4062 if (access.IsExternalMemory()) { |
4063 Register value = ToRegister(instr->value()); | 4063 Register value = ToRegister(instr->value()); |
4064 MemOperand operand = MemOperand(object, offset); | 4064 MemOperand operand = MemOperand(object, offset); |
4065 __ Store(value, operand, representation); | 4065 __ Store(value, operand, representation); |
4066 return; | 4066 return; |
4067 } | 4067 } |
4068 | 4068 |
4069 SmiCheck check_needed = | 4069 __ AssertNotSmi(object); |
4070 instr->hydrogen()->value()->IsHeapObject() | |
4071 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | |
4072 | 4070 |
4073 ASSERT(!(representation.IsSmi() && | 4071 ASSERT(!representation.IsSmi() || |
4074 instr->value()->IsConstantOperand() && | 4072 !instr->value()->IsConstantOperand() || |
4075 !IsSmi(LConstantOperand::cast(instr->value())))); | 4073 IsSmi(LConstantOperand::cast(instr->value()))); |
4076 if (representation.IsHeapObject()) { | 4074 if (representation.IsDouble()) { |
4077 Register value = ToRegister(instr->value()); | |
4078 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | |
4079 __ SmiTst(value, scratch); | |
4080 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); | |
4081 | |
4082 // We know now that value is not a smi, so we can omit the check below. | |
4083 check_needed = OMIT_SMI_CHECK; | |
4084 } | |
4085 } else if (representation.IsDouble()) { | |
4086 ASSERT(access.IsInobject()); | 4075 ASSERT(access.IsInobject()); |
4087 ASSERT(!instr->hydrogen()->has_transition()); | 4076 ASSERT(!instr->hydrogen()->has_transition()); |
4088 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4077 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4089 DoubleRegister value = ToDoubleRegister(instr->value()); | 4078 DoubleRegister value = ToDoubleRegister(instr->value()); |
4090 __ sdc1(value, FieldMemOperand(object, offset)); | 4079 __ sdc1(value, FieldMemOperand(object, offset)); |
4091 return; | 4080 return; |
4092 } | 4081 } |
4093 | 4082 |
4094 if (instr->hydrogen()->has_transition()) { | 4083 if (instr->hydrogen()->has_transition()) { |
4095 Handle<Map> transition = instr->hydrogen()->transition_map(); | 4084 Handle<Map> transition = instr->hydrogen()->transition_map(); |
(...skipping 21 matching lines...) Expand all Loading... |
4117 __ Store(value, operand, representation); | 4106 __ Store(value, operand, representation); |
4118 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4107 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4119 // Update the write barrier for the object for in-object properties. | 4108 // Update the write barrier for the object for in-object properties. |
4120 __ RecordWriteField(object, | 4109 __ RecordWriteField(object, |
4121 offset, | 4110 offset, |
4122 value, | 4111 value, |
4123 scratch, | 4112 scratch, |
4124 GetRAState(), | 4113 GetRAState(), |
4125 kSaveFPRegs, | 4114 kSaveFPRegs, |
4126 EMIT_REMEMBERED_SET, | 4115 EMIT_REMEMBERED_SET, |
4127 check_needed); | 4116 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4128 } | 4117 } |
4129 } else { | 4118 } else { |
4130 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4119 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4131 MemOperand operand = FieldMemOperand(scratch, offset); | 4120 MemOperand operand = FieldMemOperand(scratch, offset); |
4132 __ Store(value, operand, representation); | 4121 __ Store(value, operand, representation); |
4133 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4122 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4134 // Update the write barrier for the properties array. | 4123 // Update the write barrier for the properties array. |
4135 // object is used as a scratch register. | 4124 // object is used as a scratch register. |
4136 __ RecordWriteField(scratch, | 4125 __ RecordWriteField(scratch, |
4137 offset, | 4126 offset, |
4138 value, | 4127 value, |
4139 object, | 4128 object, |
4140 GetRAState(), | 4129 GetRAState(), |
4141 kSaveFPRegs, | 4130 kSaveFPRegs, |
4142 EMIT_REMEMBERED_SET, | 4131 EMIT_REMEMBERED_SET, |
4143 check_needed); | 4132 instr->hydrogen()->SmiCheckForWriteBarrier()); |
4144 } | 4133 } |
4145 } | 4134 } |
4146 } | 4135 } |
4147 | 4136 |
4148 | 4137 |
4149 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4138 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4150 ASSERT(ToRegister(instr->context()).is(cp)); | 4139 ASSERT(ToRegister(instr->context()).is(cp)); |
4151 ASSERT(ToRegister(instr->object()).is(a1)); | 4140 ASSERT(ToRegister(instr->object()).is(a1)); |
4152 ASSERT(ToRegister(instr->value()).is(a0)); | 4141 ASSERT(ToRegister(instr->value()).is(a0)); |
4153 | 4142 |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5898 __ lw(result, FieldMemOperand(scratch, | 5887 __ lw(result, FieldMemOperand(scratch, |
5899 FixedArray::kHeaderSize - kPointerSize)); | 5888 FixedArray::kHeaderSize - kPointerSize)); |
5900 __ bind(deferred->exit()); | 5889 __ bind(deferred->exit()); |
5901 __ bind(&done); | 5890 __ bind(&done); |
5902 } | 5891 } |
5903 | 5892 |
5904 | 5893 |
5905 #undef __ | 5894 #undef __ |
5906 | 5895 |
5907 } } // namespace v8::internal | 5896 } } // namespace v8::internal |
OLD | NEW |