chore: fix broken patches on main (#39715)

This commit is contained in:
Samuel Attard 2023-09-01 01:28:01 -07:00 коммит произвёл GitHub
Родитель 89117fdd99
Коммит 89659fa9c9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 7 добавлений и 42 удалений

Просмотреть файл

@ -7,10 +7,10 @@ Subject: refactor: expose HostImportModuleDynamically and
This is so that Electron can blend Blink's and Node's implementations of these isolate handlers. This is so that Electron can blend Blink's and Node's implementations of these isolate handlers.
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index b8b20d8c8340c63bd3039a0683446ef1eb4fdf0d..a0781bd3817c2e0d4be37835f0c02063b2e548f1 100644 index 3da7200c92ccaf8330d46280e26124c1ad558a76..5ceecd071ca2efd2a7db214b65c4a997ef31d0b0 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -606,7 +606,9 @@ bool JavaScriptCompileHintsMagicEnabledCallback( @@ -578,7 +578,9 @@ bool JavaScriptCompileHintsMagicEnabledCallback(
execution_context); execution_context);
} }
@ -21,7 +21,7 @@ index b8b20d8c8340c63bd3039a0683446ef1eb4fdf0d..a0781bd3817c2e0d4be37835f0c02063
v8::Local<v8::Context> context, v8::Local<v8::Context> context,
v8::Local<v8::Data> v8_host_defined_options, v8::Local<v8::Data> v8_host_defined_options,
v8::Local<v8::Value> v8_referrer_resource_url, v8::Local<v8::Value> v8_referrer_resource_url,
@@ -672,7 +674,7 @@ v8::MaybeLocal<v8::Promise> HostImportModuleDynamically( @@ -644,7 +646,7 @@ v8::MaybeLocal<v8::Promise> HostImportModuleDynamically(
} }
// https://html.spec.whatwg.org/C/#hostgetimportmetaproperties // https://html.spec.whatwg.org/C/#hostgetimportmetaproperties
@ -30,7 +30,7 @@ index b8b20d8c8340c63bd3039a0683446ef1eb4fdf0d..a0781bd3817c2e0d4be37835f0c02063
v8::Local<v8::Module> module, v8::Local<v8::Module> module,
v8::Local<v8::Object> meta) { v8::Local<v8::Object> meta) {
ScriptState* script_state = ScriptState::From(context); ScriptState* script_state = ScriptState::From(context);
@@ -699,6 +701,8 @@ void HostGetImportMetaProperties(v8::Local<v8::Context> context, @@ -671,6 +673,8 @@ void HostGetImportMetaProperties(v8::Local<v8::Context> context,
meta->CreateDataProperty(context, resolve_key, resolve_value).ToChecked(); meta->CreateDataProperty(context, resolve_key, resolve_value).ToChecked();
} }
@ -39,7 +39,7 @@ index b8b20d8c8340c63bd3039a0683446ef1eb4fdf0d..a0781bd3817c2e0d4be37835f0c02063
void InitializeV8Common(v8::Isolate* isolate) { void InitializeV8Common(v8::Isolate* isolate) {
// Set up garbage collection before setting up anything else as V8 may trigger // Set up garbage collection before setting up anything else as V8 may trigger
// GCs during Blink setup. // GCs during Blink setup.
@@ -718,9 +722,9 @@ void InitializeV8Common(v8::Isolate* isolate) { @@ -690,9 +694,9 @@ void InitializeV8Common(v8::Isolate* isolate) {
SharedArrayBufferConstructorEnabledCallback); SharedArrayBufferConstructorEnabledCallback);
isolate->SetJavaScriptCompileHintsMagicEnabledCallback( isolate->SetJavaScriptCompileHintsMagicEnabledCallback(
JavaScriptCompileHintsMagicEnabledCallback); JavaScriptCompileHintsMagicEnabledCallback);
@ -52,10 +52,10 @@ index b8b20d8c8340c63bd3039a0683446ef1eb4fdf0d..a0781bd3817c2e0d4be37835f0c02063
V8ContextSnapshot::EnsureInterfaceTemplates(isolate); V8ContextSnapshot::EnsureInterfaceTemplates(isolate);
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
index 30a36cf16d4a8f4692ec6a13be1217212390172a..1924f7cef7f5a1f7523c00071639a6c72f9cca70 100644 index 9e628b96a845322d407f9da30a63c04ef5de9c24..8f5e4602f5e3f6787a9e54d510b39519074d51e6 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
@@ -77,6 +77,17 @@ class CORE_EXPORT V8Initializer { @@ -76,6 +76,17 @@ class CORE_EXPORT V8Initializer {
v8::Local<v8::Context> context, v8::Local<v8::Context> context,
v8::Local<v8::String> source); v8::Local<v8::String> source);

Просмотреть файл

@ -2,4 +2,3 @@ build_gn.patch
do_not_export_private_v8_symbols_on_windows.patch do_not_export_private_v8_symbols_on_windows.patch
fix_build_deprecated_attribute_for_older_msvc_versions.patch fix_build_deprecated_attribute_for_older_msvc_versions.patch
chore_allow_customizing_microtask_policy_per_context.patch chore_allow_customizing_microtask_policy_per_context.patch
fix_compile_error_on_macos_with_fork_optimization.patch

Просмотреть файл

@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Tue, 15 Aug 2023 23:59:59 +0900
Subject: fix: compile error on macOS with
v8_enable_private_mapping_fork_optimization=true
Follow-up to https://chromium-review.googlesource.com/c/v8/v8/+/4602858,
we are trying to enable this flag in Electron without any OS conditions in
args.gn which results in a compilation failure on macOS due to the lack of MADV_DONTFORK.
Given that Node.js and Electron both use posix_spawn on macOS which
by default does not copy MAP_JIT locations, it would be safe to isolate
the change only for linux.
Change-Id: I58ad50e557016fa573d7a27f33a60e2e5b7d1804
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4780212
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Deepak Mohan (Robo) <hop2deep@gmail.com>
Cr-Commit-Position: refs/heads/main@{#89557}
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index 77fd9e8f6dd5938d38344ffb0074fb70a0969fd9..73cdbdb19df2aecf3046b2bb2b6cb121f4dc5ca7 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -161,7 +161,7 @@ void* Allocate(void* hint, size_t size, OS::MemoryPermission access,
void* result = mmap(hint, size, prot, flags, kMmapFd, kMmapFdOffset);
if (result == MAP_FAILED) return nullptr;
-#if V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION
+#if V8_OS_LINUX && V8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION
// This is advisory, so we ignore errors.
madvise(result, size, MADV_DONTFORK);
#endif