[webkit-changes] [WebKit/WebKit] 15ea71: [JSC] Shrink ArrayAllocationProfile from 16 to 8 b...

Tadeu Zagallo noreply at github.com
Mon Feb 13 04:23:04 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 15ea71cc4b7df927a893c0439ab5ca30a852edbb
      https://github.com/WebKit/WebKit/commit/15ea71cc4b7df927a893c0439ab5ca30a852edbb
  Author: Tadeu Zagallo <tzagallo at apple.com>
  Date:   2023-02-13 (Mon, 13 Feb 2023)

  Changed paths:
    M Source/JavaScriptCore/bytecode/ArrayAllocationProfile.cpp
    M Source/JavaScriptCore/bytecode/ArrayAllocationProfile.h

  Log Message:
  -----------
  [JSC] Shrink ArrayAllocationProfile from 16 to 8 bytes
https://bugs.webkit.org/show_bug.cgi?id=252056
rdar://105277033

Reviewed by Yusuke Suzuki.

Currently, `ArrayAllocationProfile`s use 16 bytes: `IndexingMode` (1 byte), the
largest vector length seen (4 bytes), and a pointer to the last seen `JSArray`.
However, the vector length is limited to `BASE_CONTIGUOUS_VECTOR_LEN_MAX`, which
is `25`, so we can easily fit it in a byte, and combined with `CompactPointerTuple`,
we can fit the whole thing in 8 bytes.

* Source/JavaScriptCore/bytecode/ArrayAllocationProfile.cpp:
(JSC::ArrayAllocationProfile::updateProfile):
* Source/JavaScriptCore/bytecode/ArrayAllocationProfile.h:
(JSC::ArrayAllocationProfile::selectIndexingType):
(JSC::ArrayAllocationProfile::vectorLengthHint):
(JSC::ArrayAllocationProfile::updateLastAllocation):
(JSC::ArrayAllocationProfile::updateLastAllocationFor):
(JSC::ArrayAllocationProfile::IndexingTypeAndVectorLength::IndexingTypeAndVectorLength):
(JSC::ArrayAllocationProfile::IndexingTypeAndVectorLength::indexingType const):
(JSC::ArrayAllocationProfile::IndexingTypeAndVectorLength::vectorLength const):
(JSC::ArrayAllocationProfile::IndexingTypeAndVectorLength::operator bool const):

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




More information about the webkit-changes mailing list