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

Unified Diff: test/cctest/test-heap.cc

Issue 577223002: Capacity returns allocatable memory and TotalCapacity returns allocatable plus non-allocatable memo… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 8852b8820ffa19573fdcd26bb4a661bdab1acc42..b9cec097c2b158b85d20990a087e089201857429 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1684,7 +1684,7 @@ static void FillUpNewSpace(NewSpace* new_space) {
Factory* factory = isolate->factory();
HandleScope scope(isolate);
AlwaysAllocateScope always_allocate(isolate);
- intptr_t available = new_space->EffectiveCapacity() - new_space->Size();
+ intptr_t available = new_space->Capacity() - new_space->Size();
intptr_t number_of_fillers = (available / FixedArray::SizeFor(32)) - 1;
for (intptr_t i = 0; i < number_of_fillers; i++) {
CHECK(heap->InNewSpace(*factory->NewFixedArray(32, NOT_TENURED)));
@@ -1707,20 +1707,20 @@ TEST(GrowAndShrinkNewSpace) {
// Explicitly growing should double the space capacity.
intptr_t old_capacity, new_capacity;
- old_capacity = new_space->Capacity();
+ old_capacity = new_space->TotalCapacity();
new_space->Grow();
- new_capacity = new_space->Capacity();
+ new_capacity = new_space->TotalCapacity();
CHECK(2 * old_capacity == new_capacity);
- old_capacity = new_space->Capacity();
+ old_capacity = new_space->TotalCapacity();
FillUpNewSpace(new_space);
- new_capacity = new_space->Capacity();
+ new_capacity = new_space->TotalCapacity();
CHECK(old_capacity == new_capacity);
// Explicitly shrinking should not affect space capacity.
- old_capacity = new_space->Capacity();
+ old_capacity = new_space->TotalCapacity();
new_space->Shrink();
- new_capacity = new_space->Capacity();
+ new_capacity = new_space->TotalCapacity();
CHECK(old_capacity == new_capacity);
// Let the scavenger empty the new space.
@@ -1728,17 +1728,17 @@ TEST(GrowAndShrinkNewSpace) {
CHECK_LE(new_space->Size(), old_capacity);
// Explicitly shrinking should halve the space capacity.
- old_capacity = new_space->Capacity();
+ old_capacity = new_space->TotalCapacity();
new_space->Shrink();
- new_capacity = new_space->Capacity();
+ new_capacity = new_space->TotalCapacity();
CHECK(old_capacity == 2 * new_capacity);
// Consecutive shrinking should not affect space capacity.
- old_capacity = new_space->Capacity();
+ old_capacity = new_space->TotalCapacity();
new_space->Shrink();
new_space->Shrink();
new_space->Shrink();
- new_capacity = new_space->Capacity();
+ new_capacity = new_space->TotalCapacity();
CHECK(old_capacity == new_capacity);
}
@@ -1757,13 +1757,13 @@ TEST(CollectingAllAvailableGarbageShrinksNewSpace) {
v8::HandleScope scope(CcTest::isolate());
NewSpace* new_space = heap->new_space();
intptr_t old_capacity, new_capacity;
- old_capacity = new_space->Capacity();
+ old_capacity = new_space->TotalCapacity();
new_space->Grow();
- new_capacity = new_space->Capacity();
+ new_capacity = new_space->TotalCapacity();
CHECK(2 * old_capacity == new_capacity);
FillUpNewSpace(new_space);
heap->CollectAllAvailableGarbage();
- new_capacity = new_space->Capacity();
+ new_capacity = new_space->TotalCapacity();
CHECK(old_capacity == new_capacity);
}
@@ -4379,10 +4379,10 @@ TEST(PromotionQueue) {
// Grow the semi-space to two pages to make semi-space copy overwrite the
// promotion queue, which will be at the end of the second page.
- intptr_t old_capacity = new_space->Capacity();
+ intptr_t old_capacity = new_space->TotalCapacity();
new_space->Grow();
CHECK(new_space->IsAtMaximumCapacity());
- CHECK(2 * old_capacity == new_space->Capacity());
+ CHECK(2 * old_capacity == new_space->TotalCapacity());
// Call the scavenger two times to get an empty new space
heap->CollectGarbage(NEW_SPACE);
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698