[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
ggaren at apple.com
ggaren at apple.com
Mon Feb 21 00:20:49 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 07050262bcd94082d7db94a6645029808326d61c
Author: ggaren at apple.com <ggaren at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Jan 30 03:32:52 2011 +0000
2011-01-28 Geoffrey Garen <ggaren at apple.com>
Reviewed by Maciej Stachowiak.
Some more Heap cleanup.
https://bugs.webkit.org/show_bug.cgi?id=53357
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Updated exported symbols.
* runtime/Heap.cpp:
(JSC::Heap::reportExtraMemoryCostSlowCase): Renamed recordExtraCost to
reportExtraMemoryCostSlowCase to match our naming conventions.
(JSC::Heap::capacity): Renamed size to capacity because this function
returns the capacity of the heap, including unused portions.
* runtime/Heap.h:
(JSC::Heap::globalData):
(JSC::Heap::markedSpace):
(JSC::Heap::machineStackMarker):
(JSC::Heap::reportExtraMemoryCost): Moved statics to the top of the file.
Moved ctor and dtor to the beginning of the class definition. Grouped
functions by purpose.
* runtime/MarkedSpace.cpp:
(JSC::MarkedSpace::capacity): Renamed size to capacity because this
function returns the capacity of the heap, including unused portions.
* runtime/MarkedSpace.h: Removed statistics and the Statistics class because
the same information can be gotten just by calling size() and capacity().
* runtime/MemoryStatistics.cpp:
* runtime/MemoryStatistics.h: Ditto.
2011-01-28 Geoffrey Garen <ggaren at apple.com>
Reviewed by Maciej Stachowiak.
Some more Heap cleanup.
https://bugs.webkit.org/show_bug.cgi?id=53357
Updated for JavaScriptCore changes.
* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics memoryStatistics]):
2011-01-28 Geoffrey Garen <ggaren at apple.com>
Reviewed by Maciej Stachowiak.
Some more Heap cleanup.
https://bugs.webkit.org/show_bug.cgi?id=53357
Updated for JavaScriptCore changes.
* bindings/js/ScriptGCEvent.cpp:
(WebCore::ScriptGCEvent::getHeapSize):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 159ba4b..16bd377 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,38 @@
+2011-01-28 Geoffrey Garen <ggaren at apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Some more Heap cleanup.
+ https://bugs.webkit.org/show_bug.cgi?id=53357
+
+ * JavaScriptCore.exp:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Updated exported symbols.
+
+ * runtime/Heap.cpp:
+ (JSC::Heap::reportExtraMemoryCostSlowCase): Renamed recordExtraCost to
+ reportExtraMemoryCostSlowCase to match our naming conventions.
+
+ (JSC::Heap::capacity): Renamed size to capacity because this function
+ returns the capacity of the heap, including unused portions.
+
+ * runtime/Heap.h:
+ (JSC::Heap::globalData):
+ (JSC::Heap::markedSpace):
+ (JSC::Heap::machineStackMarker):
+ (JSC::Heap::reportExtraMemoryCost): Moved statics to the top of the file.
+ Moved ctor and dtor to the beginning of the class definition. Grouped
+ functions by purpose.
+
+ * runtime/MarkedSpace.cpp:
+ (JSC::MarkedSpace::capacity): Renamed size to capacity because this
+ function returns the capacity of the heap, including unused portions.
+
+ * runtime/MarkedSpace.h: Removed statistics and the Statistics class because
+ the same information can be gotten just by calling size() and capacity().
+
+ * runtime/MemoryStatistics.cpp:
+ * runtime/MemoryStatistics.h: Ditto.
+
2011-01-29 Daniel Bates <dbates at rim.com>
Reviewed by Eric Seidel.
diff --git a/Source/JavaScriptCore/JavaScriptCore.exp b/Source/JavaScriptCore/JavaScriptCore.exp
index 199c37f..9547443 100644
--- a/Source/JavaScriptCore/JavaScriptCore.exp
+++ b/Source/JavaScriptCore/JavaScriptCore.exp
@@ -166,7 +166,6 @@ __ZN3JSC14SamplingThread4stopEv
__ZN3JSC14SamplingThread5startEj
__ZN3JSC14TimeoutChecker10didTimeOutEPNS_9ExecStateE
__ZN3JSC14TimeoutChecker5resetEv
-__ZN3JSC14heapStatisticsEPNS_12JSGlobalDataE
__ZN3JSC14throwTypeErrorEPNS_9ExecStateE
__ZN3JSC15JSWrapperObject12markChildrenERNS_9MarkStackE
__ZN3JSC15createTypeErrorEPNS_9ExecStateERKNS_7UStringE
@@ -210,7 +209,6 @@ __ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
__ZN3JSC3NaNE
__ZN3JSC4Heap14primaryHeapEndEv
__ZN3JSC4Heap15addWeakGCHandleEPNS_6JSCellE
-__ZN3JSC4Heap15recordExtraCostEm
__ZN3JSC4Heap16objectTypeCountsEv
__ZN3JSC4Heap16primaryHeapBeginEv
__ZN3JSC4Heap17collectAllGarbageEv
@@ -219,6 +217,7 @@ __ZN3JSC4Heap19setActivityCallbackEN3WTF10PassOwnPtrINS_18GCActivityCallbackEEE
__ZN3JSC4Heap20protectedObjectCountEv
__ZN3JSC4Heap25protectedObjectTypeCountsEv
__ZN3JSC4Heap26protectedGlobalObjectCountEv
+__ZN3JSC4Heap29reportExtraMemoryCostSlowCaseEm
__ZN3JSC4Heap6isBusyEv
__ZN3JSC4Heap7destroyEv
__ZN3JSC4Heap7protectENS_7JSValueE
@@ -519,9 +518,9 @@ __ZNK3JSC18PropertyDescriptor6setterEv
__ZNK3JSC18PropertyDescriptor8writableEv
__ZNK3JSC19SourceProviderCache8byteSizeEv
__ZNK3JSC24JSObjectWithGlobalObject12globalObjectEv
-__ZNK3JSC4Heap10statisticsEv
__ZNK3JSC4Heap11objectCountEv
__ZNK3JSC4Heap4sizeEv
+__ZNK3JSC4Heap8capacityEv
__ZNK3JSC6JSCell11toPrimitiveEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
__ZNK3JSC6JSCell12toThisObjectEPNS_9ExecStateE
__ZNK3JSC6JSCell14isGetterSetterEv
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index f8786b5..0d7e514 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -70,6 +70,7 @@ EXPORTS
?callOnMainThread at WTF@@YAXP6AXPAX at Z0@Z
?callOnMainThreadAndWait at WTF@@YAXP6AXPAX at Z0@Z
?cancelCallOnMainThread at WTF@@YAXP6AXPAX at Z0@Z
+ ?capacity at Heap@JSC@@QBEIXZ
?changePrototypeTransition at Structure@JSC@@SA?AV?$PassRefPtr at VStructure@JSC@@@WTF@@PAV12 at VJSValue@2@@Z
?checkCurrentIdentifierTable at Identifier@JSC@@CAXPAVExecState at 2@@Z
?checkCurrentIdentifierTable at Identifier@JSC@@CAXPAVJSGlobalData at 2@@Z
@@ -267,10 +268,10 @@ EXPORTS
?putWithAttributes at JSObject@JSC@@UAEXPAVJSGlobalData at 2@IVJSValue at 2@I at Z
?randomNumber at WTF@@YANXZ
?recompileAllJSFunctions at Debugger@JSC@@QAEXPAVJSGlobalData at 2@@Z
- ?recordExtraCost at Heap@JSC@@AAEXI at Z
?reifyString at StringBuilder@WTF@@AAEXXZ
?releaseDecommitted at OSAllocator@WTF@@SAXPAXI at Z
?releaseStack at MarkStack@JSC@@CAXPAXI at Z
+ ?reportExtraMemoryCostSlowCase at Heap@JSC@@AAEXI at Z
?reserveAndCommit at OSAllocator@WTF@@SAPAXIW4Usage at 12@_N1 at Z
?reset at ParserArena@JSC@@QAEXXZ
?reset at TimeoutChecker@JSC@@QAEXXZ
diff --git a/Source/JavaScriptCore/runtime/Heap.cpp b/Source/JavaScriptCore/runtime/Heap.cpp
index 9ec3799..7af0d3d 100644
--- a/Source/JavaScriptCore/runtime/Heap.cpp
+++ b/Source/JavaScriptCore/runtime/Heap.cpp
@@ -79,7 +79,7 @@ void Heap::destroy()
m_globalData = 0;
}
-void Heap::recordExtraCost(size_t cost)
+void Heap::reportExtraMemoryCostSlowCase(size_t cost)
{
// Our frequency of garbage collection tries to balance memory use against speed
// by collecting based on the number of newly created values. However, for values
@@ -92,7 +92,7 @@ void Heap::recordExtraCost(size_t cost)
// if a large value survives one garbage collection, there is not much point to
// collecting more frequently as long as it stays alive.
- if (m_extraCost > maxExtraCost && m_extraCost > m_markedSpace.size() / 2) {
+ if (m_extraCost > maxExtraCost && m_extraCost > m_markedSpace.capacity() / 2) {
JAVASCRIPTCORE_GC_BEGIN();
markRoots();
@@ -302,14 +302,14 @@ size_t Heap::objectCount() const
return m_markedSpace.objectCount();
}
-MarkedSpace::Statistics Heap::statistics() const
+size_t Heap::size() const
{
- return m_markedSpace.statistics();
+ return m_markedSpace.size();
}
-size_t Heap::size() const
+size_t Heap::capacity() const
{
- return m_markedSpace.size();
+ return m_markedSpace.capacity();
}
size_t Heap::globalObjectCount()
diff --git a/Source/JavaScriptCore/runtime/Heap.h b/Source/JavaScriptCore/runtime/Heap.h
index db05d81..bf8c317 100644
--- a/Source/JavaScriptCore/runtime/Heap.h
+++ b/Source/JavaScriptCore/runtime/Heap.h
@@ -50,45 +50,44 @@ namespace JSC {
class Heap {
WTF_MAKE_NONCOPYABLE(Heap);
public:
- void destroy();
+ static Heap* heap(JSValue); // 0 for immediate values
+ static Heap* heap(JSCell*);
- void* allocate(size_t);
+ static bool isCellMarked(const JSCell*);
+ static bool checkMarkCell(const JSCell*);
+ static void markCell(JSCell*);
+
+ Heap(JSGlobalData*);
+ ~Heap();
+ void destroy(); // JSGlobalData must call destroy() before ~Heap().
- bool isBusy(); // true if an allocation or collection is in progress
- void collectAllGarbage();
+ JSGlobalData* globalData() const { return m_globalData; }
+ MarkedSpace& markedSpace() { return m_markedSpace; }
+ MachineStackMarker& machineStackMarker() { return m_machineStackMarker; }
GCActivityCallback* activityCallback();
void setActivityCallback(PassOwnPtr<GCActivityCallback>);
- static const size_t minExtraCost = 256;
- static const size_t maxExtraCost = 1024 * 1024;
+ bool isBusy(); // true if an allocation or collection is in progress
+ void* allocate(size_t);
+ void collectAllGarbage();
void reportExtraMemoryCost(size_t cost);
- size_t objectCount() const;
- MarkedSpace::Statistics statistics() const;
- size_t size() const;
-
void protect(JSValue);
- // Returns true if the value is no longer protected by any protect pointers
- // (though it may still be alive due to heap/stack references).
- bool unprotect(JSValue);
+ bool unprotect(JSValue); // True when the protect count drops to 0.
- static Heap* heap(JSValue); // 0 for immediate values
- static Heap* heap(JSCell*);
+ bool contains(void*);
+ size_t size() const;
+ size_t capacity() const;
+ size_t objectCount() const;
size_t globalObjectCount();
size_t protectedObjectCount();
size_t protectedGlobalObjectCount();
HashCountedSet<const char*>* protectedObjectTypeCounts();
HashCountedSet<const char*>* objectTypeCounts();
- static bool isCellMarked(const JSCell*);
- static bool checkMarkCell(const JSCell*);
- static void markCell(JSCell*);
-
- bool contains(void*);
-
WeakGCHandle* addWeakGCHandle(JSCell*);
void pushTempSortVector(WTF::Vector<ValueStringPair>*);
@@ -96,21 +95,16 @@ namespace JSC {
HashSet<MarkedArgumentBuffer*>& markListSet() { if (!m_markListSet) m_markListSet = new HashSet<MarkedArgumentBuffer*>; return *m_markListSet; }
- JSGlobalData* globalData() const { return m_globalData; }
-
LiveObjectIterator primaryHeapBegin();
LiveObjectIterator primaryHeapEnd();
- MachineStackMarker& machineStackMarker() { return m_machineStackMarker; }
-
- MarkedSpace& markedSpace() { return m_markedSpace; }
-
private:
friend class JSGlobalData;
- Heap(JSGlobalData*);
- ~Heap();
- void recordExtraCost(size_t);
+ static const size_t minExtraCost = 256;
+ static const size_t maxExtraCost = 1024 * 1024;
+
+ void reportExtraMemoryCostSlowCase(size_t);
void markRoots();
void markProtectedObjects(MarkStack&);
@@ -163,7 +157,7 @@ namespace JSC {
inline void Heap::reportExtraMemoryCost(size_t cost)
{
if (cost > minExtraCost)
- recordExtraCost(cost);
+ reportExtraMemoryCostSlowCase(cost);
}
inline WeakGCHandlePool* Heap::weakGCHandlePool(size_t index)
diff --git a/Source/JavaScriptCore/runtime/MarkedSpace.cpp b/Source/JavaScriptCore/runtime/MarkedSpace.cpp
index c020617..aeb520f 100644
--- a/Source/JavaScriptCore/runtime/MarkedSpace.cpp
+++ b/Source/JavaScriptCore/runtime/MarkedSpace.cpp
@@ -295,20 +295,12 @@ size_t MarkedSpace::objectCount() const
- m_heap.usedBlocks; // 1 cell per block is a dummy sentinel
}
-void MarkedSpace::addToStatistics(Statistics& statistics) const
-{
- statistics.size += m_heap.usedBlocks * BLOCK_SIZE;
- statistics.free += m_heap.usedBlocks * BLOCK_SIZE - (objectCount() * HeapConstants::cellSize);
-}
-
-MarkedSpace::Statistics MarkedSpace::statistics() const
+size_t MarkedSpace::size() const
{
- Statistics statistics = { 0, 0 };
- addToStatistics(statistics);
- return statistics;
+ return objectCount() * HeapConstants::cellSize;
}
-size_t MarkedSpace::size() const
+size_t MarkedSpace::capacity() const
{
return m_heap.usedBlocks * BLOCK_SIZE;
}
diff --git a/Source/JavaScriptCore/runtime/MarkedSpace.h b/Source/JavaScriptCore/runtime/MarkedSpace.h
index 566ac5f..3b23d8c 100644
--- a/Source/JavaScriptCore/runtime/MarkedSpace.h
+++ b/Source/JavaScriptCore/runtime/MarkedSpace.h
@@ -64,11 +64,6 @@ namespace JSC {
class MarkedSpace {
WTF_MAKE_NONCOPYABLE(MarkedSpace);
public:
- struct Statistics {
- size_t size;
- size_t free;
- };
-
static Heap* heap(JSCell*);
static bool isCellMarked(const JSCell*);
@@ -88,8 +83,8 @@ namespace JSC {
void sweep();
size_t size() const;
+ size_t capacity() const;
size_t objectCount() const;
- Statistics statistics() const;
bool contains(void*);
@@ -113,8 +108,6 @@ namespace JSC {
void clearMarkBits(CollectorBlock*);
size_t markedCells(size_t startBlock = 0, size_t startCell = 0) const;
- void addToStatistics(Statistics&) const;
-
CollectorHeap m_heap;
JSGlobalData* m_globalData;
};
diff --git a/Source/JavaScriptCore/runtime/MemoryStatistics.cpp b/Source/JavaScriptCore/runtime/MemoryStatistics.cpp
index 06a319b..86101f5 100644
--- a/Source/JavaScriptCore/runtime/MemoryStatistics.cpp
+++ b/Source/JavaScriptCore/runtime/MemoryStatistics.cpp
@@ -32,11 +32,6 @@
namespace JSC {
-MarkedSpace::Statistics heapStatistics(JSGlobalData* commonGlobalData)
-{
- return commonGlobalData->heap.statistics();
-}
-
GlobalMemoryStatistics globalMemoryStatistics()
{
GlobalMemoryStatistics stats;
diff --git a/Source/JavaScriptCore/runtime/MemoryStatistics.h b/Source/JavaScriptCore/runtime/MemoryStatistics.h
index 2659702..d4b8b6f 100644
--- a/Source/JavaScriptCore/runtime/MemoryStatistics.h
+++ b/Source/JavaScriptCore/runtime/MemoryStatistics.h
@@ -37,7 +37,6 @@ struct GlobalMemoryStatistics {
size_t JITBytes;
};
-MarkedSpace::Statistics heapStatistics(JSGlobalData* commonGlobalData);
GlobalMemoryStatistics globalMemoryStatistics();
}
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index e7c015b..413707d 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-28 Geoffrey Garen <ggaren at apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Some more Heap cleanup.
+ https://bugs.webkit.org/show_bug.cgi?id=53357
+
+ Updated for JavaScriptCore changes.
+
+ * bindings/js/ScriptGCEvent.cpp:
+ (WebCore::ScriptGCEvent::getHeapSize):
+
2011-01-29 Adam Barth <abarth at webkit.org>
Reviewed by Daniel Bates.
diff --git a/Source/WebCore/bindings/js/ScriptGCEvent.cpp b/Source/WebCore/bindings/js/ScriptGCEvent.cpp
index b7fc7b3..21c21bd 100644
--- a/Source/WebCore/bindings/js/ScriptGCEvent.cpp
+++ b/Source/WebCore/bindings/js/ScriptGCEvent.cpp
@@ -45,9 +45,10 @@ using namespace JSC;
void ScriptGCEvent::getHeapSize(size_t& usedHeapSize, size_t& totalHeapSize)
{
JSGlobalData* globalData = JSDOMWindow::commonJSGlobalData();
- totalHeapSize = globalData->heap.size();
+ totalHeapSize = globalData->heap.capacity();
usedHeapSize = totalHeapSize;
}
+
} // namespace WebCore
#endif // !ENABLE(INSPECTOR)
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 821a8fd..f7e310e 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-28 Geoffrey Garen <ggaren at apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Some more Heap cleanup.
+ https://bugs.webkit.org/show_bug.cgi?id=53357
+
+ Updated for JavaScriptCore changes.
+
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics memoryStatistics]):
+
2011-01-28 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r77006 and r77020.
diff --git a/Source/WebKit/mac/Misc/WebCoreStatistics.mm b/Source/WebKit/mac/Misc/WebCoreStatistics.mm
index 5d96c95..a1589db 100644
--- a/Source/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/Source/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -197,15 +197,16 @@ using namespace WebCore;
WTF::FastMallocStatistics fastMallocStatistics = WTF::fastMallocStatistics();
JSLock lock(SilenceAssertionsOnly);
- MarkedSpace::Statistics heapMemoryStats = heapStatistics(JSDOMWindow::commonJSGlobalData());
+ size_t heapSize = JSDOMWindow::commonJSGlobalData()->heap.size();
+ size_t heapFree = JSDOMWindow::commonJSGlobalData()->heap.capacity() - heapSize;
GlobalMemoryStatistics globalMemoryStats = globalMemoryStatistics();
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:fastMallocStatistics.reservedVMBytes], @"FastMallocReservedVMBytes",
[NSNumber numberWithInt:fastMallocStatistics.committedVMBytes], @"FastMallocCommittedVMBytes",
[NSNumber numberWithInt:fastMallocStatistics.freeListBytes], @"FastMallocFreeListBytes",
- [NSNumber numberWithInt:heapMemoryStats.size], @"JavaScriptHeapSize",
- [NSNumber numberWithInt:heapMemoryStats.free], @"JavaScriptFreeSize",
+ [NSNumber numberWithInt:heapSize], @"JavaScriptHeapSize",
+ [NSNumber numberWithInt:heapFree], @"JavaScriptFreeSize",
[NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.stackBytes], @"JavaScriptStackSize",
[NSNumber numberWithUnsignedInt:(unsigned int)globalMemoryStats.JITBytes], @"JavaScriptJITSize",
nil];
diff --git a/Source/WebKit2/Shared/mac/WebMemorySampler.mac.mm b/Source/WebKit2/Shared/mac/WebMemorySampler.mac.mm
index ba8410e..ed12cc4 100644
--- a/Source/WebKit2/Shared/mac/WebMemorySampler.mac.mm
+++ b/Source/WebKit2/Shared/mac/WebMemorySampler.mac.mm
@@ -116,9 +116,8 @@ WebMemoryStatistics WebMemorySampler::sampleWebKit() const
totalBytesCommitted += fastMallocBytesCommitted;
JSLock lock(SilenceAssertionsOnly);
- MarkedSpace::Statistics heapMemoryStats = heapStatistics(JSDOMWindow::commonJSGlobalData());
- size_t jscHeapBytesInUse = heapMemoryStats.size - heapMemoryStats.free;
- size_t jscHeapBytesCommitted = heapMemoryStats.size;
+ size_t jscHeapBytesInUse = JSDOMWindow::commonJSGlobalData()->heap.size();
+ size_t jscHeapBytesCommitted = JSDOMWindow::commonJSGlobalData()->heap.capacity();
totalBytesInUse += jscHeapBytesInUse;
totalBytesCommitted += jscHeapBytesCommitted;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list