From 2391742099419b121c5a0fbf5af01ed72cd6b72a Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Sat, 1 May 2021 08:05:38 -0700 Subject: [PATCH] [heap] Require shared RO heap when using shared Isolate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only exception is when pointer compression is on with a per-Isolate cage. Bug: v8:11708 Change-Id: Ice9b0114bc102c20b4151ec66a861ba673934605 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2864563 Reviewed-by: Victor Gomes Reviewed-by: Dominik Inführ Commit-Queue: Shu-yu Guo Cr-Commit-Position: refs/heads/master@{#74342} --- src/execution/isolate.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/execution/isolate.h b/src/execution/isolate.h index 8ec9c4afbc..4957972c92 100644 --- a/src/execution/isolate.h +++ b/src/execution/isolate.h @@ -1762,6 +1762,16 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { }; void UseAsSharedIsolate() { + // When pointer compression is on with a per-Isolate cage, allocation in the + // shared Isolate can point into the per-Isolate RO heap as the offsets are + // constant across Isolates. + // + // When pointer compression is on with a shared cage or when pointer + // compression is off, a shared RO heap is required. Otherwise a shared + // allocation requested by a client Isolate could point into the client + // Isolate's RO space (e.g. an RO map) whose pages gets unmapped when it is + // disposed. + CHECK(COMPRESS_POINTERS_IN_ISOLATE_CAGE_BOOL || V8_SHARED_RO_HEAP_BOOL); DCHECK(!is_shared_); DCHECK_NULL(shared_isolate_); is_shared_ = true;