Ignore:
Timestamp:
Feb 2, 2011, 11:21:17 AM (14 years ago)
Author:
[email protected]
Message:

2011-02-01 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

A little more Heap refactoring
https://bugs.webkit.org/show_bug.cgi?id=53577


SunSpider reports no change.


Split out MarkedBlock into its own file / class.


Did the following renames:

isCellMarked => isMarked
checkMarkCell => testAndSetMarked
markCell => setMarked
cellOffset => cellNumber
collectorBlock => blockFor

  • Android.mk:
  • CMakeLists.txt:
  • GNUmakefile.am:
  • JavaScriptCore.gypi:
  • JavaScriptCore.pro:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/Heap.cpp: (JSC::WeakGCHandlePool::update):
  • runtime/Heap.h: (JSC::Heap::isMarked): (JSC::Heap::testAndSetMarked): (JSC::Heap::setMarked):
  • runtime/JSArray.h: (JSC::MarkStack::markChildren): (JSC::MarkStack::drain):
  • runtime/JSCell.h: (JSC::JSCell::MarkStack::internalAppend):
  • runtime/MarkedBlock.cpp: Added.
  • runtime/MarkedBlock.h: Added. (JSC::MarkedBlock::blockFor): (JSC::MarkedBlock::cellNumber): (JSC::MarkedBlock::isMarked): (JSC::MarkedBlock::testAndSetMarked): (JSC::MarkedBlock::setMarked): (JSC::MarkedBlock::isCellAligned): (JSC::MarkedBlock::isPossibleCell):
  • runtime/MarkedSpace.h: (JSC::MarkedSpace::isMarked): (JSC::MarkedSpace::testAndSetMarked): (JSC::MarkedSpace::setMarked):
  • runtime/SmallStrings.cpp: (JSC::isMarked):
  • runtime/WeakGCMap.h: (JSC::WeakGCMap::isValid): (JSC::::get): (JSC::::take): (JSC::::set):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/WeakGCMap.h

    r77360 r77391  
    7979    const_iterator uncheckedEnd() const { return m_map.end(); }
    8080
    81     bool isValid(iterator it) const { return Heap::isCellMarked(it->second.get()); }
    82     bool isValid(const_iterator it) const { return Heap::isCellMarked(it->second.get()); }
     81    bool isValid(iterator it) const { return Heap::isMarked(it->second.get()); }
     82    bool isValid(const_iterator it) const { return Heap::isMarked(it->second.get()); }
    8383
    8484private:
     
    9292    if (result == HashTraits<MappedType*>::emptyValue())
    9393        return result;
    94     if (!Heap::isCellMarked(result))
     94    if (!Heap::isMarked(result))
    9595        return HashTraits<MappedType*>::emptyValue();
    9696    return result;
     
    103103    if (result == HashTraits<MappedType*>::emptyValue())
    104104        return result;
    105     if (!Heap::isCellMarked(result))
     105    if (!Heap::isMarked(result))
    106106        return HashTraits<MappedType*>::emptyValue();
    107107    return result;
     
    111111pair<typename WeakGCMap<KeyType, MappedType>::iterator, bool> WeakGCMap<KeyType, MappedType>::set(const KeyType& key, MappedType* value)
    112112{
    113     Heap::markCell(value); // If value is newly allocated, it's not marked, so mark it now.
     113    Heap::setMarked(value); // If value is newly allocated, it's not marked, so mark it now.
    114114    pair<iterator, bool> result = m_map.add(key, value);
    115115    if (!result.second) { // pre-existing entry
    116         result.second = !Heap::isCellMarked(result.first->second.get());
     116        result.second = !Heap::isMarked(result.first->second.get());
    117117        result.first->second = value;
    118118    }
Note: See TracChangeset for help on using the changeset viewer.