• Jakob Kummerow's avatar
    [wasm-gc] Store instance/element size directly on Map · 30f5140f
    Jakob Kummerow authored
    It must be possible to determine an object's size on the heap without
    relying on the presence of any other objects. Specifically, if an
    object and its WasmTypeInfo die at the same time, they can be swept
    in any order, and the sweeper may need to know their sizes.
    This patch solves the problem by repurposing two bytes in the Map,
    where WasmStructs can store their instance size, and WasmArrays can
    store their element size (which can be used to compute their size).
    
    Fixed: chromium:1240670
    Change-Id: Ib960fd0a409936aff1aef4daafed4c38b8497880
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3106649
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#76391}
    30f5140f
wasm-objects.h 40.5 KB