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.h

    r80995 r81262  
    2727#define ConservativeRoots_h
    2828
     29#include "Heap.h"
    2930#include <wtf/OSAllocator.h>
    3031#include <wtf/Vector.h>
     
    4243    ~ConservativeRoots();
    4344
     45    void add(void*);
    4446    void add(void* begin, void* end);
    4547   
     
    7476}
    7577
     78inline void ConservativeRoots::add(void* p)
     79{
     80    if (!m_heap->contains(p))
     81        return;
     82
     83    if (m_size == m_capacity)
     84        grow();
     85
     86    m_roots[m_size++] = reinterpret_cast<JSCell*>(p);
     87}
     88
    7689inline size_t ConservativeRoots::size()
    7790{
Note: See TracChangeset for help on using the changeset viewer.