Commit aaef2562 authored by Maciej Goszczycki's avatar Maciej Goszczycki Committed by Commit Bot

[inspector][roheap] Make inspector-test.cc compatible with shared ro-heap

Shared read-only heap means that all isolates within a process must
share the same snapshot. Pass the back-end snapshot to the front-end
runner to fix that.

Bug: v8:7464
Change-Id: I0ec591a919d4d462ef38e372907592df3c759521
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1669691
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62349}
parent d2061e53
......@@ -4,6 +4,7 @@ include_rules = [
"+src/base/macros.h",
"+src/base/platform/platform.h",
"+src/flags/flags.h",
"+src/heap/read-only-heap.h",
"+src/inspector/test-interface.h",
"+src/utils/locked-queue-inl.h",
"+src/utils/utils.h",
......
......@@ -15,6 +15,7 @@
#include "src/base/platform/platform.h"
#include "src/flags/flags.h"
#include "src/heap/read-only-heap.h"
#include "src/utils/utils.h"
#include "src/utils/vector.h"
......@@ -1070,6 +1071,7 @@ int main(int argc, char* argv[]) {
printf("Embedding script '%s'\n", argv[i]);
startup_data = i::CreateSnapshotDataBlobInternal(
v8::SnapshotCreator::FunctionCodeHandling::kClear, argv[i], nullptr);
v8::internal::ReadOnlyHeap::ClearSharedHeapForTest();
argv[i] = nullptr;
}
}
......@@ -1077,8 +1079,9 @@ int main(int argc, char* argv[]) {
{
IsolateData::SetupGlobalTasks frontend_extensions;
frontend_extensions.emplace_back(new UtilsExtension());
TaskRunner frontend_runner(std::move(frontend_extensions), true,
&ready_semaphore, nullptr, false);
TaskRunner frontend_runner(
std::move(frontend_extensions), true, &ready_semaphore,
startup_data.data ? &startup_data : nullptr, false);
ready_semaphore.Wait();
int frontend_context_group_id = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment