Changeset 201226 in webkit


Ignore:
Timestamp:
May 20, 2016 2:47:18 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: retained size for typed arrays does not count native backing store
https://bugs.webkit.org/show_bug.cgi?id=157945
<rdar://problem/26392238>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-05-20
Reviewed by Geoffrey Garen.

  • runtime/JSArrayBuffer.h:
  • runtime/JSArrayBuffer.cpp:

(JSC::JSArrayBuffer::estimatedSize):
Include an estimatedSize implementation for JSArrayBuffer.
ArrayBuffer has a unique path, different from other data
stored in the Heap.

  • tests/heapProfiler/typed-array-sizes.js: Added.

Test sizes of TypedArray with and without an ArrayBuffer.
When the TypedArray is a view wrapping an ArrayBuffer, the
ArrayBuffer has the size.

Location:
trunk/Source/JavaScriptCore
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r201225 r201226  
     12016-05-20  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: retained size for typed arrays does not count native backing store
     4        https://bugs.webkit.org/show_bug.cgi?id=157945
     5        <rdar://problem/26392238>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * runtime/JSArrayBuffer.h:
     10        * runtime/JSArrayBuffer.cpp:
     11        (JSC::JSArrayBuffer::estimatedSize):
     12        Include an estimatedSize implementation for JSArrayBuffer.
     13        ArrayBuffer has a unique path, different from other data
     14        stored in the Heap.
     15
     16        * tests/heapProfiler/typed-array-sizes.js: Added.
     17        Test sizes of TypedArray with and without an ArrayBuffer.
     18        When the TypedArray is a view wrapping an ArrayBuffer, the
     19        ArrayBuffer has the size.
     20
    1212016-05-20  Geoffrey Garen  <ggaren@apple.com>
    222
  • trunk/Source/JavaScriptCore/runtime/JSArrayBuffer.cpp

    r198270 r201226  
    6767}
    6868
     69size_t JSArrayBuffer::estimatedSize(JSCell* cell)
     70{
     71    JSArrayBuffer* thisObject = jsCast<JSArrayBuffer*>(cell);
     72    size_t bufferEstimatedSize = thisObject->impl()->gcSizeEstimateInBytes();
     73    return Base::estimatedSize(cell) + bufferEstimatedSize;
     74}
     75
    6976bool JSArrayBuffer::getOwnPropertySlot(
    7077    JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
  • trunk/Source/JavaScriptCore/runtime/JSArrayBuffer.h

    r198023 r201226  
    5252   
    5353protected:
     54
     55    static size_t estimatedSize(JSCell*);
    5456    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5557    static bool put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
Note: See TracChangeset for help on using the changeset viewer.