Ignore:
Timestamp:
Feb 4, 2006, 3:29:43 PM (19 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed by Hyatt.



  • kjs/collector.cpp: (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects (KJS::typeName): (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses, use HashSet
  • kjs/collector.h: (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
  • kjs/nodes.cpp:

WebCore:

Reviewed by Hyatt.

  • kwq/WebCoreJavaScript.h:
  • kwq/WebCoreJavaScript.mm: (+[WebCoreJavaScript protectedObjectCount]): Renamed from referencedObjectCounts (+[WebCoreJavaScript rootObjectTypeCounts]): Renamed from rootObjectClasses, changed from NSSet to NSCountedSet.

WebKit:

Reviewed by Hyatt.

  • Misc.subproj/WebCoreStatistics.h:
  • Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics javaScriptProtectedObjectsCount]): new (+[WebCoreStatistics javaScriptRootObjecTypeCounts]): new (+[WebCoreStatistics javaScriptRootObjectClasses]): deprecated (+[WebCoreStatistics javaScriptReferencedObjectsCount]): deprecated (+[WebCoreStatistics javaScriptNoGCAllowedObjectsCount]): Just return 0. Deprecated.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/collector.cpp

    r12329 r12559  
    1 // -*- c-basic-offset: 2 -*-
     1// -*- mode: c++; c-basic-offset: 4 -*-
    22/*
    33 *  This file is part of the KDE libraries
     
    3535#if __APPLE__
    3636
    37 #include <CoreFoundation/CoreFoundation.h>
    3837#include <pthread.h>
    3938#include <mach/mach_port.h>
     
    597596}
    598597
    599 size_t Collector::numGCNotAllowedObjects()
    600 {
    601   return 0;
    602 }
    603 
    604 size_t Collector::numReferencedObjects()
     598size_t Collector::numProtectedObjects()
    605599{
    606600  return protectedValues().size();
    607601}
    608602
    609 #if __APPLE__
    610 
    611 static const char *className(JSCell *val)
     603static const char *typeName(JSCell *val)
    612604{
    613605  const char *name = "???";
     
    642634}
    643635
    644 const void *Collector::rootObjectClasses()
    645 {
    646   // FIXME: this should be a HashSet (or maybe even CountedHashSet)
    647   CFMutableSetRef classes = CFSetCreateMutable(NULL, 0, &kCFTypeSetCallBacks);
    648 
    649   ProtectCounts& pv = protectedValues();
    650   ProtectCounts::iterator end = pv.end();
    651   for (ProtectCounts::iterator it = pv.begin(); it != end; ++it) {
    652     JSCell *val = it->first;
    653     CFStringRef name = CFStringCreateWithCString(NULL, className(val), kCFStringEncodingASCII);
    654     CFSetAddValue(classes, name);
    655     CFRelease(name);
    656   }
    657 
    658   return classes;
    659 }
    660 
    661 #endif
     636HashCountedSet<const char*>* Collector::rootObjectTypeCounts()
     637{
     638    HashCountedSet<const char*>* counts = new HashCountedSet<const char*>;
     639
     640    ProtectCounts& pv = protectedValues();
     641    ProtectCounts::iterator end = pv.end();
     642    for (ProtectCounts::iterator it = pv.begin(); it != end; ++it)
     643        counts->add(typeName(it->first));
     644
     645    return counts;
     646}
    662647
    663648} // namespace KJS
Note: See TracChangeset for help on using the changeset viewer.