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

Unified Diff: test/cctest/test-feedback-vector.cc

Issue 1029093002: v8:3539 - hold constructor feedback in weak cells (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-feedback-vector.cc
diff --git a/test/cctest/test-feedback-vector.cc b/test/cctest/test-feedback-vector.cc
index f53dfde10e4e871f3f4416bd5bd57d40521b0b2e..464a0a724a12e6a50bcc822d8f8bf7e56aff854a 100644
--- a/test/cctest/test-feedback-vector.cc
+++ b/test/cctest/test-feedback-vector.cc
@@ -140,13 +140,19 @@ TEST(VectorSlotClearing) {
// Fill with information
vector->Set(FeedbackVectorSlot(0), Smi::FromInt(1));
- vector->Set(FeedbackVectorSlot(1), *factory->fixed_array_map());
+ Handle<WeakCell> cell = factory->NewWeakCell(factory->fixed_array_map());
+ vector->Set(FeedbackVectorSlot(1), *cell);
Handle<AllocationSite> site = factory->NewAllocationSite();
vector->Set(FeedbackVectorSlot(2), *site);
+ // GC time clearing leaves slots alone.
+ vector->ClearSlotsAtGCTime(NULL);
+ Object* obj = vector->Get(FeedbackVectorSlot(1));
+ CHECK(obj->IsWeakCell() && !WeakCell::cast(obj)->cleared());
+
vector->ClearSlots(NULL);
- // The feedback vector slots are cleared. AllocationSites are granted
+ // The feedback vector slots are cleared. AllocationSites are still granted
// an exemption from clearing, as are smis.
CHECK_EQ(Smi::FromInt(1), vector->Get(FeedbackVectorSlot(0)));
CHECK_EQ(*TypeFeedbackVector::UninitializedSentinel(isolate),

Powered by Google App Engine
This is Rietveld 408576698