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

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

Issue 2659573002: [heap] Fix GrowAndShrinkNewSpace heap test (Closed)
Patch Set: Created 3 years, 10 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
« 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 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 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after
2331 FLAG_predictable = true; 2331 FLAG_predictable = true;
2332 2332
2333 CcTest::InitializeVM(); 2333 CcTest::InitializeVM();
2334 Heap* heap = CcTest::heap(); 2334 Heap* heap = CcTest::heap();
2335 NewSpace* new_space = heap->new_space(); 2335 NewSpace* new_space = heap->new_space();
2336 2336
2337 if (heap->MaxSemiSpaceSize() == heap->InitialSemiSpaceSize()) { 2337 if (heap->MaxSemiSpaceSize() == heap->InitialSemiSpaceSize()) {
2338 return; 2338 return;
2339 } 2339 }
2340 2340
2341 // Make sure we're in a consistent state to start out.
2342 CcTest::CollectGarbage(NEW_SPACE);
2343 CcTest::CollectGarbage(NEW_SPACE);
2344
2341 // Explicitly growing should double the space capacity. 2345 // Explicitly growing should double the space capacity.
2342 size_t old_capacity, new_capacity; 2346 size_t old_capacity, new_capacity;
2343 old_capacity = new_space->TotalCapacity(); 2347 old_capacity = new_space->TotalCapacity();
2344 new_space->Grow(); 2348 new_space->Grow();
2345 new_capacity = new_space->TotalCapacity(); 2349 new_capacity = new_space->TotalCapacity();
2346 CHECK_EQ(2 * old_capacity, new_capacity); 2350 CHECK_EQ(2 * old_capacity, new_capacity);
2347 2351
2348 old_capacity = new_space->TotalCapacity(); 2352 old_capacity = new_space->TotalCapacity();
2349 { 2353 {
2350 v8::HandleScope temporary_scope(CcTest::isolate()); 2354 v8::HandleScope temporary_scope(CcTest::isolate());
(...skipping 4739 matching lines...) Expand 10 before | Expand all | Expand 10 after
7090 CHECK(!heap->code_space()->FirstPage()->Contains(code->address())); 7094 CHECK(!heap->code_space()->FirstPage()->Contains(code->address()));
7091 7095
7092 // Ensure it's not in large object space. 7096 // Ensure it's not in large object space.
7093 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address()); 7097 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address());
7094 CHECK(chunk->owner()->identity() != LO_SPACE); 7098 CHECK(chunk->owner()->identity() != LO_SPACE);
7095 CHECK(chunk->NeverEvacuate()); 7099 CHECK(chunk->NeverEvacuate());
7096 } 7100 }
7097 7101
7098 } // namespace internal 7102 } // namespace internal
7099 } // namespace v8 7103 } // namespace v8
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