⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181533 in webkit


Ignore:
Timestamp:
Mar 16, 2015, 3:13:35 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r181407 - Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
https://bugs.webkit.org/show_bug.cgi?id=142589

Reviewed by Andreas Kling.

Source/JavaScriptCore:

  • API/JSBase.cpp:

(JSReportExtraMemoryCost): Added a FIXME to annotate a known bug.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitAggregate):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::setJITCode): Updated for rename.

  • heap/Heap.cpp:

(JSC::Heap::Heap):
(JSC::Heap::reportExtraMemoryAllocatedSlowCase):
(JSC::Heap::deprecatedReportExtraMemorySlowCase): Renamed our reporting
APIs to clarify their relationship to each other: One must report extra
memory at the time of allocation, and at the time the GC visits it.

(JSC::Heap::extraMemorySize):
(JSC::Heap::size):
(JSC::Heap::capacity):
(JSC::Heap::sizeAfterCollect):
(JSC::Heap::willStartCollection): Updated for renames. Added explicit
API for deprecated users who can't use our best API.

(JSC::Heap::reportExtraMemoryCostSlowCase): Deleted.
(JSC::Heap::extraSize): Deleted.

  • heap/Heap.h:
  • heap/HeapInlines.h:

(JSC::Heap::reportExtraMemoryAllocated):
(JSC::Heap::reportExtraMemoryVisited):
(JSC::Heap::deprecatedReportExtraMemory):
(JSC::Heap::reportExtraMemoryCost): Deleted. Ditto.

  • heap/SlotVisitor.h:
  • heap/SlotVisitorInlines.h:

(JSC::SlotVisitor::reportExtraMemoryVisited):
(JSC::SlotVisitor::reportExtraMemoryUsage): Deleted. Moved this
functionality into the Heap since it's pretty detailed in its access
to the heap.

  • runtime/JSArrayBufferView.cpp:

(JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):

  • runtime/JSGenericTypedArrayViewInlines.h:

(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren): Updated for
renames.

  • runtime/JSString.cpp:

(JSC::JSString::visitChildren):
(JSC::JSRopeString::resolveRopeToAtomicString):
(JSC::JSRopeString::resolveRope):

  • runtime/JSString.h:

(JSC::JSString::finishCreation): Updated for renames.

  • runtime/SparseArrayValueMap.cpp:

(JSC::SparseArrayValueMap::add): Added FIXME.

  • runtime/WeakMapData.cpp:

(JSC::WeakMapData::visitChildren): Updated for rename.

Source/WebCore:

Updated for renames to JSC extra cost APIs.

Added FIXMEs to our 10 use cases that are currently wrong, including
canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457.

  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::appendBufferInternal):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::reportExtraMemoryAllocated):
(WebCore::SourceBuffer::reportExtraMemoryCost): Deleted.

  • Modules/mediasource/SourceBuffer.h:
  • bindings/js/JSDocumentCustom.cpp:

(WebCore::toJS):

  • bindings/js/JSImageDataCustom.cpp:

(WebCore::toJS):

  • bindings/js/JSNodeListCustom.cpp:

(WebCore::createWrapper):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):

  • dom/CollectionIndexCache.cpp:

(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
(WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted.

  • dom/CollectionIndexCache.h:

(WebCore::Iterator>::computeNodeCountUpdatingListCache):

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::createImageBuffer):

  • html/HTMLCollection.h:

(WebCore::CollectionNamedElementCache::didPopulate):

  • html/HTMLImageLoader.cpp:

(WebCore::HTMLImageLoader::imageChanged):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::parseAttribute):

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::dropProtection):

Location:
releases/WebKitGTK/webkit-2.8/Source
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/API/JSBase.cpp

    r179211 r181533  
    139139    ExecState* exec = toJS(ctx);
    140140    JSLockHolder locker(exec);
    141     exec->vm().heap.reportExtraMemoryCost(size);
     141
     142    // FIXME: switch to deprecatedReportExtraMemory.
     143    // https://bugs.webkit.org/show_bug.cgi?id=142593
     144    exec->vm().heap.reportExtraMemoryAllocated(size);
    142145}
    143146
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog

    r181384 r181533  
     12015-03-11  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
     4        https://bugs.webkit.org/show_bug.cgi?id=142589
     5
     6        Reviewed by Andreas Kling.
     7
     8        * API/JSBase.cpp:
     9        (JSReportExtraMemoryCost): Added a FIXME to annotate a known bug.
     10
     11        * bytecode/CodeBlock.cpp:
     12        (JSC::CodeBlock::CodeBlock):
     13        (JSC::CodeBlock::visitAggregate):
     14        * bytecode/CodeBlock.h:
     15        (JSC::CodeBlock::setJITCode): Updated for rename.
     16
     17        * heap/Heap.cpp:
     18        (JSC::Heap::Heap):
     19        (JSC::Heap::reportExtraMemoryAllocatedSlowCase):
     20        (JSC::Heap::deprecatedReportExtraMemorySlowCase): Renamed our reporting
     21        APIs to clarify their relationship to each other: One must report extra
     22        memory at the time of allocation, and at the time the GC visits it.
     23
     24        (JSC::Heap::extraMemorySize):
     25        (JSC::Heap::size):
     26        (JSC::Heap::capacity):
     27        (JSC::Heap::sizeAfterCollect):
     28        (JSC::Heap::willStartCollection): Updated for renames. Added explicit
     29        API for deprecated users who can't use our best API.
     30 
     31        (JSC::Heap::reportExtraMemoryCostSlowCase): Deleted.
     32        (JSC::Heap::extraSize): Deleted.
     33
     34        * heap/Heap.h:
     35        * heap/HeapInlines.h:
     36        (JSC::Heap::reportExtraMemoryAllocated):
     37        (JSC::Heap::reportExtraMemoryVisited):
     38        (JSC::Heap::deprecatedReportExtraMemory):
     39        (JSC::Heap::reportExtraMemoryCost): Deleted. Ditto.
     40
     41        * heap/SlotVisitor.h:
     42        * heap/SlotVisitorInlines.h:
     43        (JSC::SlotVisitor::reportExtraMemoryVisited):
     44        (JSC::SlotVisitor::reportExtraMemoryUsage): Deleted. Moved this
     45        functionality into the Heap since it's pretty detailed in its access
     46        to the heap.
     47
     48        * runtime/JSArrayBufferView.cpp:
     49        (JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
     50        * runtime/JSGenericTypedArrayViewInlines.h:
     51        (JSC::JSGenericTypedArrayView<Adaptor>::visitChildren): Updated for
     52        renames.
     53
     54        * runtime/JSString.cpp:
     55        (JSC::JSString::visitChildren):
     56        (JSC::JSRopeString::resolveRopeToAtomicString):
     57        (JSC::JSRopeString::resolveRope):
     58        * runtime/JSString.h:
     59        (JSC::JSString::finishCreation): Updated for renames.
     60
     61        * runtime/SparseArrayValueMap.cpp:
     62        (JSC::SparseArrayValueMap::add): Added FIXME.
     63
     64        * runtime/WeakMapData.cpp:
     65        (JSC::WeakMapData::visitChildren): Updated for rename.
     66
    1672015-03-10  Mark Lam  <mark.lam@apple.com>
    268
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r180851 r181533  
    16661666   
    16671667    m_heap->m_codeBlocks.add(this);
    1668     m_heap->reportExtraMemoryCost(sizeof(CodeBlock));
     1668    m_heap->reportExtraMemoryAllocated(sizeof(CodeBlock));
    16691669}
    16701670
     
    21432143   
    21442144    m_heap->m_codeBlocks.add(this);
    2145     m_heap->reportExtraMemoryCost(sizeof(CodeBlock) + m_instructions.size() * sizeof(Instruction));
     2145    m_heap->reportExtraMemoryAllocated(sizeof(CodeBlock) + m_instructions.size() * sizeof(Instruction));
    21462146}
    21472147
     
    22352235        otherBlock->visitAggregate(visitor);
    22362236
    2237     visitor.reportExtraMemoryUsage(ownerExecutable(), sizeof(CodeBlock));
     2237    visitor.reportExtraMemoryVisited(ownerExecutable(), sizeof(CodeBlock));
    22382238    if (m_jitCode)
    2239         visitor.reportExtraMemoryUsage(ownerExecutable(), m_jitCode->size());
     2239        visitor.reportExtraMemoryVisited(ownerExecutable(), m_jitCode->size());
    22402240    if (m_instructions.size()) {
    22412241        // Divide by refCount() because m_instructions points to something that is shared
     
    22432243        // Having each CodeBlock report only its proportional share of the size is one way
    22442244        // of accomplishing this.
    2245         visitor.reportExtraMemoryUsage(ownerExecutable(), m_instructions.size() * sizeof(Instruction) / m_instructions.refCount());
     2245        visitor.reportExtraMemoryVisited(ownerExecutable(), m_instructions.size() * sizeof(Instruction) / m_instructions.refCount());
    22462246    }
    22472247
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/CodeBlock.h

    r179862 r181533  
    274274    {
    275275        ASSERT(m_heap->isDeferred());
    276         m_heap->reportExtraMemoryCost(code->size());
     276        m_heap->reportExtraMemoryAllocated(code->size());
    277277        ConcurrentJITLocker locker(m_lock);
    278278        WTF::storeStoreFence(); // This is probably not needed because the lock will also do something similar, but it's good to be paranoid.
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/Heap.cpp

    r181374 r181533  
    311311    , m_objectSpace(this)
    312312    , m_storageSpace(this)
    313     , m_extraMemoryUsage(0)
     313    , m_extraMemorySize(0)
     314    , m_deprecatedExtraMemorySize(0)
    314315    , m_machineThreads(this)
    315316    , m_sharedData(vm)
     
    379380}
    380381
    381 void Heap::reportExtraMemoryCostSlowCase(size_t cost)
    382 {
    383     // Our frequency of garbage collection tries to balance memory use against speed
    384     // by collecting based on the number of newly created values. However, for values
    385     // that hold on to a great deal of memory that's not in the form of other JS values,
    386     // that is not good enough - in some cases a lot of those objects can pile up and
    387     // use crazy amounts of memory without a GC happening. So we track these extra
    388     // memory costs. Only unusually large objects are noted, and we only keep track
    389     // of this extra cost until the next GC. In garbage collected languages, most values
    390     // are either very short lived temporaries, or have extremely long lifetimes. So
    391     // if a large value survives one garbage collection, there is not much point to
    392     // collecting more frequently as long as it stays alive.
    393 
    394     didAllocate(cost);
     382void Heap::reportExtraMemoryAllocatedSlowCase(size_t size)
     383{
     384    didAllocate(size);
    395385    collectIfNecessaryOrDefer();
     386}
     387
     388void Heap::deprecatedReportExtraMemorySlowCase(size_t size)
     389{
     390    m_deprecatedExtraMemorySize += size;
     391    reportExtraMemoryAllocatedSlowCase(size);
    396392}
    397393
     
    841837}
    842838
    843 size_t Heap::extraSize()
    844 {
    845     return m_extraMemoryUsage + m_arrayBuffers.size();
     839size_t Heap::extraMemorySize()
     840{
     841    return m_extraMemorySize + m_deprecatedExtraMemorySize + m_arrayBuffers.size();
    846842}
    847843
    848844size_t Heap::size()
    849845{
    850     return m_objectSpace.size() + m_storageSpace.size() + extraSize();
     846    return m_objectSpace.size() + m_storageSpace.size() + extraMemorySize();
    851847}
    852848
    853849size_t Heap::capacity()
    854850{
    855     return m_objectSpace.capacity() + m_storageSpace.capacity() + extraSize();
     851    return m_objectSpace.capacity() + m_storageSpace.capacity() + extraMemorySize();
    856852}
    857853
     
    863859    // always the case that m_totalBytesCopied <= m_storageSpace.size().
    864860    ASSERT(m_totalBytesCopied <= m_storageSpace.size());
    865     return m_totalBytesVisited + m_totalBytesCopied + extraSize();
     861    return m_totalBytesVisited + m_totalBytesCopied + extraMemorySize();
    866862}
    867863
     
    11111107    if (m_operationInProgress == FullCollection) {
    11121108        m_sizeBeforeLastFullCollect = m_sizeAfterLastCollect + m_bytesAllocatedThisCycle;
    1113         m_extraMemoryUsage = 0;
     1109        m_extraMemorySize = 0;
     1110        m_deprecatedExtraMemorySize = 0;
    11141111
    11151112        if (m_fullActivityCallback)
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/Heap.h

    r181374 r181533  
    161161    bool collectIfNecessaryOrDefer(); // Returns true if it did collect.
    162162
    163     void reportExtraMemoryCost(size_t cost);
     163    // Use this API to report non-GC memory referenced by GC objects. Be sure to
     164    // call both of these functions: Calling only one may trigger catastropic
     165    // memory growth.
     166    void reportExtraMemoryAllocated(size_t);
     167    void reportExtraMemoryVisited(JSCell*, size_t);
     168
     169    // Use this API to report non-GC memory if you can't use the better API above.
     170    void deprecatedReportExtraMemory(size_t);
     171
    164172    JS_EXPORT_PRIVATE void reportAbandonedObjectGraph();
    165173
     
    167175    JS_EXPORT_PRIVATE bool unprotect(JSValue); // True when the protect count drops to 0.
    168176   
    169     size_t extraSize(); // extra memory usage outside of pages allocated by the heap
     177    size_t extraMemorySize(); // Non-GC memory referenced by GC objects.
    170178    JS_EXPORT_PRIVATE size_t size();
    171179    JS_EXPORT_PRIVATE size_t capacity();
     
    261269    void* allocateWithoutDestructor(size_t); // For use with objects without destructors.
    262270
    263     static const size_t minExtraCost = 256;
    264     static const size_t maxExtraCost = 1024 * 1024;
     271    static const size_t minExtraMemory = 256;
    265272   
    266273    class FinalizerOwner : public WeakHandleOwner {
     
    269276
    270277    JS_EXPORT_PRIVATE bool isValidAllocation(size_t);
    271     JS_EXPORT_PRIVATE void reportExtraMemoryCostSlowCase(size_t);
     278    JS_EXPORT_PRIVATE void reportExtraMemoryAllocatedSlowCase(size_t);
     279    JS_EXPORT_PRIVATE void deprecatedReportExtraMemorySlowCase(size_t);
    272280
    273281    void collectImpl(HeapOperation, void* stackOrigin, void* stackTop, MachineThreads::RegisterState&);
     
    354362    CopiedSpace m_storageSpace;
    355363    GCIncomingRefCountedSet<ArrayBuffer> m_arrayBuffers;
    356     size_t m_extraMemoryUsage;
     364    size_t m_extraMemorySize;
     365    size_t m_deprecatedExtraMemorySize;
    357366
    358367    HashSet<const JSCell*> m_copyingRememberedSet;
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/HeapInlines.h

    r181374 r181533  
    153153}
    154154
    155 inline void Heap::reportExtraMemoryCost(size_t cost)
    156 {
    157     if (cost > minExtraCost)
    158         reportExtraMemoryCostSlowCase(cost);
     155inline void Heap::reportExtraMemoryAllocated(size_t size)
     156{
     157    if (size > minExtraMemory)
     158        reportExtraMemoryAllocatedSlowCase(size);
     159}
     160
     161inline void Heap::reportExtraMemoryVisited(JSCell* owner, size_t size)
     162{
     163#if ENABLE(GGC)
     164    // We don't want to double-count the extra memory that was reported in previous collections.
     165    if (operationInProgress() == EdenCollection && Heap::isRemembered(owner))
     166        return;
     167#else
     168    UNUSED_PARAM(owner);
     169#endif
     170
     171    size_t* counter = &m_extraMemorySize;
     172   
     173#if ENABLE(COMPARE_AND_SWAP)
     174    for (;;) {
     175        size_t oldSize = *counter;
     176        if (WTF::weakCompareAndSwapSize(counter, oldSize, oldSize + size))
     177            return;
     178    }
     179#else
     180    (*counter) += size;
     181#endif
     182}
     183
     184inline void Heap::deprecatedReportExtraMemory(size_t size)
     185{
     186    if (size > minExtraMemory)
     187        deprecatedReportExtraMemorySlowCase(size);
    159188}
    160189
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/SlotVisitor.h

    r167326 r181533  
    106106    void copyLater(JSCell*, CopyToken, void*, size_t);
    107107   
    108     void reportExtraMemoryUsage(JSCell* owner, size_t);
     108    void reportExtraMemoryVisited(JSCell* owner, size_t);
    109109   
    110110    void addWeakReferenceHarvester(WeakReferenceHarvester*);
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/SlotVisitorInlines.h

    r167326 r181533  
    253253}
    254254   
    255 inline void SlotVisitor::reportExtraMemoryUsage(JSCell* owner, size_t size)
    256 {
    257 #if ENABLE(GGC)
    258     // We don't want to double-count the extra memory that was reported in previous collections.
    259     if (heap()->operationInProgress() == EdenCollection && Heap::isRemembered(owner))
    260         return;
    261 #else
    262     UNUSED_PARAM(owner);
    263 #endif
    264 
    265     size_t* counter = &m_shared.m_vm->heap.m_extraMemoryUsage;
    266    
    267 #if ENABLE(COMPARE_AND_SWAP)
    268     for (;;) {
    269         size_t oldSize = *counter;
    270         if (WTF::weakCompareAndSwapSize(counter, oldSize, oldSize + size))
    271             return;
    272     }
    273 #else
    274     (*counter) += size;
    275 #endif
     255inline void SlotVisitor::reportExtraMemoryVisited(JSCell* owner, size_t size)
     256{
     257    heap()->reportExtraMemoryVisited(owner, size);
    276258}
    277259
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp

    r172176 r181533  
    7979    }
    8080   
    81     vm.heap.reportExtraMemoryCost(static_cast<size_t>(length) * elementSize);
     81    vm.heap.reportExtraMemoryAllocated(static_cast<size_t>(length) * elementSize);
    8282   
    8383    m_structure = structure;
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h

    r178928 r181533  
    447447       
    448448    case OversizeTypedArray: {
    449         visitor.reportExtraMemoryUsage(thisObject, thisObject->byteSize());
     449        visitor.reportExtraMemoryVisited(thisObject, thisObject->byteSize());
    450450        break;
    451451    }
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSString.cpp

    r181374 r181533  
    7878        StringImpl* impl = thisObject->m_value.impl();
    7979        ASSERT(impl);
    80         visitor.reportExtraMemoryUsage(thisObject, impl->costDuringGC());
     80        visitor.reportExtraMemoryVisited(thisObject, impl->costDuringGC());
    8181    }
    8282}
     
    182182    // If we resolved a string that didn't previously exist, notify the heap that we've grown.
    183183    if (m_value.impl()->hasOneRef())
    184         Heap::heap(this)->reportExtraMemoryCost(m_value.impl()->cost());
     184        Heap::heap(this)->reportExtraMemoryAllocated(m_value.impl()->cost());
    185185}
    186186
     
    241241        LChar* buffer;
    242242        if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) {
    243             Heap::heap(this)->reportExtraMemoryCost(newImpl->cost());
     243            Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost());
    244244            m_value = newImpl.release();
    245245        } else {
     
    255255    UChar* buffer;
    256256    if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) {
    257         Heap::heap(this)->reportExtraMemoryCost(newImpl->cost());
     257        Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost());
    258258        m_value = newImpl.release();
    259259    } else {
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSString.h

    r178928 r181533  
    108108        m_length = length;
    109109        setIs8Bit(m_value.impl()->is8Bit());
    110         Heap::heap(this)->reportExtraMemoryCost(cost);
     110        Heap::heap(this)->reportExtraMemoryAllocated(cost);
    111111        vm.m_newStringsSinceLastHashCons++;
    112112    }
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp

    r171824 r181533  
    8181    size_t capacity = m_map.capacity();
    8282    if (capacity != m_reportedCapacity) {
    83         Heap::heap(array)->reportExtraMemoryCost((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>)));
     83        // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     84        // https://bugs.webkit.org/show_bug.cgi?id=142593
     85        Heap::heap(array)->reportExtraMemoryAllocated((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>)));
    8486        m_reportedCapacity = capacity;
    8587    }
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/WeakMapData.cpp

    r171824 r181533  
    6565    // This isn't exact, but it is close enough, and proportional to the actual
    6666    // external mermory usage.
    67     visitor.reportExtraMemoryUsage(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>)));
     67    visitor.reportExtraMemoryVisited(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>)));
    6868}
    6969
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog

    r181528 r181533  
     12015-03-11  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
     4        https://bugs.webkit.org/show_bug.cgi?id=142589
     5
     6        Reviewed by Andreas Kling.
     7
     8        Updated for renames to JSC extra cost APIs.
     9
     10        Added FIXMEs to our 10 use cases that are currently wrong, including
     11        canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457.
     12
     13        * Modules/mediasource/SourceBuffer.cpp:
     14        (WebCore::SourceBuffer::appendBufferInternal):
     15        (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
     16        (WebCore::SourceBuffer::reportExtraMemoryAllocated):
     17        (WebCore::SourceBuffer::reportExtraMemoryCost): Deleted.
     18        * Modules/mediasource/SourceBuffer.h:
     19        * bindings/js/JSDocumentCustom.cpp:
     20        (WebCore::toJS):
     21        * bindings/js/JSImageDataCustom.cpp:
     22        (WebCore::toJS):
     23        * bindings/js/JSNodeListCustom.cpp:
     24        (WebCore::createWrapper):
     25        * bindings/scripts/CodeGeneratorJS.pm:
     26        (GenerateImplementation):
     27        * dom/CollectionIndexCache.cpp:
     28        (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
     29        (WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted.
     30        * dom/CollectionIndexCache.h:
     31        (WebCore::Iterator>::computeNodeCountUpdatingListCache):
     32        * html/HTMLCanvasElement.cpp:
     33        (WebCore::HTMLCanvasElement::createImageBuffer):
     34        * html/HTMLCollection.h:
     35        (WebCore::CollectionNamedElementCache::didPopulate):
     36        * html/HTMLImageLoader.cpp:
     37        (WebCore::HTMLImageLoader::imageChanged):
     38        * html/HTMLMediaElement.cpp:
     39        (WebCore::HTMLMediaElement::parseAttribute):
     40        * xml/XMLHttpRequest.cpp:
     41        (WebCore::XMLHttpRequest::dropProtection):
     42
    1432015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
    244
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r179762 r181533  
    572572    m_appendBufferTimer.startOneShot(0);
    573573
    574     reportExtraMemoryCost();
     574    reportExtraMemoryAllocated();
    575575}
    576576
     
    658658    }
    659659
    660     reportExtraMemoryCost();
     660    reportExtraMemoryAllocated();
    661661    if (extraMemoryCost() > this->maximumBufferSize())
    662662        m_bufferFull = true;
     
    19791979}
    19801980
    1981 void SourceBuffer::reportExtraMemoryCost()
     1981void SourceBuffer::reportExtraMemoryAllocated()
    19821982{
    19831983    size_t extraMemoryCost = this->extraMemoryCost();
     
    19891989
    19901990    JSC::JSLockHolder lock(scriptExecutionContext()->vm());
    1991     if (extraMemoryCostDelta > 0)
    1992         scriptExecutionContext()->vm().heap.reportExtraMemoryCost(extraMemoryCostDelta);
     1991    if (extraMemoryCostDelta > 0) {
     1992        // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     1993        // https://bugs.webkit.org/show_bug.cgi?id=142593
     1994        scriptExecutionContext()->vm().heap.reportExtraMemoryAllocated(extraMemoryCostDelta);
     1995    }
    19931996}
    19941997
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/Modules/mediasource/SourceBuffer.h

    r179762 r181533  
    190190
    191191    size_t extraMemoryCost() const;
    192     void reportExtraMemoryCost();
     192    void reportExtraMemoryAllocated();
    193193
    194194    std::unique_ptr<PlatformTimeRanges> bufferedAccountingForEndOfStream() const;
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/js/JSDocumentCustom.cpp

    r179353 r181533  
    110110            nodeCount++;
    111111       
    112         exec->heap()->reportExtraMemoryCost(nodeCount * sizeof(Node));
     112        // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     113        // https://bugs.webkit.org/show_bug.cgi?id=142593
     114        exec->heap()->reportExtraMemoryAllocated(nodeCount * sizeof(Node));
    113115    }
    114116
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/js/JSImageDataCustom.cpp

    r170167 r181533  
    4848    Identifier dataName(exec, "data");
    4949    wrapper->putDirect(exec->vm(), dataName, toJS(exec, globalObject, imageData->data()), DontDelete | ReadOnly);
    50     exec->heap()->reportExtraMemoryCost(imageData->data()->length());
     50    // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     51    // https://bugs.webkit.org/show_bug.cgi?id=142593
     52    exec->heap()->reportExtraMemoryAllocated(imageData->data()->length());
    5153   
    5254    return wrapper;
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/js/JSNodeListCustom.cpp

    r166520 r181533  
    6363JSC::JSValue createWrapper(JSDOMGlobalObject& globalObject, NodeList& nodeList)
    6464{
    65     globalObject.vm().heap.reportExtraMemoryCost(nodeList.memoryCost());
     65    // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     66    // https://bugs.webkit.org/show_bug.cgi?id=142593
     67    globalObject.vm().heap.reportExtraMemoryAllocated(nodeList.memoryCost());
    6668    return createNewWrapper<JSNodeList>(&globalObject, &nodeList);
    6769}
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r180860 r181533  
    28582858        push(@implContent, "    thisObject->visitAdditionalChildren(visitor);\n") if $interface->extendedAttributes->{"JSCustomMarkFunction"};
    28592859        if ($interface->extendedAttributes->{"ReportExtraMemoryCost"}) {
    2860             push(@implContent, "    visitor.reportExtraMemoryUsage(cell, thisObject->impl().memoryCost());\n");
     2860            push(@implContent, "    visitor.reportExtraMemoryVisited(cell, thisObject->impl().memoryCost());\n");
    28612861        }
    28622862        if ($numCachedAttributes > 0) {
     
    30733073END
    30743074        push(@implContent, <<END) if $interface->extendedAttributes->{"ReportExtraMemoryCost"};
    3075     globalObject->vm().heap.reportExtraMemoryCost(impl->memoryCost());
     3075    globalObject->vm().heap.reportExtraMemoryAllocated(impl->memoryCost());
    30763076END
    30773077
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/dom/CollectionIndexCache.cpp

    r164968 r181533  
    3131namespace WebCore {
    3232
    33 void reportExtraMemoryCostForCollectionIndexCache(size_t cost)
     33void reportExtraMemoryAllocatedForCollectionIndexCache(size_t cost)
    3434{
    3535    JSC::VM& vm = JSDOMWindowBase::commonVM();
    3636    JSC::JSLockHolder lock(vm);
    37     vm.heap.reportExtraMemoryCost(cost);
     37    // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     38    // https://bugs.webkit.org/show_bug.cgi?id=142593
     39    vm.heap.reportExtraMemoryAllocated(cost);
    3840}
    3941
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/dom/CollectionIndexCache.h

    r166460 r181533  
    3131namespace WebCore {
    3232
    33 void reportExtraMemoryCostForCollectionIndexCache(size_t);
     33void reportExtraMemoryAllocatedForCollectionIndexCache(size_t);
    3434
    3535template <class Collection, class Iterator>
     
    101101
    102102    if (unsigned capacityDifference = m_cachedList.capacity() - oldCapacity)
    103         reportExtraMemoryCostForCollectionIndexCache(capacityDifference * sizeof(NodeType*));
     103        reportExtraMemoryAllocatedForCollectionIndexCache(capacityDifference * sizeof(NodeType*));
    104104
    105105    return m_cachedList.size();
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLCanvasElement.cpp

    r180760 r181533  
    581581    JSC::JSLockHolder lock(scriptExecutionContext()->vm());
    582582    size_t numBytes = 4 * m_imageBuffer->internalSize().width() * m_imageBuffer->internalSize().height();
    583     scriptExecutionContext()->vm().heap.reportExtraMemoryCost(numBytes);
     583    // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     584    // https://bugs.webkit.org/show_bug.cgi?id=142593
     585    scriptExecutionContext()->vm().heap.reportExtraMemoryAllocated(numBytes);
    584586
    585587#if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLCollection.h

    r177259 r181533  
    161161#endif
    162162    if (size_t cost = memoryCost())
    163         reportExtraMemoryCostForCollectionIndexCache(cost);
     163        reportExtraMemoryAllocatedForCollectionIndexCache(cost);
    164164}
    165165
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLImageLoader.cpp

    r179344 r181533  
    8888            JSC::VM& vm = JSDOMWindowBase::commonVM();
    8989            JSC::JSLockHolder lock(vm);
    90             vm.heap.reportExtraMemoryCost(cachedImage->encodedSize());
     90            // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     91            // https://bugs.webkit.org/show_bug.cgi?id=142593
     92            vm.heap.reportExtraMemoryAllocated(cachedImage->encodedSize());
    9193        }
    9294    }
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.cpp

    r179784 r181533  
    693693            m_reportedExtraMemoryCost = extraMemoryCost;
    694694
    695             if (extraMemoryCostDelta > 0)
    696                 vm.heap.reportExtraMemoryCost(extraMemoryCostDelta);
     695            if (extraMemoryCostDelta > 0) {
     696                // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     697                // https://bugs.webkit.org/show_bug.cgi?id=142593
     698                vm.heap.reportExtraMemoryAllocated(extraMemoryCostDelta);
     699            }
    697700        }
    698701    }
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/xml/XMLHttpRequest.cpp

    r180132 r181533  
    914914    JSC::VM& vm = scriptExecutionContext()->vm();
    915915    JSC::JSLockHolder lock(vm);
    916     vm.heap.reportExtraMemoryCost(m_responseBuilder.length() * 2);
     916    // FIXME: Switch to deprecatedReportExtraMemory, or adopt reportExtraMemoryVisited.
     917    // https://bugs.webkit.org/show_bug.cgi?id=142593
     918    vm.heap.reportExtraMemoryAllocated(m_responseBuilder.length() * 2);
    917919
    918920    unsetPendingActivity(this);
Note: See TracChangeset for help on using the changeset viewer.