2011-01-28 Geoffrey Garen <ggaren@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@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@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/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 @@
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 @@
// 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,16 +302,16 @@
return m_markedSpace.objectCount();
}
-MarkedSpace::Statistics Heap::statistics() const
-{
- return m_markedSpace.statistics();
-}
-
size_t Heap::size() const
{
return m_markedSpace.size();
}
+size_t Heap::capacity() const
+{
+ return m_markedSpace.capacity();
+}
+
size_t Heap::globalObjectCount()
{
size_t count = 0;