Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de8227087714d02287b01937b7046c39cb660f12
      
https://github.com/WebKit/WebKit/commit/de8227087714d02287b01937b7046c39cb660f12
  Author: Vassili Bykov <[email protected]>
  Date:   2026-06-03 (Wed, 03 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 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/314513@main



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

Reply via email to