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

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

Issue 1393833002: [heap] Reland prepare code for smaller large object allocation limit than max allocatable memory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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-api.cc ('k') | test/cctest/test-spaces.cc » ('j') | 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 3d2d144cbd942c9c408d8529b5ccd746fdce6669..2cc7add49e6dae475cb6a3fe6435a4a2e12f36c7 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -5565,8 +5565,8 @@ TEST(ArrayShiftSweeping) {
Heap* heap = isolate->heap();
v8::Local<v8::Value> result = CompileRun(
- "var array = new Array(40000);"
- "var tmp = new Array(100000);"
+ "var array = new Array(400);"
+ "var tmp = new Array(1000);"
"array[0] = 10;"
"gc();"
"gc();"
@@ -5638,16 +5638,8 @@ UNINITIALIZED_TEST(PromotionQueue) {
heap->CollectGarbage(NEW_SPACE);
CHECK(i::FLAG_min_semi_space_size * MB == new_space->TotalCapacity());
- // Create the first huge object which will exactly fit the first semi-space
- // page.
- DisableInlineAllocationSteps(new_space);
- int new_linear_size =
- static_cast<int>(*heap->new_space()->allocation_limit_address() -
- *heap->new_space()->allocation_top_address());
- int length = (new_linear_size - FixedArray::kHeaderSize) / kPointerSize;
- Handle<FixedArray> first =
- i_isolate->factory()->NewFixedArray(length, NOT_TENURED);
- CHECK(heap->InNewSpace(*first));
+ // Fill-up the first semi-space page.
+ FillUpOnePage(new_space);
// Create a small object to initialize the bump pointer on the second
// semi-space page.
@@ -5655,17 +5647,8 @@ UNINITIALIZED_TEST(PromotionQueue) {
i_isolate->factory()->NewFixedArray(1, NOT_TENURED);
CHECK(heap->InNewSpace(*small));
-
- // Create the second huge object of maximum allocatable second semi-space
- // page size.
- DisableInlineAllocationSteps(new_space);
- new_linear_size =
- static_cast<int>(*heap->new_space()->allocation_limit_address() -
- *heap->new_space()->allocation_top_address());
- length = (new_linear_size - FixedArray::kHeaderSize) / kPointerSize;
- Handle<FixedArray> second =
- i_isolate->factory()->NewFixedArray(length, NOT_TENURED);
- CHECK(heap->InNewSpace(*second));
+ // Fill-up the second semi-space page.
+ FillUpOnePage(new_space);
// This scavenge will corrupt memory if the promotion queue is not
// evacuated.
@@ -5691,19 +5674,11 @@ TEST(Regress388880) {
int desired_offset = Page::kPageSize - map1->instance_size();
- // Allocate fixed array in old pointer space so, that object allocated
+ // Allocate padding objects in old pointer space so, that object allocated
// afterwards would end at the end of the page.
- {
- SimulateFullSpace(heap->old_space());
- int padding_size = desired_offset - Page::kObjectStartOffset;
- int padding_array_length =
- (padding_size - FixedArray::kHeaderSize) / kPointerSize;
-
- Handle<FixedArray> temp2 =
- factory->NewFixedArray(padding_array_length, TENURED);
- Page* page = Page::FromAddress(temp2->address());
- CHECK_EQ(Page::kObjectStartOffset, page->Offset(temp2->address()));
- }
+ SimulateFullSpace(heap->old_space());
+ int padding_size = desired_offset - Page::kObjectStartOffset;
+ CreatePadding(heap, padding_size, TENURED);
Handle<JSObject> o = factory->NewJSObjectFromMap(map1, TENURED);
o->set_properties(*factory->empty_fixed_array());
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698