summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-roots.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-03-12 09:01:49 +0100
committerMichaël Zasso <targos@protonmail.com>2019-03-14 18:49:21 +0100
commit7b48713334469818661fe276cf571de9c7899f2d (patch)
tree4dbda49ac88db76ce09dc330a0cb587e68e139ba /deps/v8/test/cctest/test-roots.cc
parent8549ac09b256666cf5275224ec58fab9939ff32e (diff)
downloadnode-new-7b48713334469818661fe276cf571de9c7899f2d.tar.gz
deps: update V8 to 7.3.492.25
PR-URL: https://github.com/nodejs/node/pull/25852 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/test/cctest/test-roots.cc')
-rw-r--r--deps/v8/test/cctest/test-roots.cc29
1 files changed, 18 insertions, 11 deletions
diff --git a/deps/v8/test/cctest/test-roots.cc b/deps/v8/test/cctest/test-roots.cc
index 7dcbe998cd..bb4e09d8a4 100644
--- a/deps/v8/test/cctest/test-roots.cc
+++ b/deps/v8/test/cctest/test-roots.cc
@@ -10,7 +10,7 @@ namespace v8 {
namespace internal {
namespace {
-AllocationSpace GetSpaceFromObject(Object* object) {
+AllocationSpace GetSpaceFromObject(Object object) {
DCHECK(object->IsHeapObject());
return MemoryChunk::FromHeapObject(HeapObject::cast(object))
->owner()
@@ -19,7 +19,7 @@ AllocationSpace GetSpaceFromObject(Object* object) {
} // namespace
#define CHECK_IN_RO_SPACE(type, name, CamelName) \
- HeapObject* name = roots.name(); \
+ HeapObject name = roots.name(); \
CHECK_EQ(RO_SPACE, GetSpaceFromObject(name));
// The following tests check that all the roots accessible via ReadOnlyRoots are
@@ -34,18 +34,24 @@ TEST(TestReadOnlyRoots) {
namespace {
bool IsInitiallyMutable(Factory* factory, Address object_address) {
-// Entries in this list are in STRONG_MUTABLE_ROOT_LIST, but may initially point
-// to objects that in RO_SPACE.
+// Entries in this list are in STRONG_MUTABLE_MOVABLE_ROOT_LIST, but may
+// initially point to objects that are in RO_SPACE.
#define INITIALLY_READ_ONLY_ROOT_LIST(V) \
+ V(api_private_symbol_table) \
+ V(api_symbol_table) \
V(builtins_constants_table) \
+ V(current_microtask) \
V(detached_contexts) \
+ V(dirty_js_weak_factories) \
V(feedback_vectors_for_profiling_tools) \
V(materialized_objects) \
V(noscript_shared_function_infos) \
+ V(public_symbol_table) \
V(retained_maps) \
V(retaining_path_targets) \
V(serialized_global_proxy_sizes) \
- V(serialized_objects)
+ V(serialized_objects) \
+ V(weak_refs_keep_during_job)
#define TEST_CAN_BE_READ_ONLY(name) \
if (factory->name().address() == object_address) return false;
@@ -59,12 +65,13 @@ 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(type, name, CamelName) \
- Handle<Object> name = factory->name(); \
- CHECK_EQ(*name, heap->name()); \
- if (name->IsHeapObject() && IsInitiallyMutable(factory, name.address())) \
- CHECK_NE(RO_SPACE, \
- GetSpaceFromObject(reinterpret_cast<HeapObject*>(*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()) && \
+ !name->IsUndefined(CcTest::i_isolate())) { \
+ CHECK_NE(RO_SPACE, GetSpaceFromObject(HeapObject::cast(*name))); \
+ }
// The following tests check that all the roots accessible via public Heap
// accessors are not in RO_SPACE with the exception of the objects listed in