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

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

Issue 910333004: Contribution of PowerPC port (continuation of 422063005) - PPC opt 2 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Updated to remove non-test changes Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-spaces.cc
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc
index 331ea025109dd4112eb5f2176dec9dc6c479a268..a11485be1a14039d1b8d1ce9f7dec258f6b93b5f 100644
--- a/test/cctest/test-spaces.cc
+++ b/test/cctest/test-spaces.cc
@@ -207,12 +207,13 @@ static void VerifyMemoryChunk(Isolate* isolate,
TEST(Regress3540) {
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
+ const int pageSize = Page::kPageSize;
MemoryAllocator* memory_allocator = new MemoryAllocator(isolate);
CHECK(
memory_allocator->SetUp(heap->MaxReserved(), heap->MaxExecutableSize()));
TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator);
CodeRange* code_range = new CodeRange(isolate);
- const size_t code_range_size = 4 * MB;
+ const size_t code_range_size = 4 * pageSize;
if (!code_range->SetUp(
code_range_size +
RoundUp(v8::base::OS::CommitPageSize() * kReservedCodeRangePages,
@@ -222,13 +223,13 @@ TEST(Regress3540) {
}
Address address;
size_t size;
- address = code_range->AllocateRawMemory(code_range_size - 2 * MB,
- code_range_size - 2 * MB, &size);
+ address = code_range->AllocateRawMemory(
+ code_range_size - 2 * pageSize, code_range_size - 2 * pageSize, &size);
CHECK(address != NULL);
Address null_address;
size_t null_size;
null_address = code_range->AllocateRawMemory(
- code_range_size - MB, code_range_size - MB, &null_size);
+ code_range_size - pageSize, code_range_size - pageSize, &null_size);
CHECK(null_address == NULL);
code_range->FreeRawMemory(address, size);
delete code_range;
@@ -422,7 +423,9 @@ TEST(LargeObjectSpace) {
{ AllocationResult allocation = lo->AllocateRaw(lo_size, NOT_EXECUTABLE);
if (allocation.IsRetry()) break;
}
- CHECK(lo->Available() < available);
+ // The available value is conservative such that it may report
+ // zero prior to heap exhaustion.
+ CHECK(lo->Available() < available || available == 0);
}
CHECK(!lo->IsEmpty());
@@ -460,7 +463,7 @@ TEST(SizeOfFirstPageIsLargeEnough) {
UNINITIALIZED_TEST(NewSpaceGrowsToTargetCapacity) {
- FLAG_target_semi_space_size = 2;
+ FLAG_target_semi_space_size = 2 * (Page::kPageSize / MB);
if (FLAG_optimize_for_size) return;
v8::Isolate* isolate = v8::Isolate::New();
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698