Skip to content

Commit ec81b3e

Browse files
rmacnak-googlecommit-bot@chromium.org
authored and
commit-bot@chromium.org
committed
Revert "[vm] Avoid holding canonical hashes at rest."
This reverts commit b7de866. Reason for revert: assertion failures on reload stress bots Original change's description: > [vm] Avoid holding canonical hashes at rest. > > Canonical hashes are only stored during a round of canonicalization to avoid expontential time in cases such as those in tests/language_2/canonicalization_hasing_*. Clearing them avoids the GC spending time to visit them. > > Bug: #37523 > Change-Id: Icad1fad30dcb7eb95864bea8a26991aeccd7adc6 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125760 > Reviewed-by: Alexander Markov <alexmarkov@google.com> > Reviewed-by: Siva Annamalai <asiva@google.com> > Commit-Queue: Ryan Macnak <rmacnak@google.com> TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com Change-Id: I2e6b29fd1b529d6302ab979acd4757f45bf989ef No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: #37523 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125935 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
1 parent 77ac3d0 commit ec81b3e

File tree

4 files changed

+0
-16
lines changed

4 files changed

+0
-16
lines changed

runtime/vm/heap/marker.cc

-2
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,6 @@ void GCMarker::IterateWeakRoots(HandleVisitor* visitor) {
497497
}
498498

499499
void GCMarker::ProcessWeakTables(PageSpace* page_space) {
500-
TIMELINE_FUNCTION_GC_DURATION(Thread::Current(), "ProcessWeakTables");
501-
502500
for (int sel = 0; sel < Heap::kNumWeakSelectors; sel++) {
503501
WeakTable* table =
504502
heap_->GetWeakTable(Heap::kOld, static_cast<Heap::WeakSelector>(sel));

runtime/vm/heap/scavenger.cc

-2
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,6 @@ uword Scavenger::ProcessWeakProperty(RawWeakProperty* raw_weak,
831831
}
832832

833833
void Scavenger::ProcessWeakReferences() {
834-
TIMELINE_FUNCTION_GC_DURATION(Thread::Current(), "ProcessWeakReferences");
835-
836834
auto rehash_weak_table = [](WeakTable* table, WeakTable* replacement_new,
837835
WeakTable* replacement_old) {
838836
intptr_t size = table->size();

runtime/vm/isolate.cc

-7
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ void Isolate::RehashConstants() {
540540
StackZone stack_zone(thread);
541541
Zone* zone = stack_zone.GetZone();
542542

543-
// Clear any old hashes, which may have become invalid.
544543
thread->heap()->ResetCanonicalHashTable();
545544

546545
Class& cls = Class::Handle(zone);
@@ -558,12 +557,6 @@ void Isolate::RehashConstants() {
558557
cls = class_table()->At(cid);
559558
cls.RehashConstants(zone);
560559
}
561-
562-
// Canonical hashes are only stored during a round of canonicalization to
563-
// avoid expontential time in cases such as those in
564-
// tests/language_2/canonicalization_hasing_*. Clear them after
565-
// canonicalization is done so the GC won't need to update them.
566-
thread->heap()->ResetCanonicalHashTable();
567560
}
568561

569562
#if defined(DEBUG)

runtime/vm/object.cc

-5
Original file line numberDiff line numberDiff line change
@@ -3766,11 +3766,6 @@ RawError* Class::EnsureIsFinalized(Thread* thread) const {
37663766
UNREACHABLE();
37673767
}
37683768
}
3769-
// Canonical hashes are only stored during a round of canonicalization to
3770-
// avoid expontential time in cases such as those in
3771-
// tests/language_2/canonicalization_hasing_*. Clear them after
3772-
// canonicalization is done so the GC won't need to update them.
3773-
thread->heap()->ResetCanonicalHashTable();
37743769
return error.raw();
37753770
}
37763771

0 commit comments

Comments
 (0)