diff options
Diffstat (limited to 'deps/v8/test/cctest/test-roots.cc')
-rw-r--r-- | deps/v8/test/cctest/test-roots.cc | 65 |
1 files changed, 6 insertions, 59 deletions
diff --git a/deps/v8/test/cctest/test-roots.cc b/deps/v8/test/cctest/test-roots.cc index f99b9df399..7dcbe998cd 100644 --- a/deps/v8/test/cctest/test-roots.cc +++ b/deps/v8/test/cctest/test-roots.cc @@ -18,57 +18,16 @@ AllocationSpace GetSpaceFromObject(Object* object) { } } // namespace -#define CHECK_IN_RO_SPACE(name) \ - HeapObject* name = roots.name(); \ +#define CHECK_IN_RO_SPACE(type, name, CamelName) \ + HeapObject* name = roots.name(); \ CHECK_EQ(RO_SPACE, GetSpaceFromObject(name)); // The following tests check that all the roots accessible via ReadOnlyRoots are // in RO_SPACE. -TEST(TestStrongReadOnlyRoots) { +TEST(TestReadOnlyRoots) { ReadOnlyRoots roots(CcTest::i_isolate()); -#define TEST_ROOT(type, name, camel_name) CHECK_IN_RO_SPACE(name) - STRONG_READ_ONLY_ROOT_LIST(TEST_ROOT) -#undef TEST_ROOT -} - -TEST(TestInternalizedStrings) { - ReadOnlyRoots roots(CcTest::i_isolate()); - -#define TEST_ROOT(name, str) CHECK_IN_RO_SPACE(name) - INTERNALIZED_STRING_LIST(TEST_ROOT) -#undef TEST_ROOT -} - -TEST(TestPrivateSymbols) { - ReadOnlyRoots roots(CcTest::i_isolate()); - - PRIVATE_SYMBOL_LIST(CHECK_IN_RO_SPACE) -} - -TEST(TestPublicSymbols) { - ReadOnlyRoots roots(CcTest::i_isolate()); - -#define TEST_ROOT(name, description) CHECK_IN_RO_SPACE(name) - PUBLIC_SYMBOL_LIST(TEST_ROOT) - WELL_KNOWN_SYMBOL_LIST(TEST_ROOT) -#undef TEST_ROOT -} - -TEST(TestStructMaps) { - ReadOnlyRoots roots(CcTest::i_isolate()); - -#define TEST_ROOT(NAME, Name, name) CHECK_IN_RO_SPACE(name##_map) - STRUCT_LIST(TEST_ROOT) -#undef TEST_ROOT -} - -TEST(TestAllocationSiteMaps) { - ReadOnlyRoots roots(CcTest::i_isolate()); - -#define TEST_ROOT(NAME, Name, Size, name) CHECK_IN_RO_SPACE(name##_map) - ALLOCATION_SITE_LIST(TEST_ROOT) -#undef TEST_ROOT + READ_ONLY_ROOT_LIST(CHECK_IN_RO_SPACE) } #undef CHECK_IN_RO_SPACE @@ -82,7 +41,6 @@ bool IsInitiallyMutable(Factory* factory, Address object_address) { V(detached_contexts) \ V(feedback_vectors_for_profiling_tools) \ V(materialized_objects) \ - V(microtask_queue) \ V(noscript_shared_function_infos) \ V(retained_maps) \ V(retaining_path_targets) \ @@ -101,7 +59,7 @@ bool IsInitiallyMutable(Factory* factory, Address object_address) { // The CHECK_EQ line is there just to ensure that the root is publicly // accessible from Heap, but ultimately the factory is used as it provides // handles that have the address in the root table. -#define CHECK_NOT_IN_RO_SPACE(name) \ +#define CHECK_NOT_IN_RO_SPACE(type, name, CamelName) \ Handle<Object> name = factory->name(); \ CHECK_EQ(*name, heap->name()); \ if (name->IsHeapObject() && IsInitiallyMutable(factory, name.address())) \ @@ -115,18 +73,7 @@ TEST(TestHeapRootsNotReadOnly) { Factory* factory = CcTest::i_isolate()->factory(); Heap* heap = CcTest::i_isolate()->heap(); -#define TEST_ROOT(type, name, camel_name) CHECK_NOT_IN_RO_SPACE(name) - MUTABLE_ROOT_LIST(TEST_ROOT) -#undef TEST_ROOT -} - -TEST(TestAccessorInfosNotReadOnly) { - Factory* factory = CcTest::i_isolate()->factory(); - Heap* heap = CcTest::i_isolate()->heap(); - -#define TEST_ROOT(name, AccessorName) CHECK_NOT_IN_RO_SPACE(name##_accessor) - ACCESSOR_INFO_LIST(TEST_ROOT) -#undef TEST_ROOT + MUTABLE_ROOT_LIST(CHECK_NOT_IN_RO_SPACE) } #undef CHECK_NOT_IN_RO_SPACE |