OLD | NEW |
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 Loading... |
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 dictionary = SeededNumberDictionary::Set(dictionary, index_, pair, details, | 529 // We unconditionally pass used_as_prototype=false here because the call |
530 receiver); | 530 // to RequireSlowElements takes care of the required IC clearing and |
| 531 // we don't want to walk the heap twice. |
| 532 dictionary = |
| 533 SeededNumberDictionary::Set(dictionary, index_, pair, details, false); |
531 receiver->RequireSlowElements(*dictionary); | 534 receiver->RequireSlowElements(*dictionary); |
532 | 535 |
533 if (receiver->HasSlowArgumentsElements()) { | 536 if (receiver->HasSlowArgumentsElements()) { |
534 FixedArray* parameter_map = FixedArray::cast(receiver->elements()); | 537 FixedArray* parameter_map = FixedArray::cast(receiver->elements()); |
535 uint32_t length = parameter_map->length() - 2; | 538 uint32_t length = parameter_map->length() - 2; |
536 if (number_ < length) { | 539 if (number_ < length) { |
537 parameter_map->set(number_ + 2, heap()->the_hole_value()); | 540 parameter_map->set(number_ + 2, heap()->the_hole_value()); |
538 } | 541 } |
539 FixedArray::cast(receiver->elements())->set(1, *dictionary); | 542 FixedArray::cast(receiver->elements())->set(1, *dictionary); |
540 } else { | 543 } else { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 873 |
871 // We have found a cached property! Modify the iterator accordingly. | 874 // We have found a cached property! Modify the iterator accordingly. |
872 name_ = maybe_name.ToHandleChecked(); | 875 name_ = maybe_name.ToHandleChecked(); |
873 Restart(); | 876 Restart(); |
874 CHECK_EQ(state(), LookupIterator::DATA); | 877 CHECK_EQ(state(), LookupIterator::DATA); |
875 return true; | 878 return true; |
876 } | 879 } |
877 | 880 |
878 } // namespace internal | 881 } // namespace internal |
879 } // namespace v8 | 882 } // namespace v8 |
OLD | NEW |