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), |