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

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

Issue 255603002: Don't move the object start of objects on non-swept pages. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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.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 c0cc7e654285804514c05a706cf6208284929e12..61803cc6e90cae98077db101ba80458cb1d7c307 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -4201,3 +4201,30 @@ TEST(Regress357137) {
"f()()");
CHECK_EQ(42.0, result->ToNumber()->Value());
}
+
+
+TEST(ArrayShiftLazySweeping) {
+ i::FLAG_expose_gc = true;
+ i::FLAG_parallel_sweeping = false;
+ i::FLAG_concurrent_sweeping = false;
+ i::FLAG_lazy_sweeping = true;
+ CcTest::InitializeVM();
+ v8::HandleScope scope(CcTest::isolate());
+ Isolate* isolate = CcTest::i_isolate();
+ Heap* heap = isolate->heap();
+
+ v8::Local<v8::Value> result = CompileRun(
+ "var array = new Array(40000);"
+ "var tmp = new Array(100000);"
+ "gc();"
+ "array.shift();"
+ "array;");
+
+ Handle<JSObject> o =
+ v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result));
+ CHECK(heap->InOldPointerSpace(o->elements()));
+ CHECK(heap->InOldPointerSpace(*o));
+ Page* page = Page::FromAddress(o->elements()->address());
+ CHECK(page->WasSwept() ||
+ Marking::IsBlack(Marking::MarkBitFrom(o->elements())));
+}
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698