Ignore:
Timestamp:
Mar 16, 2011, 11:35:49 AM (14 years ago)
Author:
[email protected]
Message:

2011-03-16 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Some conservative root gathering cleanup
https://bugs.webkit.org/show_bug.cgi?id=56447


SunSpider says 0.5% - 1.8% faster.

  • interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots):
  • interpreter/RegisterFile.h: New helper function for doing the conservative gathering of the register file. It's still conservative, since the register file may contain uninitialized values, but it's moving-safe, because it only visits values tagged as pointers, so there's no risk of mistaking an integer for a pointer and accidentally changing it.
  • runtime/ConservativeSet.cpp: (JSC::ConservativeRoots::add):
  • runtime/ConservativeSet.h: Added a single-value add function, used above.
  • runtime/Heap.cpp: (JSC::Heap::markRoots): Separated machine stack conservative roots from register file conservative roots because machine stack roots must be pinned, but register file roots need not be pinned.


Adopted new interface for passing the current stack extent to the machine
stack root gathering routine. This allows us to exclude marking-related
data structures on the stack, and thus avoid double-marking the set of
machine roots.

  • runtime/MachineStackMarker.cpp: (JSC::MachineThreads::gatherFromCurrentThread): (JSC::MachineThreads::gatherConservativeRoots):
  • runtime/MachineStackMarker.h: Added new interface, described above.
  • runtime/MarkedBlock.h: (JSC::MarkedBlock::firstAtom):
  • wtf/StdLibExtras.h: (WTF::roundUpToMultipleOf): Moved roundUpToMultipleOf so it could be used by MachineStacks.
File:
1 edited

Legend:

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

    r80995 r81262  
    2727#include "ConservativeSet.h"
    2828
    29 #include "Heap.h"
    30 
    3129namespace JSC {
    3230
     
    5452    ASSERT(isPointerAligned(end));
    5553
    56     for (char** it = static_cast<char**>(begin); it != static_cast<char**>(end); ++it) {
    57         if (!m_heap->contains(*it))
    58             continue;
    59 
    60         if (m_size == m_capacity)
    61             grow();
    62 
    63         m_roots[m_size++] = reinterpret_cast<JSCell*>(*it);
    64     }
     54    for (char** it = static_cast<char**>(begin); it != static_cast<char**>(end); ++it)
     55        add(*it);
    6556}
    6657
Note: See TracChangeset for help on using the changeset viewer.