Skip to content

[v4.x] deps: revert/re-apply 09db540 from upstream v8 #14829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 103
#define V8_PATCH_LEVEL 48
#define V8_PATCH_LEVEL 49

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
7 changes: 0 additions & 7 deletions deps/v8/src/heap/mark-compact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 0 additions & 4 deletions deps/v8/src/heap/mark-compact.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
13 changes: 1 addition & 12 deletions deps/v8/src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14677,7 +14677,6 @@ Handle<CompilationCacheTable> 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;
Expand All @@ -14701,16 +14700,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);
}


Expand Down Expand Up @@ -15219,7 +15208,7 @@ Handle<ObjectHashTable> ObjectHashTable::Put(Handle<ObjectHashTable> table,
return table;
}

// Rehash if more than 25% of the entries are deleted entries.
// Rehash if more than 33% 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());
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/test/cctest/test-weakmaps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
4 changes: 2 additions & 2 deletions deps/v8/test/cctest/test-weaksets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}


Expand Down