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

Side by Side Diff: src/builtins/builtins-handler.cc

Issue 2688573003: [cleanup] CSA: add helpers for accessing details/value via key_index (Closed)
Patch Set: rebased Created 3 years, 10 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
« no previous file with comments | « no previous file | src/code-stub-assembler.h » ('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 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 Label slow(this); 233 Label slow(this);
234 { 234 {
235 Node* properties = LoadProperties(receiver); 235 Node* properties = LoadProperties(receiver);
236 Variable var_name_index(this, MachineType::PointerRepresentation()); 236 Variable var_name_index(this, MachineType::PointerRepresentation());
237 Label found(this, &var_name_index); 237 Label found(this, &var_name_index);
238 NameDictionaryLookup<NameDictionary>(properties, name, &found, 238 NameDictionaryLookup<NameDictionary>(properties, name, &found,
239 &var_name_index, &slow); 239 &var_name_index, &slow);
240 Bind(&found); 240 Bind(&found);
241 { 241 {
242 const int kNameToDetailsOffset = (NameDictionary::kEntryDetailsIndex - 242 Node* details = LoadDetailsByKeyIndex<NameDictionary>(
243 NameDictionary::kEntryKeyIndex) * 243 properties, var_name_index.value());
244 kPointerSize;
245 Node* details = LoadFixedArrayElement(properties, var_name_index.value(),
246 kNameToDetailsOffset);
247 // Check that the property is a writable data property (no accessor). 244 // Check that the property is a writable data property (no accessor).
248 const int kTypeAndReadOnlyMask = PropertyDetails::KindField::kMask | 245 const int kTypeAndReadOnlyMask = PropertyDetails::KindField::kMask |
249 PropertyDetails::kAttributesReadOnlyMask; 246 PropertyDetails::kAttributesReadOnlyMask;
250 STATIC_ASSERT(kData == 0); 247 STATIC_ASSERT(kData == 0);
251 GotoIf(IsSetSmi(details, kTypeAndReadOnlyMask), &slow); 248 GotoIf(IsSetWord32(details, kTypeAndReadOnlyMask), &slow);
252 const int kNameToValueOffset = 249 StoreValueByKeyIndex<NameDictionary>(properties, var_name_index.value(),
253 (NameDictionary::kEntryValueIndex - NameDictionary::kEntryKeyIndex) * 250 value);
254 kPointerSize;
255 StoreFixedArrayElement(properties, var_name_index.value(), value,
256 UPDATE_WRITE_BARRIER, kNameToValueOffset);
257 Return(value); 251 Return(value);
258 } 252 }
259 } 253 }
260 254
261 Bind(&slow); 255 Bind(&slow);
262 TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector, 256 TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector,
263 receiver, name); 257 receiver, name);
264 } 258 }
265 259
266 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { 260 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) {
267 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm); 261 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm);
268 } 262 }
269 263
270 } // namespace internal 264 } // namespace internal
271 } // namespace v8 265 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698