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

Side by Side Diff: src/lookup.cc

Issue 2534613002: [ic] Use validity cells to protect keyed element stores against object's prototype chain modificati… (Closed)
Patch Set: The fix Created 4 years 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
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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 holder_ = receiver; 519 holder_ = receiver;
520 520
521 PropertyDetails details(attributes, ACCESSOR_CONSTANT, 0, 521 PropertyDetails details(attributes, ACCESSOR_CONSTANT, 0,
522 PropertyCellType::kMutable); 522 PropertyCellType::kMutable);
523 523
524 if (IsElement()) { 524 if (IsElement()) {
525 // TODO(verwaest): Move code into the element accessor. 525 // TODO(verwaest): Move code into the element accessor.
526 Handle<SeededNumberDictionary> dictionary = 526 Handle<SeededNumberDictionary> dictionary =
527 JSObject::NormalizeElements(receiver); 527 JSObject::NormalizeElements(receiver);
528 528
529 // We unconditionally pass used_as_prototype=false here because the call 529 dictionary = SeededNumberDictionary::Set(dictionary, index_, pair, details,
530 // to RequireSlowElements takes care of the required IC clearing and 530 receiver);
531 // we don't want to walk the heap twice.
532 dictionary =
533 SeededNumberDictionary::Set(dictionary, index_, pair, details, false);
534 receiver->RequireSlowElements(*dictionary); 531 receiver->RequireSlowElements(*dictionary);
535 532
536 if (receiver->HasSlowArgumentsElements()) { 533 if (receiver->HasSlowArgumentsElements()) {
537 FixedArray* parameter_map = FixedArray::cast(receiver->elements()); 534 FixedArray* parameter_map = FixedArray::cast(receiver->elements());
538 uint32_t length = parameter_map->length() - 2; 535 uint32_t length = parameter_map->length() - 2;
539 if (number_ < length) { 536 if (number_ < length) {
540 parameter_map->set(number_ + 2, heap()->the_hole_value()); 537 parameter_map->set(number_ + 2, heap()->the_hole_value());
541 } 538 }
542 FixedArray::cast(receiver->elements())->set(1, *dictionary); 539 FixedArray::cast(receiver->elements())->set(1, *dictionary);
543 } else { 540 } else {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 870
874 // We have found a cached property! Modify the iterator accordingly. 871 // We have found a cached property! Modify the iterator accordingly.
875 name_ = maybe_name.ToHandleChecked(); 872 name_ = maybe_name.ToHandleChecked();
876 Restart(); 873 Restart();
877 CHECK_EQ(state(), LookupIterator::DATA); 874 CHECK_EQ(state(), LookupIterator::DATA);
878 return true; 875 return true;
879 } 876 }
880 877
881 } // namespace internal 878 } // namespace internal
882 } // namespace v8 879 } // namespace v8
OLDNEW
« src/ic/accessor-assembler.cc ('K') | « src/ic/ic-inl.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698