Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8cb7e38ecdc81eae11a62e192220f9f5658cd4d9
      
https://github.com/WebKit/WebKit/commit/8cb7e38ecdc81eae11a62e192220f9f5658cd4d9
  Author: Vassili Bykov <[email protected]>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M Source/JavaScriptCore/assembler/CPU.h
    M Source/JavaScriptCore/bytecode/InlineCacheHandler.cpp
    M Source/JavaScriptCore/bytecode/InlineCacheHandler.h
    M Source/JavaScriptCore/parser/Lexer.h

  Log Message:
  -----------
  [JSC] Optimize the layout of InlineCacheHandler
https://bugs.webkit.org/show_bug.cgi?id=316163
rdar://178579821

Reviewed by Yusuke Suzuki and Dan Hecht.

[This is a re-landing of https://github.com/WebKit/WebKit/pull/66329
with a fix to disable the layout check in Asan release builds.]

This patch optimizes the layout of InlineCacheHandler to place hot fields 
within the same
cache line and reduce padding.

Key changes:

- m_next is grouped with other hot fields and the class is made 
CACHE_LINE_ALIGNED to
ensure hot fields land on one cache line.

- m_structureID is placed as the first field. The instance begins with a hidden 
4-byte
refcount, and placing m_structureID first uses the 4 bytes between the refcount 
and the
first pointer-size field instead of wasting them on padding. Also, m_cacheType 
and
m_makesJSCalls are placed after the 4-byte m_offset, to use 2 out of 4 bytes of 
padding
between m_offset and m_uid.

- CACHE_LINE_ALIGNED is moved from Lexer.h to a reusable header CPU.h.

Testing: covered by existing tests.
Canonical link: https://commits.webkit.org/314595@main



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

Reply via email to