Ignore:
Timestamp:
Mar 13, 2011, 9:56:46 PM (14 years ago)
Author:
[email protected]
Message:

A few Heap-related renames (sans file moves, which should come next)
https://bugs.webkit.org/show_bug.cgi?id=56283

Reviewed by Sam Weinig.

ConservativeSet => ConservativeRoots. "Set" was misleading, since items
are not uniqued. Also, "Roots" is more specific about what's in the set.

MachineStackMarker => MachineThreads. "Threads" is more descriptive of
the fact that this class maintains a set of all threads using JSC.
"Stack" was misleading, since this class traverses stacks and registers.
"Mark" was misleading, since this class doesn't mark anything anymore.

registerThread => addCurrentThread. "Current" is more specific.
unregisterThread => removeCurrentThread. "Current" is more specific.

"currentThreadRegistrar" => threadSpecific. The only point of this data
structure is to register a thread-specific destructor with a pointer to
this.

"mark...Conservatively" => "gather". "Mark" is not true, since these
functions don't mark anything. "Conservatively" is redundant, since they
take "ConservativeRoots" as an argument.

  • API/APIShims.h:

(JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):

(JSC::ConservativeRoots::grow):
(JSC::ConservativeRoots::add):

  • runtime/ConservativeSet.h:

(JSC::ConservativeRoots::ConservativeRoots):
(JSC::ConservativeRoots::~ConservativeRoots):
(JSC::ConservativeRoots::size):
(JSC::ConservativeRoots::roots):

  • runtime/Heap.cpp:

(JSC::Heap::Heap):
(JSC::Heap::markRoots):

  • runtime/Heap.h:

(JSC::Heap::machineThreads):

  • runtime/JSGlobalData.h:

(JSC::JSGlobalData::makeUsableFromMultipleThreads):

  • runtime/MachineStackMarker.cpp:

(JSC::MachineThreads::MachineThreads):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::makeUsableFromMultipleThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::removeThread):
(JSC::MachineThreads::removeCurrentThread):
(JSC::MachineThreads::gatherFromCurrentThreadInternal):
(JSC::MachineThreads::gatherFromCurrentThread):
(JSC::MachineThreads::gatherFromOtherThread):
(JSC::MachineThreads::gatherConservativeRoots):

  • runtime/MachineStackMarker.h:
  • runtime/MarkStack.h:

(JSC::MarkStack::append):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ConservativeSet.cpp

    r80985 r80995  
    3636}
    3737
    38 void ConservativeSet::grow()
     38void ConservativeRoots::grow()
    3939{
    4040    size_t newCapacity = m_capacity == inlineCapacity ? nonInlineCapacity : m_capacity * 2;
    41     JSCell** newSet = static_cast<JSCell**>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*)));
    42     memcpy(newSet, m_set, m_size * sizeof(JSCell*));
    43     if (m_set != m_inlineSet)
    44         OSAllocator::decommitAndRelease(m_set, m_capacity * sizeof(JSCell*));
     41    JSCell** newRoots = static_cast<JSCell**>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*)));
     42    memcpy(newRoots, m_roots, m_size * sizeof(JSCell*));
     43    if (m_roots != m_inlineRoots)
     44        OSAllocator::decommitAndRelease(m_roots, m_capacity * sizeof(JSCell*));
    4545    m_capacity = newCapacity;
    46     m_set = newSet;
     46    m_roots = newRoots;
    4747}
    4848
    49 void ConservativeSet::add(void* begin, void* end)
     49void ConservativeRoots::add(void* begin, void* end)
    5050{
    5151    ASSERT(begin <= end);
     
    6161            grow();
    6262
    63         m_set[m_size++] = reinterpret_cast<JSCell*>(*it);
     63        m_roots[m_size++] = reinterpret_cast<JSCell*>(*it);
    6464    }
    6565}
Note: See TracChangeset for help on using the changeset viewer.