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

Side by Side Diff: src/lookup.cc

Issue 1762273002: [LookupIterator] Avoid additional descriptor lookup in TransitionToAccessorProperty (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/objects.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/lookup.h" 5 #include "src/lookup.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
9 #include "src/elements.h" 9 #include "src/elements.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 void LookupIterator::TransitionToAccessorProperty( 374 void LookupIterator::TransitionToAccessorProperty(
375 AccessorComponent component, Handle<Object> accessor, 375 AccessorComponent component, Handle<Object> accessor,
376 PropertyAttributes attributes) { 376 PropertyAttributes attributes) {
377 DCHECK(!accessor->IsNull()); 377 DCHECK(!accessor->IsNull());
378 // Can only be called when the receiver is a JSObject. JSProxy has to be 378 // Can only be called when the receiver is a JSObject. JSProxy has to be
379 // handled via a trap. Adding properties to primitive values is not 379 // handled via a trap. Adding properties to primitive values is not
380 // observable. 380 // observable.
381 Handle<JSObject> receiver = GetStoreTarget(); 381 Handle<JSObject> receiver = GetStoreTarget();
382 382
383 if (!IsElement() && !receiver->map()->is_dictionary_map()) { 383 if (!IsElement() && !receiver->map()->is_dictionary_map()) {
384 holder_ = receiver;
385 Handle<Map> old_map(receiver->map(), isolate_); 384 Handle<Map> old_map(receiver->map(), isolate_);
385
386 if (!holder_.is_identical_to(receiver)) {
387 holder_ = receiver;
388 state_ = NOT_FOUND;
389 } else if (state_ == INTERCEPTOR) {
390 LookupInRegularHolder<false>(*old_map, *holder_);
391 }
392 int descriptor =
393 IsFound() ? static_cast<int>(number_) : DescriptorArray::kNotFound;
394
386 Handle<Map> new_map = Map::TransitionToAccessorProperty( 395 Handle<Map> new_map = Map::TransitionToAccessorProperty(
387 old_map, name_, component, accessor, attributes); 396 old_map, name_, descriptor, component, accessor, attributes);
388 bool simple_transition = new_map->GetBackPointer() == receiver->map(); 397 bool simple_transition = new_map->GetBackPointer() == receiver->map();
389 JSObject::MigrateToMap(receiver, new_map); 398 JSObject::MigrateToMap(receiver, new_map);
390 399
391 if (simple_transition) { 400 if (simple_transition) {
392 int number = new_map->LastAdded(); 401 int number = new_map->LastAdded();
393 number_ = static_cast<uint32_t>(number); 402 number_ = static_cast<uint32_t>(number);
394 property_details_ = new_map->GetLastDescriptorDetails(); 403 property_details_ = new_map->GetLastDescriptorDetails();
395 state_ = ACCESSOR; 404 state_ = ACCESSOR;
396 return; 405 return;
397 } 406 }
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 case v8::internal::kAccessor: 761 case v8::internal::kAccessor:
753 return ACCESSOR; 762 return ACCESSOR;
754 } 763 }
755 764
756 UNREACHABLE(); 765 UNREACHABLE();
757 return state_; 766 return state_;
758 } 767 }
759 768
760 } // namespace internal 769 } // namespace internal
761 } // namespace v8 770 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698