Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index ef870733d83b8e9d4aaf5c375f99123182f445ef..10cb7a0070b6be09c67ca6ad81ed868581dfdb15 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -1499,6 +1499,7 @@ TEST(TestInternalWeakLists) { |
// Some flags turn Scavenge collections into Mark-sweep collections |
// and hence are incompatible with this test case. |
if (FLAG_gc_global || FLAG_stress_compaction) return; |
+ FLAG_retain_maps_for_n_gc = 0; |
static const int kNumTestContexts = 10; |
@@ -2863,6 +2864,7 @@ TEST(Regress1465) { |
i::FLAG_stress_compaction = false; |
i::FLAG_allow_natives_syntax = true; |
i::FLAG_trace_incremental_marking = true; |
+ i::FLAG_retain_maps_for_n_gc = 0; |
CcTest::InitializeVM(); |
v8::HandleScope scope(CcTest::isolate()); |
static const int transitions_count = 256; |
@@ -2925,6 +2927,7 @@ static void AddPropertyTo( |
Handle<Smi> twenty_three(Smi::FromInt(23), isolate); |
i::FLAG_gc_interval = gc_count; |
i::FLAG_gc_global = true; |
+ i::FLAG_retain_maps_for_n_gc = 0; |
CcTest::heap()->set_allocation_timeout(gc_count); |
JSReceiver::SetProperty(object, prop_name, twenty_three, SLOPPY).Check(); |
} |
@@ -4147,7 +4150,7 @@ TEST(EnsureAllocationSiteDependentCodesProcessed) { |
// Now make sure that a gc should get rid of the function, even though we |
// still have the allocation site alive. |
for (int i = 0; i < 4; i++) { |
- heap->CollectAllGarbage(Heap::kNoGCFlags); |
+ heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
} |
// TODO(mvstanton): this test fails when FLAG_vector_ics is true because |
@@ -4258,6 +4261,7 @@ TEST(NoWeakHashTableLeakWithIncrementalMarking) { |
i::FLAG_weak_embedded_objects_in_optimized_code = true; |
i::FLAG_allow_natives_syntax = true; |
i::FLAG_compilation_cache = false; |
+ i::FLAG_retain_maps_for_n_gc = 0; |
CcTest::InitializeVM(); |
Isolate* isolate = CcTest::i_isolate(); |
v8::internal::Heap* heap = CcTest::heap(); |
@@ -4948,6 +4952,27 @@ TEST(Regress3631) { |
} |
+TEST(MapRetaining) { |
Hannes Payer (out of office)
2014/12/16 17:15:35
Please also test the flag for n == 0, n in between
ulan
2014/12/17 11:13:34
Done.
|
+ CcTest::InitializeVM(); |
+ v8::HandleScope scope(CcTest::isolate()); |
+ Isolate* isolate = CcTest::i_isolate(); |
+ Heap* heap = isolate->heap(); |
+ Handle<WeakCell> weak_cell; |
+ { |
+ HandleScope inner_scope(isolate); |
+ Handle<Map> map = Map::Create(isolate, 1); |
+ weak_cell = inner_scope.CloseAndEscape(Map::WeakCellForMap(map)); |
+ } |
+ CHECK(!weak_cell->cleared()); |
+ for (int i = 0; i < FLAG_retain_maps_for_n_gc; i++) { |
+ heap->CollectGarbage(OLD_POINTER_SPACE); |
+ } |
+ CHECK(!weak_cell->cleared()); |
+ heap->CollectGarbage(OLD_POINTER_SPACE); |
+ CHECK(weak_cell->cleared()); |
+} |
+ |
+ |
#ifdef DEBUG |
TEST(PathTracer) { |
CcTest::InitializeVM(); |