From a65d01d0adf8c7d23714f1805357da8f8e245a66 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 14 Apr 2024 22:59:45 +0200 Subject: [PATCH 1/3] deps: V8: cherry-pick cd10ad7cdbe5 Original commit message: [compiler] reset script details in functions deserialized from code cache During the serialization of the code cache, V8 would wipe out the host-defined options, so after a script id deserialized from the code cache, the host-defined options need to be reset on the script using what's provided by the embedder when doing the deserializing compilation, otherwise the HostImportModuleDynamically callbacks can't get the data it needs to implement dynamic import(). Change-Id: I33cc6a5e43b6469d3527242e083f7ae6d8ed0c6a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5401780 Reviewed-by: Leszek Swirski Commit-Queue: Joyee Cheung Cr-Commit-Position: refs/heads/main@{#93323} Refs: https://github.com/v8/v8/commit/cd10ad7cdbe558e06dd0e8a8923834be8efdf245 --- common.gypi | 2 +- deps/v8/src/codegen/compiler.cc | 19 +-- deps/v8/src/codegen/compiler.h | 2 +- deps/v8/src/codegen/script-details.h | 3 + deps/v8/src/snapshot/code-serializer.cc | 34 ++-- deps/v8/src/snapshot/code-serializer.h | 5 +- deps/v8/test/cctest/test-serialize.cc | 209 ++++++++++++++++++++++++ 7 files changed, 247 insertions(+), 27 deletions(-) diff --git a/common.gypi b/common.gypi index 108788e98a3f2c..dbb8c0ff6085e6 100644 --- a/common.gypi +++ b/common.gypi @@ -37,7 +37,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.9', + 'v8_embedder_string': '-node.10', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/codegen/compiler.cc b/deps/v8/src/codegen/compiler.cc index ef884f7d5866f8..c38fad5d3a38df 100644 --- a/deps/v8/src/codegen/compiler.cc +++ b/deps/v8/src/codegen/compiler.cc @@ -1720,10 +1720,8 @@ BackgroundCompileTask::BackgroundCompileTask( BackgroundCompileTask::~BackgroundCompileTask() = default; -namespace { - void SetScriptFieldsFromDetails(Isolate* isolate, Tagged