Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Side by Side Diff: test/cctest/test-heap.cc

Issue 9138016: Add regression test for r10451. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment by Vyacheslav Egorov. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 Handle<JSObject> prototype;
1612 PagedSpace* space = HEAP->old_pointer_space();
1613 do {
1614 prototype = FACTORY->NewJSArray(32 * KB, TENURED);
1615 } while (space->FirstPage() == space->LastPage() ||
1616 !space->LastPage()->Contains(prototype->address()));
1617
1618 // Add a prototype on an evacuation candidate and verify that transition
1619 // clearing correctly records slots in prototype transition array.
1620 i::FLAG_always_compact = true;
1621 Handle<Map> map(baseObject->map());
1622 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address()));
1623 CHECK(space->LastPage()->Contains(prototype->address()));
1624 baseObject->SetPrototype(*prototype, false)->ToObjectChecked();
1625 CHECK(map->GetPrototypeTransition(*prototype)->IsMap());
1626 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
1627 CHECK(map->GetPrototypeTransition(*prototype)->IsMap());
1609 } 1628 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698