Changeset 181533 in webkit
- Timestamp:
- Mar 16, 2015, 3:13:35 AM (11 years ago)
- Location:
- releases/WebKitGTK/webkit-2.8/Source
- Files:
-
- 29 edited
-
JavaScriptCore/API/JSBase.cpp (modified) (1 diff)
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/bytecode/CodeBlock.cpp (modified) (4 diffs)
-
JavaScriptCore/bytecode/CodeBlock.h (modified) (1 diff)
-
JavaScriptCore/heap/Heap.cpp (modified) (5 diffs)
-
JavaScriptCore/heap/Heap.h (modified) (5 diffs)
-
JavaScriptCore/heap/HeapInlines.h (modified) (1 diff)
-
JavaScriptCore/heap/SlotVisitor.h (modified) (1 diff)
-
JavaScriptCore/heap/SlotVisitorInlines.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSArrayBufferView.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSString.cpp (modified) (4 diffs)
-
JavaScriptCore/runtime/JSString.h (modified) (1 diff)
-
JavaScriptCore/runtime/SparseArrayValueMap.cpp (modified) (1 diff)
-
JavaScriptCore/runtime/WeakMapData.cpp (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/mediasource/SourceBuffer.cpp (modified) (4 diffs)
-
WebCore/Modules/mediasource/SourceBuffer.h (modified) (1 diff)
-
WebCore/bindings/js/JSDocumentCustom.cpp (modified) (1 diff)
-
WebCore/bindings/js/JSImageDataCustom.cpp (modified) (1 diff)
-
WebCore/bindings/js/JSNodeListCustom.cpp (modified) (1 diff)
-
WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (2 diffs)
-
WebCore/dom/CollectionIndexCache.cpp (modified) (1 diff)
-
WebCore/dom/CollectionIndexCache.h (modified) (2 diffs)
-
WebCore/html/HTMLCanvasElement.cpp (modified) (1 diff)
-
WebCore/html/HTMLCollection.h (modified) (1 diff)
-
WebCore/html/HTMLImageLoader.cpp (modified) (1 diff)
-
WebCore/html/HTMLMediaElement.cpp (modified) (1 diff)
-
WebCore/xml/XMLHttpRequest.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/API/JSBase.cpp
r179211 r181533 139 139 ExecState* exec = toJS(ctx); 140 140 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); 142 145 } 143 146 -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog
r181384 r181533 1 2015-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 1 67 2015-03-10 Mark Lam <mark.lam@apple.com> 2 68 -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r180851 r181533 1666 1666 1667 1667 m_heap->m_codeBlocks.add(this); 1668 m_heap->reportExtraMemory Cost(sizeof(CodeBlock));1668 m_heap->reportExtraMemoryAllocated(sizeof(CodeBlock)); 1669 1669 } 1670 1670 … … 2143 2143 2144 2144 m_heap->m_codeBlocks.add(this); 2145 m_heap->reportExtraMemory Cost(sizeof(CodeBlock) + m_instructions.size() * sizeof(Instruction));2145 m_heap->reportExtraMemoryAllocated(sizeof(CodeBlock) + m_instructions.size() * sizeof(Instruction)); 2146 2146 } 2147 2147 … … 2235 2235 otherBlock->visitAggregate(visitor); 2236 2236 2237 visitor.reportExtraMemory Usage(ownerExecutable(), sizeof(CodeBlock));2237 visitor.reportExtraMemoryVisited(ownerExecutable(), sizeof(CodeBlock)); 2238 2238 if (m_jitCode) 2239 visitor.reportExtraMemory Usage(ownerExecutable(), m_jitCode->size());2239 visitor.reportExtraMemoryVisited(ownerExecutable(), m_jitCode->size()); 2240 2240 if (m_instructions.size()) { 2241 2241 // Divide by refCount() because m_instructions points to something that is shared … … 2243 2243 // Having each CodeBlock report only its proportional share of the size is one way 2244 2244 // of accomplishing this. 2245 visitor.reportExtraMemory Usage(ownerExecutable(), m_instructions.size() * sizeof(Instruction) / m_instructions.refCount());2245 visitor.reportExtraMemoryVisited(ownerExecutable(), m_instructions.size() * sizeof(Instruction) / m_instructions.refCount()); 2246 2246 } 2247 2247 -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/bytecode/CodeBlock.h
r179862 r181533 274 274 { 275 275 ASSERT(m_heap->isDeferred()); 276 m_heap->reportExtraMemory Cost(code->size());276 m_heap->reportExtraMemoryAllocated(code->size()); 277 277 ConcurrentJITLocker locker(m_lock); 278 278 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 311 311 , m_objectSpace(this) 312 312 , m_storageSpace(this) 313 , m_extraMemoryUsage(0) 313 , m_extraMemorySize(0) 314 , m_deprecatedExtraMemorySize(0) 314 315 , m_machineThreads(this) 315 316 , m_sharedData(vm) … … 379 380 } 380 381 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); 382 void Heap::reportExtraMemoryAllocatedSlowCase(size_t size) 383 { 384 didAllocate(size); 395 385 collectIfNecessaryOrDefer(); 386 } 387 388 void Heap::deprecatedReportExtraMemorySlowCase(size_t size) 389 { 390 m_deprecatedExtraMemorySize += size; 391 reportExtraMemoryAllocatedSlowCase(size); 396 392 } 397 393 … … 841 837 } 842 838 843 size_t Heap::extra Size()844 { 845 return m_extraMemory Usage + m_arrayBuffers.size();839 size_t Heap::extraMemorySize() 840 { 841 return m_extraMemorySize + m_deprecatedExtraMemorySize + m_arrayBuffers.size(); 846 842 } 847 843 848 844 size_t Heap::size() 849 845 { 850 return m_objectSpace.size() + m_storageSpace.size() + extra Size();846 return m_objectSpace.size() + m_storageSpace.size() + extraMemorySize(); 851 847 } 852 848 853 849 size_t Heap::capacity() 854 850 { 855 return m_objectSpace.capacity() + m_storageSpace.capacity() + extra Size();851 return m_objectSpace.capacity() + m_storageSpace.capacity() + extraMemorySize(); 856 852 } 857 853 … … 863 859 // always the case that m_totalBytesCopied <= m_storageSpace.size(). 864 860 ASSERT(m_totalBytesCopied <= m_storageSpace.size()); 865 return m_totalBytesVisited + m_totalBytesCopied + extra Size();861 return m_totalBytesVisited + m_totalBytesCopied + extraMemorySize(); 866 862 } 867 863 … … 1111 1107 if (m_operationInProgress == FullCollection) { 1112 1108 m_sizeBeforeLastFullCollect = m_sizeAfterLastCollect + m_bytesAllocatedThisCycle; 1113 m_extraMemoryUsage = 0; 1109 m_extraMemorySize = 0; 1110 m_deprecatedExtraMemorySize = 0; 1114 1111 1115 1112 if (m_fullActivityCallback) -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/Heap.h
r181374 r181533 161 161 bool collectIfNecessaryOrDefer(); // Returns true if it did collect. 162 162 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 164 172 JS_EXPORT_PRIVATE void reportAbandonedObjectGraph(); 165 173 … … 167 175 JS_EXPORT_PRIVATE bool unprotect(JSValue); // True when the protect count drops to 0. 168 176 169 size_t extra Size(); // extra memory usage outside of pages allocated by the heap177 size_t extraMemorySize(); // Non-GC memory referenced by GC objects. 170 178 JS_EXPORT_PRIVATE size_t size(); 171 179 JS_EXPORT_PRIVATE size_t capacity(); … … 261 269 void* allocateWithoutDestructor(size_t); // For use with objects without destructors. 262 270 263 static const size_t minExtraCost = 256; 264 static const size_t maxExtraCost = 1024 * 1024; 271 static const size_t minExtraMemory = 256; 265 272 266 273 class FinalizerOwner : public WeakHandleOwner { … … 269 276 270 277 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); 272 280 273 281 void collectImpl(HeapOperation, void* stackOrigin, void* stackTop, MachineThreads::RegisterState&); … … 354 362 CopiedSpace m_storageSpace; 355 363 GCIncomingRefCountedSet<ArrayBuffer> m_arrayBuffers; 356 size_t m_extraMemoryUsage; 364 size_t m_extraMemorySize; 365 size_t m_deprecatedExtraMemorySize; 357 366 358 367 HashSet<const JSCell*> m_copyingRememberedSet; -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/HeapInlines.h
r181374 r181533 153 153 } 154 154 155 inline void Heap::reportExtraMemoryCost(size_t cost) 156 { 157 if (cost > minExtraCost) 158 reportExtraMemoryCostSlowCase(cost); 155 inline void Heap::reportExtraMemoryAllocated(size_t size) 156 { 157 if (size > minExtraMemory) 158 reportExtraMemoryAllocatedSlowCase(size); 159 } 160 161 inline 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 184 inline void Heap::deprecatedReportExtraMemory(size_t size) 185 { 186 if (size > minExtraMemory) 187 deprecatedReportExtraMemorySlowCase(size); 159 188 } 160 189 -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/SlotVisitor.h
r167326 r181533 106 106 void copyLater(JSCell*, CopyToken, void*, size_t); 107 107 108 void reportExtraMemory Usage(JSCell* owner, size_t);108 void reportExtraMemoryVisited(JSCell* owner, size_t); 109 109 110 110 void addWeakReferenceHarvester(WeakReferenceHarvester*); -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/heap/SlotVisitorInlines.h
r167326 r181533 253 253 } 254 254 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 255 inline void SlotVisitor::reportExtraMemoryVisited(JSCell* owner, size_t size) 256 { 257 heap()->reportExtraMemoryVisited(owner, size); 276 258 } 277 259 -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp
r172176 r181533 79 79 } 80 80 81 vm.heap.reportExtraMemory Cost(static_cast<size_t>(length) * elementSize);81 vm.heap.reportExtraMemoryAllocated(static_cast<size_t>(length) * elementSize); 82 82 83 83 m_structure = structure; -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
r178928 r181533 447 447 448 448 case OversizeTypedArray: { 449 visitor.reportExtraMemory Usage(thisObject, thisObject->byteSize());449 visitor.reportExtraMemoryVisited(thisObject, thisObject->byteSize()); 450 450 break; 451 451 } -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSString.cpp
r181374 r181533 78 78 StringImpl* impl = thisObject->m_value.impl(); 79 79 ASSERT(impl); 80 visitor.reportExtraMemory Usage(thisObject, impl->costDuringGC());80 visitor.reportExtraMemoryVisited(thisObject, impl->costDuringGC()); 81 81 } 82 82 } … … 182 182 // If we resolved a string that didn't previously exist, notify the heap that we've grown. 183 183 if (m_value.impl()->hasOneRef()) 184 Heap::heap(this)->reportExtraMemory Cost(m_value.impl()->cost());184 Heap::heap(this)->reportExtraMemoryAllocated(m_value.impl()->cost()); 185 185 } 186 186 … … 241 241 LChar* buffer; 242 242 if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) { 243 Heap::heap(this)->reportExtraMemory Cost(newImpl->cost());243 Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost()); 244 244 m_value = newImpl.release(); 245 245 } else { … … 255 255 UChar* buffer; 256 256 if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) { 257 Heap::heap(this)->reportExtraMemory Cost(newImpl->cost());257 Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost()); 258 258 m_value = newImpl.release(); 259 259 } else { -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/JSString.h
r178928 r181533 108 108 m_length = length; 109 109 setIs8Bit(m_value.impl()->is8Bit()); 110 Heap::heap(this)->reportExtraMemory Cost(cost);110 Heap::heap(this)->reportExtraMemoryAllocated(cost); 111 111 vm.m_newStringsSinceLastHashCons++; 112 112 } -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp
r171824 r181533 81 81 size_t capacity = m_map.capacity(); 82 82 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>))); 84 86 m_reportedCapacity = capacity; 85 87 } -
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/WeakMapData.cpp
r171824 r181533 65 65 // This isn't exact, but it is close enough, and proportional to the actual 66 66 // external mermory usage. 67 visitor.reportExtraMemory Usage(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>)));67 visitor.reportExtraMemoryVisited(thisObj, thisObj->m_map.capacity() * (sizeof(JSObject*) + sizeof(WriteBarrier<Unknown>))); 68 68 } 69 69 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog
r181528 r181533 1 2015-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 1 43 2015-03-11 Myles C. Maxfield <mmaxfield@apple.com> 2 44 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r179762 r181533 572 572 m_appendBufferTimer.startOneShot(0); 573 573 574 reportExtraMemory Cost();574 reportExtraMemoryAllocated(); 575 575 } 576 576 … … 658 658 } 659 659 660 reportExtraMemory Cost();660 reportExtraMemoryAllocated(); 661 661 if (extraMemoryCost() > this->maximumBufferSize()) 662 662 m_bufferFull = true; … … 1979 1979 } 1980 1980 1981 void SourceBuffer::reportExtraMemory Cost()1981 void SourceBuffer::reportExtraMemoryAllocated() 1982 1982 { 1983 1983 size_t extraMemoryCost = this->extraMemoryCost(); … … 1989 1989 1990 1990 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 } 1993 1996 } 1994 1997 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/Modules/mediasource/SourceBuffer.h
r179762 r181533 190 190 191 191 size_t extraMemoryCost() const; 192 void reportExtraMemory Cost();192 void reportExtraMemoryAllocated(); 193 193 194 194 std::unique_ptr<PlatformTimeRanges> bufferedAccountingForEndOfStream() const; -
releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/js/JSDocumentCustom.cpp
r179353 r181533 110 110 nodeCount++; 111 111 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)); 113 115 } 114 116 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/js/JSImageDataCustom.cpp
r170167 r181533 48 48 Identifier dataName(exec, "data"); 49 49 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()); 51 53 52 54 return wrapper; -
releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/js/JSNodeListCustom.cpp
r166520 r181533 63 63 JSC::JSValue createWrapper(JSDOMGlobalObject& globalObject, NodeList& nodeList) 64 64 { 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()); 66 68 return createNewWrapper<JSNodeList>(&globalObject, &nodeList); 67 69 } -
releases/WebKitGTK/webkit-2.8/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r180860 r181533 2858 2858 push(@implContent, " thisObject->visitAdditionalChildren(visitor);\n") if $interface->extendedAttributes->{"JSCustomMarkFunction"}; 2859 2859 if ($interface->extendedAttributes->{"ReportExtraMemoryCost"}) { 2860 push(@implContent, " visitor.reportExtraMemory Usage(cell, thisObject->impl().memoryCost());\n");2860 push(@implContent, " visitor.reportExtraMemoryVisited(cell, thisObject->impl().memoryCost());\n"); 2861 2861 } 2862 2862 if ($numCachedAttributes > 0) { … … 3073 3073 END 3074 3074 push(@implContent, <<END) if $interface->extendedAttributes->{"ReportExtraMemoryCost"}; 3075 globalObject->vm().heap.reportExtraMemory Cost(impl->memoryCost());3075 globalObject->vm().heap.reportExtraMemoryAllocated(impl->memoryCost()); 3076 3076 END 3077 3077 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/dom/CollectionIndexCache.cpp
r164968 r181533 31 31 namespace WebCore { 32 32 33 void reportExtraMemory CostForCollectionIndexCache(size_t cost)33 void reportExtraMemoryAllocatedForCollectionIndexCache(size_t cost) 34 34 { 35 35 JSC::VM& vm = JSDOMWindowBase::commonVM(); 36 36 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); 38 40 } 39 41 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/dom/CollectionIndexCache.h
r166460 r181533 31 31 namespace WebCore { 32 32 33 void reportExtraMemory CostForCollectionIndexCache(size_t);33 void reportExtraMemoryAllocatedForCollectionIndexCache(size_t); 34 34 35 35 template <class Collection, class Iterator> … … 101 101 102 102 if (unsigned capacityDifference = m_cachedList.capacity() - oldCapacity) 103 reportExtraMemory CostForCollectionIndexCache(capacityDifference * sizeof(NodeType*));103 reportExtraMemoryAllocatedForCollectionIndexCache(capacityDifference * sizeof(NodeType*)); 104 104 105 105 return m_cachedList.size(); -
releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLCanvasElement.cpp
r180760 r181533 581 581 JSC::JSLockHolder lock(scriptExecutionContext()->vm()); 582 582 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); 584 586 585 587 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS) -
releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLCollection.h
r177259 r181533 161 161 #endif 162 162 if (size_t cost = memoryCost()) 163 reportExtraMemory CostForCollectionIndexCache(cost);163 reportExtraMemoryAllocatedForCollectionIndexCache(cost); 164 164 } 165 165 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLImageLoader.cpp
r179344 r181533 88 88 JSC::VM& vm = JSDOMWindowBase::commonVM(); 89 89 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()); 91 93 } 92 94 } -
releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.cpp
r179784 r181533 693 693 m_reportedExtraMemoryCost = extraMemoryCost; 694 694 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 } 697 700 } 698 701 } -
releases/WebKitGTK/webkit-2.8/Source/WebCore/xml/XMLHttpRequest.cpp
r180132 r181533 914 914 JSC::VM& vm = scriptExecutionContext()->vm(); 915 915 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); 917 919 918 920 unsetPendingActivity(this);
Note:
See TracChangeset
for help on using the changeset viewer.