OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 "src/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-stub-assembler.h" | 7 #include "src/code-stub-assembler.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/keyed-store-generic.h" | 10 #include "src/ic/keyed-store-generic.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 Label slow(this); | 180 Label slow(this); |
181 { | 181 { |
182 Node* properties = LoadProperties(receiver); | 182 Node* properties = LoadProperties(receiver); |
183 Variable var_name_index(this, MachineType::PointerRepresentation()); | 183 Variable var_name_index(this, MachineType::PointerRepresentation()); |
184 Label found(this, &var_name_index); | 184 Label found(this, &var_name_index); |
185 NameDictionaryLookup<NameDictionary>(properties, name, &found, | 185 NameDictionaryLookup<NameDictionary>(properties, name, &found, |
186 &var_name_index, &slow); | 186 &var_name_index, &slow); |
187 Bind(&found); | 187 Bind(&found); |
188 { | 188 { |
189 const int kNameToDetailsOffset = (NameDictionary::kEntryDetailsIndex - | 189 Node* details = LoadDetailsForKeyIndex<NameDictionary>( |
190 NameDictionary::kEntryKeyIndex) * | 190 properties, var_name_index.value()); |
191 kPointerSize; | |
192 Node* details = LoadFixedArrayElement(properties, var_name_index.value(), | |
193 kNameToDetailsOffset); | |
194 // Check that the property is a writable data property (no accessor). | 191 // Check that the property is a writable data property (no accessor). |
195 const int kTypeAndReadOnlyMask = PropertyDetails::KindField::kMask | | 192 const int kTypeAndReadOnlyMask = PropertyDetails::KindField::kMask | |
196 PropertyDetails::kAttributesReadOnlyMask; | 193 PropertyDetails::kAttributesReadOnlyMask; |
197 STATIC_ASSERT(kData == 0); | 194 STATIC_ASSERT(kData == 0); |
198 GotoIf(IsSetSmi(details, kTypeAndReadOnlyMask), &slow); | 195 GotoIf(IsSetWord32(details, kTypeAndReadOnlyMask), &slow); |
199 const int kNameToValueOffset = | 196 StoreValueForKeyIndex<NameDictionary>(properties, var_name_index.value(), |
200 (NameDictionary::kEntryValueIndex - NameDictionary::kEntryKeyIndex) * | 197 value); |
201 kPointerSize; | |
202 StoreFixedArrayElement(properties, var_name_index.value(), value, | |
203 UPDATE_WRITE_BARRIER, kNameToValueOffset); | |
204 Return(value); | 198 Return(value); |
205 } | 199 } |
206 } | 200 } |
207 | 201 |
208 Bind(&slow); | 202 Bind(&slow); |
209 TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector, | 203 TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector, |
210 receiver, name); | 204 receiver, name); |
211 } | 205 } |
212 | 206 |
213 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { | 207 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { |
214 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm); | 208 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm); |
215 } | 209 } |
216 | 210 |
217 } // namespace internal | 211 } // namespace internal |
218 } // namespace v8 | 212 } // namespace v8 |
OLD | NEW |