Chromium Code Reviews| Index: test/cctest/test-heap.cc |
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
| index 7015a1ee625212eedb31ac7aa6965e49133686fb..1595fc5d958e535d308e83cc36377c59cfb34ad0 100644 |
| --- a/test/cctest/test-heap.cc |
| +++ b/test/cctest/test-heap.cc |
| @@ -1606,4 +1606,22 @@ TEST(PrototypeTransitionClearing) { |
| CHECK(trans->get(j + Map::kProtoTransitionMapOffset)->IsMap()); |
| CHECK(trans->get(j + Map::kProtoTransitionPrototypeOffset)->IsJSObject()); |
| } |
| + |
| + // Make sure next prototype is placed on an old-space evacuation candidate. |
| + PagedSpace* space = HEAP->old_pointer_space(); |
| + while (space->FirstPage() == space->LastPage()) { |
| + FACTORY->NewJSArray(1, TENURED); |
|
Vyacheslav Egorov (Chromium)
2012/01/20 12:17:39
This loop looks a bit spooky because the fact that
Michael Starzinger
2012/01/20 12:41:53
Done. Now unnecessary due to second change.
|
| + } |
| + |
| + // Add a prototype on an evacuation candidate and verify that transition |
| + // clearing correctly records slots in prototype transition array. |
| + i::FLAG_always_compact = true; |
| + Handle<Map> map(baseObject->map()); |
| + Handle<JSObject> prototype = FACTORY->NewJSArray(0, TENURED); |
| + CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); |
|
Vyacheslav Egorov (Chromium)
2012/01/20 12:17:39
this check look suspicious. by accident there migh
Michael Starzinger
2012/01/20 12:41:53
Done. Yes, that is much simpler and I can arbitrar
|
| + CHECK(space->LastPage()->Contains(prototype->address())); |
| + baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); |
| + CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
| + HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| + CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); |
| } |