From f4c4c08878d2612ad46e4d035d7b15f243e4bec2 Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Fri, 11 Aug 2017 00:59:37 +0300 Subject: [PATCH] Revert "deps: backport e093a04, 09db540 from upstream V8" This reverts 2d07fd71ee391d099e2f19e85455be6a718c27c9. Also, V8_PATCH_LEVEL++ to 48. --- deps/v8/include/v8-version.h | 3 ++- deps/v8/src/heap/mark-compact.cc | 7 ------- deps/v8/src/heap/mark-compact.h | 4 ---- deps/v8/src/objects.cc | 26 -------------------------- deps/v8/test/cctest/test-weakmaps.cc | 2 +- deps/v8/test/cctest/test-weaksets.cc | 4 ++-- 6 files changed, 5 insertions(+), 41 deletions(-) diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 2101944d14770b..9f2fca6fa6a654 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,8 @@ #define V8_MAJOR_VERSION 4 #define V8_MINOR_VERSION 5 #define V8_BUILD_NUMBER 103 -#define V8_PATCH_LEVEL 47 + +#define V8_PATCH_LEVEL 48 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/heap/mark-compact.cc b/deps/v8/src/heap/mark-compact.cc index c827237598ee43..ef72e577370895 100644 --- a/deps/v8/src/heap/mark-compact.cc +++ b/deps/v8/src/heap/mark-compact.cc @@ -2614,13 +2614,6 @@ void MarkCompactCollector::ClearWeakCollections() { table->RemoveEntry(i); } } - // Rehash if more than 25% of the entries are deleted entries. - // TODO(jochen): Consider to shrink the fixed array in place. - if ((table->NumberOfDeletedElements() << kJSWeakCollectionLoadFactorExp) > - table->NumberOfElements()) { - HandleScope scope(heap()->isolate()); - table->Rehash(heap()->isolate()->factory()->undefined_value()); - } } weak_collection_obj = weak_collection->next(); weak_collection->set_next(heap()->undefined_value()); diff --git a/deps/v8/src/heap/mark-compact.h b/deps/v8/src/heap/mark-compact.h index 379b803f9a4570..9892e0e42c89c4 100644 --- a/deps/v8/src/heap/mark-compact.h +++ b/deps/v8/src/heap/mark-compact.h @@ -612,10 +612,6 @@ class MarkCompactCollector { static const uint32_t kSingleFreeEncoding = 0; static const uint32_t kMultiFreeEncoding = 1; - // If the number of deleted slots in a JSWeakCollection exceeds the number - // of entries / 2^(factor), we rehash the table. - static const int kJSWeakCollectionLoadFactorExp = 1; - static inline bool IsMarked(Object* obj); static bool IsUnmarkedHeapObjectWithHeap(Heap* heap, Object** p); diff --git a/deps/v8/src/objects.cc b/deps/v8/src/objects.cc index 9e2d07e263496b..29eceb9724f003 100644 --- a/deps/v8/src/objects.cc +++ b/deps/v8/src/objects.cc @@ -13744,16 +13744,6 @@ void HashTable::Rehash(Key key) { } } } - // Wipe deleted entries. - Heap* heap = GetHeap(); - Object* the_hole = heap->the_hole_value(); - Object* undefined = heap->undefined_value(); - for (uint32_t current = 0; current < capacity; current++) { - if (get(EntryToIndex(current)) == the_hole) { - set(EntryToIndex(current), undefined); - } - } - SetNumberOfDeletedElements(0); } @@ -14677,7 +14667,6 @@ Handle CompilationCacheTable::PutRegExp( void CompilationCacheTable::Age() { DisallowHeapAllocation no_allocation; Object* the_hole_value = GetHeap()->the_hole_value(); - uint32_t capacity = Capacity(); for (int entry = 0, size = Capacity(); entry < size; entry++) { int entry_index = EntryToIndex(entry); int value_index = entry_index + 1; @@ -14701,16 +14690,6 @@ void CompilationCacheTable::Age() { } } } - // Wipe deleted entries. - Heap* heap = GetHeap(); - Object* the_hole = heap->the_hole_value(); - Object* undefined = heap->undefined_value(); - for (uint32_t current = 0; current < capacity; current++) { - if (get(EntryToIndex(current)) == the_hole) { - set(EntryToIndex(current), undefined); - } - } - SetNumberOfDeletedElements(0); } @@ -15219,11 +15198,6 @@ Handle ObjectHashTable::Put(Handle table, return table; } - // Rehash if more than 25% of the entries are deleted entries. - // TODO(jochen): Consider to shrink the fixed array in place. - if ((table->NumberOfDeletedElements() << 1) > table->NumberOfElements()) { - table->Rehash(isolate->factory()->undefined_value()); - } // If we're out of luck, we didn't get a GC recently, and so rehashing // isn't enough to avoid a crash. if (!table->HasSufficientCapacityToAdd(1)) { diff --git a/deps/v8/test/cctest/test-weakmaps.cc b/deps/v8/test/cctest/test-weakmaps.cc index e84b92f6be1b69..31b812e2874b4b 100644 --- a/deps/v8/test/cctest/test-weakmaps.cc +++ b/deps/v8/test/cctest/test-weakmaps.cc @@ -123,7 +123,7 @@ TEST(Weakness) { heap->CollectAllGarbage(false); CHECK_EQ(1, NumberOfWeakCalls); CHECK_EQ(0, ObjectHashTable::cast(weakmap->table())->NumberOfElements()); - CHECK_EQ(0, + CHECK_EQ(2, ObjectHashTable::cast(weakmap->table())->NumberOfDeletedElements()); } diff --git a/deps/v8/test/cctest/test-weaksets.cc b/deps/v8/test/cctest/test-weaksets.cc index ea3ee29f4469e0..3595af288fb4ea 100644 --- a/deps/v8/test/cctest/test-weaksets.cc +++ b/deps/v8/test/cctest/test-weaksets.cc @@ -122,8 +122,8 @@ TEST(WeakSet_Weakness) { heap->CollectAllGarbage(false); CHECK_EQ(1, NumberOfWeakCalls); CHECK_EQ(0, ObjectHashTable::cast(weakset->table())->NumberOfElements()); - CHECK_EQ(0, - ObjectHashTable::cast(weakset->table())->NumberOfDeletedElements()); + CHECK_EQ( + 1, ObjectHashTable::cast(weakset->table())->NumberOfDeletedElements()); }