• Peter Marshall's avatar
    [memory] Save space in the FeedbackMetadata on 64 bit platforms. · 5a70a5ea
    Peter Marshall authored
    Previously we used a FixedArray for the FeedbackMetadata, packing bits
    of information into Smi fields. On 64-bit platforms, we waste at least
    half of the available memory by using the Smi representation.
    
    Given that this is just raw data (no pointers), we can just use a new
    type that uses the existing packing scheme to store the data in int32
    format instead.
    
    This CL changes FeedbackMetadata to a new subclass of HeapObject. This
    is to reduce the API surface exposed, in comparison to extending/using
    a more general purpose data structure like ByteArray, which is also just
    raw data.
    
    FeedbackMetadata only exposes general purpose methods for accessing
    slots, but hides the implementation detail of packing bits into int32
    fields.
    
    This CL also introduces a sentinal EmptyFeedbackMetadata, because there
    are ~750 empty FeedbackMetadata objects when running an empty program in
    V8. These are probably for builtins.
    
    Bug: v8:7500
    Change-Id: Ic85563153abbd71a22854cee8519260c32b1e9ab
    Reviewed-on: https://chromium-review.googlesource.com/945730
    Commit-Queue: Peter Marshall <petermarshall@chromium.org>
    Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
    Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#51842}
    5a70a5ea
heap.h 118 KB