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

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

Issue 1381633005: [heap] Properly reset flags for partially aborted evacuation candidates. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add test case for symptom 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 | « src/heap/mark-compact.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 e72a19acda340ab3c23c4bbeb30d28db98076f8c..0b96c7204df33b0e8d809d1f40d96f139292568a 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -5479,6 +5479,38 @@ static void RequestInterrupt(const v8::FunctionCallbackInfo<v8::Value>& args) {
}
+UNINITIALIZED_TEST(Regress538257) {
+ i::FLAG_manual_evacuation_candidates_selection = true;
+ v8::Isolate::CreateParams create_params;
+ // Set heap limits.
+ create_params.constraints.set_max_semi_space_size(1 * Page::kPageSize / MB);
+ create_params.constraints.set_max_old_space_size(6 * Page::kPageSize / MB);
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
+ isolate->Enter();
+ {
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ HandleScope handle_scope(i_isolate);
+ PagedSpace* old_space = i_isolate->heap()->old_space();
+ const int kMaxObjects = 10000;
+ const int kFixedArrayLen = 512;
+ Handle<FixedArray> objects[kMaxObjects];
+ for (int i = 0; (i < kMaxObjects) && old_space->CanExpand(Page::kPageSize);
+ i++) {
+ objects[i] = i_isolate->factory()->NewFixedArray(kFixedArrayLen, TENURED);
+ Page::FromAddress(objects[i]->address())
+ ->SetFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING);
+ }
+ SimulateFullSpace(old_space);
+ i_isolate->heap()->CollectGarbage(OLD_SPACE);
+ // If we get this far, we've successfully aborted compaction. Any further
+ // allocations might trigger OOM.
+ }
+ isolate->Exit();
+ isolate->Dispose();
+}
+
+
TEST(Regress357137) {
CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698