Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d651aafbb69606ecc27bde540533e014d5908ce5
      
https://github.com/WebKit/WebKit/commit/d651aafbb69606ecc27bde540533e014d5908ce5
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-07-23 (Thu, 23 Jul 2026)

  Changed paths:
    M Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp
    M Source/JavaScriptCore/runtime/AbstractModuleRecord.h
    M Source/JavaScriptCore/runtime/JSModuleLoader.cpp
    M Source/JavaScriptCore/runtime/JSModuleLoader.h

  Log Message:
  -----------
  [JSC] Remove `AbstractModuleRecord::m_dependencies`
https://bugs.webkit.org/show_bug.cgi?id=320144

Reviewed by Yusuke Suzuki.

AbstractModuleRecord::m_dependencies duplicated the specifier-to-module mapping
that m_loadedModules ([[LoadedModules]]) already holds, and was populated a 
second
time during InnerModuleLinking. hostResolveImportedModule now looks up 
m_loadedModules
directly by probing each ScriptFetchParameters::Type (JavaScript first, which 
is what
requests default to), which also lets us drop the linear-scan fallback
JSModuleLoader::maybeGetImportedModule and one Vector copy in visitChildren.

This shrinks AbstractModuleRecord from 264 to 256 bytes and removes one hash 
table
allocation (and its String keys) per module record.

* Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::visitChildrenImpl):
(JSC::AbstractModuleRecord::hostResolveImportedModule):
(JSC::AbstractModuleRecord::innerModuleLinking):
* Source/JavaScriptCore/runtime/AbstractModuleRecord.h:
* Source/JavaScriptCore/runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::maybeGetImportedModule): Deleted.
* Source/JavaScriptCore/runtime/JSModuleLoader.h:

Canonical link: https://commits.webkit.org/317844@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to