[runtime] Use Dictionary::Add in Dictionary::AtPut

Bug: 
Change-Id: Ib0090647de77510ce5f3bda67e45c7d7474ac779
Reviewed-on: https://chromium-review.googlesource.com/541337
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46040}
This commit is contained in:
Toon Verwaest 2017-06-20 11:16:20 +02:00 committed by Commit Bot
parent b38795f372
commit d00b37fb19
2 changed files with 5 additions and 11 deletions

View File

@ -17773,15 +17773,7 @@ Handle<Derived> Dictionary<Derived, Shape>::AtPut(Handle<Derived> dictionary,
return dictionary;
}
// Check whether the dictionary should be extended.
dictionary = EnsureCapacity(dictionary, 1);
#ifdef DEBUG
USE(Shape::AsHandle(dictionary->GetIsolate(), key));
#endif
PropertyDetails details = PropertyDetails::Empty();
AddEntry(dictionary, key, value, details, dictionary->Hash(key));
return dictionary;
return Add(dictionary, key, value, PropertyDetails::Empty());
}
template <typename Derived, typename Shape>
@ -17794,6 +17786,10 @@ Handle<Derived> Dictionary<Derived, Shape>::Add(Handle<Derived> dictionary,
// Check whether the dictionary should be extended.
dictionary = EnsureCapacity(dictionary, 1);
#ifdef DEBUG
USE(Shape::AsHandle(dictionary->GetIsolate(), key));
#endif
int entry = AddEntry(dictionary, key, value, details, dictionary->Hash(key));
if (entry_out) *entry_out = entry;
return dictionary;

View File

@ -63,8 +63,6 @@ class Dictionary : public HashTable<Derived, Shape> {
int NumberOfEnumerableProperties();
enum SortMode { UNSORTED, SORTED };
// Return the key indices sorted by its enumeration index.
static Handle<FixedArray> IterationIndices(
Handle<Dictionary<Derived, Shape>> dictionary);