Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 198caec02193d891c319c60bbb3866b9fdf3495f
https://github.com/WebKit/WebKit/commit/198caec02193d891c319c60bbb3866b9fdf3495f
Author: Sosuke Suzuki <[email protected]>
Date: 2026-05-21 (Thu, 21 May 2026)
Changed paths:
M Source/JavaScriptCore/runtime/ModuleRegistryEntry.cpp
M Source/JavaScriptCore/runtime/ModuleRegistryEntry.h
Log Message:
-----------
[JSC] Merge `ModuleRegistryEntry` error fields into a single field
https://bugs.webkit.org/show_bug.cgi?id=315001
Reviewed by Yusuke Suzuki.
ModuleRegistryEntry holds three WriteBarrier<Unknown> error fields
(m_fetchError, m_instantiationError, m_evaluationError) that are
mutually exclusive: only one is ever populated, and m_status already
records which kind of failure occurred (FetchFailed / InstantiationFailed
/ EvaluationFailed). Merge them into a single m_error field disambiguated
by m_status. This shrinks ModuleRegistryEntry from 96 bytes to 80 bytes.
Also drop the unused instantiationError() and evaluationError() accessors,
and tighten setInstantiationError() / setEvaluationError() to early-return
when m_status is already FetchFailed. Previously these would store the
error but leave m_status untouched, making the stored value unobservable
since error() always preferred m_fetchError; the early return preserves
that observable behavior.
* Source/JavaScriptCore/runtime/ModuleRegistryEntry.cpp:
(JSC::ModuleRegistryEntry::visitChildrenImpl):
(JSC::ModuleRegistryEntry::ensureFetchPromise):
(JSC::ModuleRegistryEntry::error const):
(JSC::ModuleRegistryEntry::fetchError const):
(JSC::ModuleRegistryEntry::setFetchError):
(JSC::ModuleRegistryEntry::setInstantiationError):
(JSC::ModuleRegistryEntry::setEvaluationError):
(JSC::ModuleRegistryEntry::instantiationError const): Deleted.
(JSC::ModuleRegistryEntry::evaluationError const): Deleted.
* Source/JavaScriptCore/runtime/ModuleRegistryEntry.h:
Canonical link: https://commits.webkit.org/313651@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications