From f819aec288eacd8f0750793045bcbc37e22b5572 Mon Sep 17 00:00:00 2001 From: Chengzhong Wu Date: Mon, 20 Oct 2025 10:22:14 +0100 Subject: [PATCH] deps: V8: cherry-pick ff34ae20c8e3 Original commit message: [objects] improve module linked status DCHECKs Improve DCHECKs that requires a module to be linked. This includes kLinked, kEvaluated, kEvaluatingAsync, kErrored and the missing kEvaluating. kEvaluating can be found when a cyclic module is been evaluated synchronously. Refs: https://github.com/nodejs/node/pull/60111#issuecomment-3375399863 Change-Id: Ie0b9be22f2d3b8208571d8b419da3505b9f57b65 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7031498 Reviewed-by: Camillo Bruni Commit-Queue: Chengzhong Wu Cr-Commit-Position: refs/heads/main@{#103203} Refs: https://github.com/v8/v8/commit/ff34ae20c8e35b59f43da5a59b5f3d8297c698cf PR-URL: https://github.com/nodejs/node/pull/60111 Reviewed-By: Richard Lau Reviewed-By: Joyee Cheung Reviewed-By: Yagiz Nizipli --- common.gypi | 2 +- deps/v8/src/objects/module.cc | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common.gypi b/common.gypi index 09bb9b9362..a1cd836b18 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,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.8', + 'v8_embedder_string': '-node.9', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/objects/module.cc b/deps/v8/src/objects/module.cc index 41f073755a..ae4fa42aca 100644 --- a/deps/v8/src/objects/module.cc +++ b/deps/v8/src/objects/module.cc @@ -223,8 +223,7 @@ bool Module::Instantiate(Isolate* isolate, Handle module, DCHECK_EQ(module->status(), kUnlinked); return false; } - DCHECK(module->status() == kLinked || module->status() == kEvaluated || - module->status() == kEvaluatingAsync || module->status() == kErrored); + DCHECK_GE(module->status(), kLinked); DCHECK(stack.empty()); return true; } @@ -488,8 +487,7 @@ bool Module::IsGraphAsync(Isolate* isolate) const { // Only SourceTextModules may be async. if (!IsSourceTextModule(*this)) return false; Tagged root = Cast(*this); - DCHECK(root->status() == kLinked || root->status() == kEvaluated || - root->status() == kEvaluatingAsync || root->status() == kErrored); + DCHECK_GE(root->status(), kLinked); Zone zone(isolate->allocator(), ZONE_NAME); const size_t bucket_count = 2;