Chromium Code Reviews| Index: test/cctest/test-weakmaps.cc |
| diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc |
| index 2f28cb6c111d71bf487c8cb8c1dba401db7e987a..8ca81ee4a84919f271eac0d02dbd8dd51571cd5a 100644 |
| --- a/test/cctest/test-weakmaps.cc |
| +++ b/test/cctest/test-weakmaps.cc |
| @@ -255,3 +255,21 @@ TEST(Regress2060b) { |
| heap->CollectAllGarbage(Heap::kNoGCFlags); |
| heap->CollectAllGarbage(Heap::kNoGCFlags); |
| } |
| + |
| + |
| +TEST(Regress399527) { |
| + CcTest::InitializeVM(); |
| + v8::HandleScope scope(CcTest::isolate()); |
| + Isolate* isolate = CcTest::i_isolate(); |
| + Heap* heap = isolate->heap(); |
| + { |
| + HandleScope scope(isolate); |
| + Handle<JSWeakMap> weak_map = AllocateJSWeakMap(isolate); |
| + CHECK(*weak_map != NULL); |
|
Michael Starzinger
2014/08/04 15:35:30
nit: Can we just drop the "weak_map" local variabl
Hannes Payer (out of office)
2014/08/04 16:09:35
Done.
|
| + SimulateIncrementalMarking(heap); |
| + } |
| + // The weak map is marked black here but leaving the handle scope will make |
| + // the object unreachable. Aborting incremental marking will clear all the |
| + // marking bits which makes the weak map garbage. |
| + heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| +} |