chore: cherry-pick 4508b5dfb26e from v8 (#49699)

* chore: cherry-pick 4508b5dfb26e from v8

* chore: update patch
This commit is contained in:
Keeley Hammond
2026-02-06 07:49:31 -08:00
committed by GitHub
parent 53982a2c3a
commit 45a6bfbae9
2 changed files with 64 additions and 0 deletions

View File

@@ -1 +1,2 @@
chore_allow_customizing_microtask_policy_per_context.patch
cherry-pick-4508b5dfb26e.patch

View File

@@ -0,0 +1,63 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Victor Gomes <victorgomes@chromium.org>
Date: Fri, 30 Jan 2026 15:18:32 +0100
Subject: [maglev] Module variables can be the hole
Module variables are lowered in Maglev to
LoadTaggedField(cell, Cell:kValueOffset).
Drive-by: order opcodes alphabetically in CanBeTheHoleValue.
Fixed: 479726070
Change-Id: I2be5752906cf2ec8fdb4df497724a4d9ad55648d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7534881
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#105008}
diff --git a/src/maglev/maglev-ir.cc b/src/maglev/maglev-ir.cc
index fa8d01e37f91a6b1ba3e1acc5c0749bd15c638f5..ee6af1a841d5097ae1aa7144e9415ba5141eaed4 100644
--- a/src/maglev/maglev-ir.cc
+++ b/src/maglev/maglev-ir.cc
@@ -621,6 +621,13 @@ Tribool ValueNode::IsTheHole() const {
if (const RootConstant* cst = TryCast<RootConstant>()) {
return ToTribool(cst->index() == RootIndex::kTheHoleValue);
}
+ if (const LoadTaggedField* load = TryCast<LoadTaggedField>()) {
+ // Modules variables can be the hole.
+ if (load->offset() == Cell::kValueOffset) {
+ return Tribool::kMaybe;
+ }
+ return Tribool::kFalse;
+ }
if (const LoadFixedArrayElement* load = TryCast<LoadFixedArrayElement>()) {
if (load->load_type() != LoadType::kUnknown) {
return Tribool::kFalse;
diff --git a/src/maglev/maglev-ir.h b/src/maglev/maglev-ir.h
index 7866f05de7ae832e1bda3697fc8cb95a45324c02..f099ff641d414196f92dd1f7a82a519129e4ac65 100644
--- a/src/maglev/maglev-ir.h
+++ b/src/maglev/maglev-ir.h
@@ -710,17 +710,18 @@ constexpr bool CanBeStoreToNonEscapedObject(Opcode opcode) {
constexpr bool CanBeTheHoleValue(Opcode opcode) {
switch (opcode) {
- case Opcode::kInitialValue:
- case Opcode::kCallRuntime:
// TODO(victorgomes): Should we have a list of builtins that could
// return the hole?
case Opcode::kCallBuiltin:
+ case Opcode::kCallRuntime:
case Opcode::kGeneratorRestoreRegister:
- case Opcode::kRootConstant:
+ case Opcode::kInitialValue:
case Opcode::kLoadContextSlot:
case Opcode::kLoadContextSlotNoCells:
case Opcode::kLoadFixedArrayElement:
+ case Opcode::kLoadTaggedField:
case Opcode::kPhi:
+ case Opcode::kRootConstant:
return true;
default:
return false;