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