• Benedikt Meurer's avatar
    [dataview] Introduce JSDataView::data_pointer field. · 4ef714a6
    Benedikt Meurer authored
    This is a preparation for doing a similar change to JSTypedArrays to
    be able to finally access huge ArrayBuffers with TypedArrays. This CL
    itself improves the performance of DataViews, sometimes to be even
    faster than TypedArrays now. On the test case[1] we go from
    
      testDataViewGetUint8: 711 ms.
      testUint8Array: 654 ms.
      testDataViewGetUint16: 801 ms.
      testUint16Array: 649 ms.
      testDataViewGetInt32: 699 ms.
      testInt32Array: 648 ms.
      testDataViewGetFloat64: 701 ms.
      testFloat64Array: 650 ms.
    
    to
    
      testDataViewGetUint8: 622 ms.
      testUint8Array: 656 ms.
      testDataViewGetUint16: 634 ms.
      testUint16Array: 656 ms.
      testDataViewGetInt32: 629 ms.
      testInt32Array: 655 ms.
      testDataViewGetFloat64: 631 ms.
      testFloat64Array: 661 ms.
    
    so the performance improves by up to **20%**.
    
    [1] https://github.com/bmeurer/js-micro-benchmarks/blob/master/bench-dataview.js
    
    Tbr: ulan@chromium.org
    Bug: chromium:225811, v8:4153, v8:8383
    Change-Id: Ie4409e2fe96e5085ddcf5eb3f24f3cacfb3afe02
    Cq-Include-Trybots: luci.chromium.try:linux-rel,win7-rel
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1601144
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#61464}
    4ef714a6
objects-body-descriptors-inl.h 42.7 KB