[test, heap] Skip tests when shared RO space is disabled

Bug: v8:11966
Change-Id: I3e5fe6e9d53938793c7f66cd05b4dcfe3073c22f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3015568
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75652}
This commit is contained in:
Dominik Inführ 2021-07-09 09:48:41 +02:00 committed by V8 LUCI CQ
parent b195a94263
commit 95249ba563
2 changed files with 6 additions and 0 deletions

View File

@ -2901,6 +2901,7 @@ Isolate* Isolate::New() { return Isolate::Allocate(false); }
// static
Isolate* Isolate::NewShared(const v8::Isolate::CreateParams& params) {
DCHECK(ReadOnlyHeap::IsReadOnlySpaceShared());
Isolate* isolate = Isolate::Allocate(true);
v8::Isolate::Initialize(reinterpret_cast<v8::Isolate*>(isolate), params);
return isolate;

View File

@ -6,6 +6,7 @@
#include "src/common/globals.h"
#include "src/handles/handles-inl.h"
#include "src/heap/heap.h"
#include "src/heap/read-only-spaces.h"
#include "src/objects/fixed-array-inl.h"
#include "src/objects/fixed-array.h"
#include "src/objects/heap-object.h"
@ -63,6 +64,7 @@ class SharedOldSpaceAllocationThread final : public v8::base::Thread {
} // namespace
UNINITIALIZED_TEST(ConcurrentAllocationInSharedOldSpace) {
if (!ReadOnlyHeap::IsReadOnlySpaceShared()) return;
std::unique_ptr<v8::ArrayBuffer::Allocator> allocator(
v8::ArrayBuffer::Allocator::NewDefaultAllocator());
@ -118,6 +120,7 @@ class SharedMapSpaceAllocationThread final : public v8::base::Thread {
} // namespace
UNINITIALIZED_TEST(ConcurrentAllocationInSharedMapSpace) {
if (!ReadOnlyHeap::IsReadOnlySpaceShared()) return;
std::unique_ptr<v8::ArrayBuffer::Allocator> allocator(
v8::ArrayBuffer::Allocator::NewDefaultAllocator());
@ -143,6 +146,7 @@ UNINITIALIZED_TEST(ConcurrentAllocationInSharedMapSpace) {
}
UNINITIALIZED_TEST(SharedCollectionWithoutClients) {
if (!ReadOnlyHeap::IsReadOnlySpaceShared()) return;
std::unique_ptr<v8::ArrayBuffer::Allocator> allocator(
v8::ArrayBuffer::Allocator::NewDefaultAllocator());
@ -183,6 +187,7 @@ void AllocateInSharedSpace(Isolate* shared_isolate) {
UNINITIALIZED_TEST(SharedCollectionWithOneClient) {
FLAG_max_old_space_size = 8;
if (!ReadOnlyHeap::IsReadOnlySpaceShared()) return;
std::unique_ptr<v8::ArrayBuffer::Allocator> allocator(
v8::ArrayBuffer::Allocator::NewDefaultAllocator());