• Clemens Backes's avatar
    [wasm] Decommit unneeded memory · cbdc8337
    Clemens Backes authored
    The {WasmCodeManager::Decommit} method is called for ranges that do not
    contain any live code any more. Instead of setting permissions to
    {kNoAccess} and discarding the pages, do actually decommit them. The
    difference is subtle, but decommitting tries harder to actually free the
    underlying physical pages (whereas discarding is more a hint to the
    operating system).
    
    After both operations, the memory is not accessible afterwards, so any
    further access results in a signal, and thus a crash of the process.
    
    R=jkummerow@chromium.org, mlippautz@chromium.org
    
    Change-Id: Iddeda5c4ed864682c4df589b6ea6e359bf03847a
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3427459Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#78916}
    cbdc8337
wasm-code-manager.cc 101 KB