OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 | 2 |
3 #include <stdlib.h> | 3 #include <stdlib.h> |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "execution.h" | 7 #include "execution.h" |
8 #include "factory.h" | 8 #include "factory.h" |
9 #include "macro-assembler.h" | 9 #include "macro-assembler.h" |
10 #include "global-handles.h" | 10 #include "global-handles.h" |
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1599 CHECK_EQ(10 - 3, baseObject->map()->NumberOfProtoTransitions()); | 1599 CHECK_EQ(10 - 3, baseObject->map()->NumberOfProtoTransitions()); |
1600 | 1600 |
1601 // Verify that prototype transitions array was compacted. | 1601 // Verify that prototype transitions array was compacted. |
1602 FixedArray* trans = baseObject->map()->prototype_transitions(); | 1602 FixedArray* trans = baseObject->map()->prototype_transitions(); |
1603 for (int i = 0; i < 10 - 3; i++) { | 1603 for (int i = 0; i < 10 - 3; i++) { |
1604 int j = Map::kProtoTransitionHeaderSize + | 1604 int j = Map::kProtoTransitionHeaderSize + |
1605 i * Map::kProtoTransitionElementsPerEntry; | 1605 i * Map::kProtoTransitionElementsPerEntry; |
1606 CHECK(trans->get(j + Map::kProtoTransitionMapOffset)->IsMap()); | 1606 CHECK(trans->get(j + Map::kProtoTransitionMapOffset)->IsMap()); |
1607 CHECK(trans->get(j + Map::kProtoTransitionPrototypeOffset)->IsJSObject()); | 1607 CHECK(trans->get(j + Map::kProtoTransitionPrototypeOffset)->IsJSObject()); |
1608 } | 1608 } |
1609 | |
1610 // Make sure next prototype is placed on an old-space evacuation candidate. | |
1611 PagedSpace* space = HEAP->old_pointer_space(); | |
1612 while (space->FirstPage() == space->LastPage()) { | |
1613 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.
| |
1614 } | |
1615 | |
1616 // Add a prototype on an evacuation candidate and verify that transition | |
1617 // clearing correctly records slots in prototype transition array. | |
1618 i::FLAG_always_compact = true; | |
1619 Handle<Map> map(baseObject->map()); | |
1620 Handle<JSObject> prototype = FACTORY->NewJSArray(0, TENURED); | |
1621 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
| |
1622 CHECK(space->LastPage()->Contains(prototype->address())); | |
1623 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); | |
1624 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | |
1625 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | |
1626 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); | |
1609 } | 1627 } |
OLD | NEW |