Commit 5777147d authored by weinig@apple.com's avatar weinig@apple.com
Browse files

2008-11-03 Sam Weinig <sam@webkit.org>

        Reviewed by Mark Rowe.

        Move #define to turn on dumping StructureID statistics to StructureID.cpp so that
        turning it on does not require a full rebuild. 

        * runtime/StructureID.cpp:
        (JSC::StructureID::dumpStatistics):
        * runtime/StructureID.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f9050b37
2008-11-03 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
Move #define to turn on dumping StructureID statistics to StructureID.cpp so that
turning it on does not require a full rebuild.
* runtime/StructureID.cpp:
(JSC::StructureID::dumpStatistics):
* runtime/StructureID.h:
2008-11-03 Alp Toker <alp@nuanti.com>
 
Reviewed by Geoffrey Garen.
......
......@@ -38,6 +38,8 @@
#include <wtf/Threading.h>
#endif
#define DUMP_STRUCTURE_ID_STATISTICS 0
#ifndef NDEBUG
#define DO_PROPERTYMAP_CONSTENCY_CHECK 0
#else
......@@ -70,9 +72,11 @@ static HashSet<StructureID*> ignoreSet;
#if DUMP_STRUCTURE_ID_STATISTICS
static HashSet<StructureID*> liveStructureIDSet;
#endif
void StructureID::dumpStatistics()
{
#if DUMP_STRUCTURE_ID_STATISTICS
unsigned numberLeaf = 0;
unsigned numberUsingSingleSlot = 0;
unsigned numberSingletons = 0;
......@@ -92,7 +96,7 @@ void StructureID::dumpStatistics()
}
if (structureID->m_propertyTable)
totalPropertyMapsSize += PropertyMapHashTable::allocationSize(m_propertyTable->size);;
totalPropertyMapsSize += PropertyMapHashTable::allocationSize(structureID->m_propertyTable->size);
}
printf("Number of live StructureIDs: %d\n", liveStructureIDSet.size());
......@@ -103,8 +107,10 @@ void StructureID::dumpStatistics()
printf("Size of a single StructureIDs: %d\n", static_cast<unsigned>(sizeof(StructureID)));
printf("Size of sum of all property maps: %d\n", totalPropertyMapsSize);
printf("Size of average of all property maps: %f\n", static_cast<double>(totalPropertyMapsSize) / static_cast<double>(liveStructureIDSet.size()));
}
#else
printf("Dumping StructureID statistics is not enabled.\n");
#endif
}
StructureID::StructureID(JSValue* prototype, const TypeInfo& typeInfo)
: m_typeInfo(typeInfo)
......
......@@ -40,8 +40,6 @@
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#define DUMP_STRUCTURE_ID_STATISTICS 0
#ifndef NDEBUG
#define DUMP_PROPERTYMAP_STATS 0
#else
......@@ -64,9 +62,7 @@ namespace JSC {
static void startIgnoringLeaks();
static void stopIgnoringLeaks();
#if DUMP_STRUCTURE_ID_STATISTICS
static void dumpStatistics();
#endif
static PassRefPtr<StructureID> changePrototypeTransition(StructureID*, JSValue* prototype);
static PassRefPtr<StructureID> addPropertyTransition(StructureID*, const Identifier& propertyName, unsigned attributes, size_t& offset);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment