OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 } | 1617 } |
1618 int initial_size = static_cast<int>(CcTest::heap()->SizeOfObjects()); | 1618 int initial_size = static_cast<int>(CcTest::heap()->SizeOfObjects()); |
1619 | 1619 |
1620 { | 1620 { |
1621 // Allocate objects on several different old-space pages so that | 1621 // Allocate objects on several different old-space pages so that |
1622 // concurrent sweeper threads will be busy sweeping the old space on | 1622 // concurrent sweeper threads will be busy sweeping the old space on |
1623 // subsequent GC runs. | 1623 // subsequent GC runs. |
1624 AlwaysAllocateScope always_allocate(CcTest::i_isolate()); | 1624 AlwaysAllocateScope always_allocate(CcTest::i_isolate()); |
1625 int filler_size = static_cast<int>(FixedArray::SizeFor(8192)); | 1625 int filler_size = static_cast<int>(FixedArray::SizeFor(8192)); |
1626 for (int i = 1; i <= 100; i++) { | 1626 for (int i = 1; i <= 100; i++) { |
1627 CcTest::heap()->AllocateFixedArray(8192, TENURED)->ToObjectChecked(); | 1627 CcTest::test_heap()->AllocateFixedArray(8192, TENURED)->ToObjectChecked(); |
1628 CHECK_EQ(initial_size + i * filler_size, | 1628 CHECK_EQ(initial_size + i * filler_size, |
1629 static_cast<int>(CcTest::heap()->SizeOfObjects())); | 1629 static_cast<int>(CcTest::heap()->SizeOfObjects())); |
1630 } | 1630 } |
1631 } | 1631 } |
1632 | 1632 |
1633 // The heap size should go back to initial size after a full GC, even | 1633 // The heap size should go back to initial size after a full GC, even |
1634 // though sweeping didn't finish yet. | 1634 // though sweeping didn't finish yet. |
1635 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); | 1635 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); |
1636 | 1636 |
1637 // Normally sweeping would not be complete here, but no guarantees. | 1637 // Normally sweeping would not be complete here, but no guarantees. |
(...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4222 "array;"); | 4222 "array;"); |
4223 | 4223 |
4224 Handle<JSObject> o = | 4224 Handle<JSObject> o = |
4225 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); | 4225 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); |
4226 CHECK(heap->InOldPointerSpace(o->elements())); | 4226 CHECK(heap->InOldPointerSpace(o->elements())); |
4227 CHECK(heap->InOldPointerSpace(*o)); | 4227 CHECK(heap->InOldPointerSpace(*o)); |
4228 Page* page = Page::FromAddress(o->elements()->address()); | 4228 Page* page = Page::FromAddress(o->elements()->address()); |
4229 CHECK(page->WasSwept() || | 4229 CHECK(page->WasSwept() || |
4230 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); | 4230 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); |
4231 } | 4231 } |
OLD | NEW |