Ignore:
Timestamp:
Jan 12, 2007, 1:11:22 PM (18 years ago)
Author:
ggaren
Message:

RS by Brady Eidson.


Rolling back in r18786 with leaks fixed, and these renames slightly reworked:

Because they can return 0:
rootObjectForImp => findRootObject (overloaded for JSObject* and Interpreter*)
rootObjectForInterpreter => findRootObject (ditto)
findReferenceSet => findProtectCountSet

File:
1 edited

Legend:

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

    r18795 r18811  
    418418}
    419419
    420 typedef HashCountedSet<JSCell *> ProtectCounts;
    421 
    422 static ProtectCounts& protectedValues()
    423 {
    424     static ProtectCounts pv;
    425     return pv;
     420typedef HashCountedSet<JSCell*> ProtectCountSet;
     421
     422static ProtectCountSet& protectedValues()
     423{
     424    static ProtectCountSet staticProtectCountSet;
     425    return staticProtectCountSet;
    426426}
    427427
     
    450450void Collector::markProtectedObjects()
    451451{
    452   ProtectCounts& pv = protectedValues();
    453   ProtectCounts::iterator end = pv.end();
    454   for (ProtectCounts::iterator it = pv.begin(); it != end; ++it) {
     452  ProtectCountSet& protectedValues = KJS::protectedValues();
     453  ProtectCountSet::iterator end = protectedValues.end();
     454  for (ProtectCountSet::iterator it = protectedValues.begin(); it != end; ++it) {
    455455    JSCell *val = it->first;
    456456    if (!val->marked())
     
    670670    HashCountedSet<const char*>* counts = new HashCountedSet<const char*>;
    671671
    672     ProtectCounts& pv = protectedValues();
    673     ProtectCounts::iterator end = pv.end();
    674     for (ProtectCounts::iterator it = pv.begin(); it != end; ++it)
     672    ProtectCountSet& protectedValues = KJS::protectedValues();
     673    ProtectCountSet::iterator end = protectedValues.end();
     674    for (ProtectCountSet::iterator it = protectedValues.begin(); it != end; ++it)
    675675        counts->add(typeName(it->first));
    676676
Note: See TracChangeset for help on using the changeset viewer.