• Peter Marshall's avatar
    [builtins] Don't clear buffer memory that will be overwritten. · e28f7fc9
    Peter Marshall authored
    Currently we initialize the allocated buffer to be full of 0s, which
    adds significant overhead.
    
    TypedArrayConstructByArrayLike will always either fully initialize the
    buffer, or throw an exception, in which case the buffer will not be
    leaked to user code.
    
    The length of the new TypedArray (and thus the buffer) is derived from
    the length of the source Array/TypedArray, so we know that we will
    always set every byte of the new buffer, or throw trying.
    
    Bug:v8:5977
    
    Change-Id: I8ceaa883cfad85f8708a5bdaada3ce463d97e007
    Reviewed-on: https://chromium-review.googlesource.com/469348Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
    Commit-Queue: Peter Marshall <petermarshall@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#44447}
    e28f7fc9
builtins-arraybuffer.cc 12.3 KB