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

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

Issue 413173002: Revert r22597 (which should have been called: "Tests that the GC doesn't mistake non-pointer consta… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-constantpool.cc
diff --git a/test/cctest/test-constantpool.cc b/test/cctest/test-constantpool.cc
index f09a37ae69f4dc01c6298e721f6a2b4eb081b178..67767a2f0ead7b68f1b29f1f1dd0562ed53fd970 100644
--- a/test/cctest/test-constantpool.cc
+++ b/test/cctest/test-constantpool.cc
@@ -242,39 +242,3 @@ TEST(ConstantPoolIteratorExtended) {
int expected_int32_indexs[] = { 1, 2, 3, 4 };
CheckIterator(array, ConstantPoolArray::INT32, expected_int32_indexs, 4);
}
-
-
-TEST(ConstantPoolPreciseGC) {
- LocalContext context;
- Isolate* isolate = CcTest::i_isolate();
- Heap* heap = isolate->heap();
- Factory* factory = isolate->factory();
- v8::HandleScope scope(context->GetIsolate());
-
- ConstantPoolArray::NumberOfEntries small(1, 0, 0, 1);
- Handle<ConstantPoolArray> array = factory->NewConstantPoolArray(small);
-
- // Check that the store buffer knows which entries are pointers and which are
- // not. To do this, make non-pointer entries which look like new space
- // pointers but are actually invalid and ensure the GC doesn't try to move
- // them.
- Handle<HeapObject> object = factory->NewHeapNumber(4.0);
- Object* raw_ptr = *object;
- // If interpreted as a pointer, this should be right inside the heap number
- // which will cause a crash when trying to lookup the 'map' pointer.
- int32_t invalid_ptr_int32 = reinterpret_cast<int32_t>(raw_ptr) + kInt32Size;
- int64_t invalid_ptr_int64 = reinterpret_cast<int64_t>(raw_ptr) + kInt32Size;
- array->set(0, invalid_ptr_int64);
- array->set(1, invalid_ptr_int32);
-
- // Ensure we perform a scan on scavenge for the constant pool's page.
- MemoryChunk::FromAddress(array->address())->set_scan_on_scavenge(true);
- heap->CollectGarbage(NEW_SPACE);
-
- // Check the object was moved by GC.
- CHECK_NE(*object, raw_ptr);
-
- // Check the non-pointer entries weren't changed.
- CHECK_EQ(invalid_ptr_int64, array->get_int64_entry(0));
- CHECK_EQ(invalid_ptr_int32, array->get_int32_entry(1));
-}
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698