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

Side by Side Diff: src/objects.cc

Issue 1877233005: Rehash and clear deleted entries in weak collections during GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 8 months 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
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 16839 matching lines...) Expand 10 before | Expand all | Expand 10 after
16850 // The other element will be processed on the next iteration. 16850 // The other element will be processed on the next iteration.
16851 current--; 16851 current--;
16852 } else { 16852 } else {
16853 // The place for the current element is occupied. Leave the element 16853 // The place for the current element is occupied. Leave the element
16854 // for the next probe. 16854 // for the next probe.
16855 done = false; 16855 done = false;
16856 } 16856 }
16857 } 16857 }
16858 } 16858 }
16859 } 16859 }
16860 // Wipe deleted entries.
16861 Heap* heap = GetHeap();
16862 Object* the_hole = heap->the_hole_value();
16863 Object* undefined = heap->undefined_value();
16864 for (uint32_t current = 0; current < capacity; current++) {
16865 if (get(EntryToIndex(current)) == the_hole) {
16866 set(EntryToIndex(current), undefined);
16867 }
16868 }
16869 SetNumberOfDeletedElements(0);
16860 } 16870 }
16861 16871
16862 16872
16863 template<typename Derived, typename Shape, typename Key> 16873 template<typename Derived, typename Shape, typename Key>
16864 Handle<Derived> HashTable<Derived, Shape, Key>::EnsureCapacity( 16874 Handle<Derived> HashTable<Derived, Shape, Key>::EnsureCapacity(
16865 Handle<Derived> table, 16875 Handle<Derived> table,
16866 int n, 16876 int n,
16867 Key key, 16877 Key key,
16868 PretenureFlag pretenure) { 16878 PretenureFlag pretenure) {
16869 Isolate* isolate = table->GetIsolate(); 16879 Isolate* isolate = table->GetIsolate();
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after
19376 if (cell->value() != *new_value) { 19386 if (cell->value() != *new_value) {
19377 cell->set_value(*new_value); 19387 cell->set_value(*new_value);
19378 Isolate* isolate = cell->GetIsolate(); 19388 Isolate* isolate = cell->GetIsolate();
19379 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19389 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19380 isolate, DependentCode::kPropertyCellChangedGroup); 19390 isolate, DependentCode::kPropertyCellChangedGroup);
19381 } 19391 }
19382 } 19392 }
19383 19393
19384 } // namespace internal 19394 } // namespace internal
19385 } // namespace v8 19395 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698