Ignore:
Timestamp:
Jan 22, 2011, 9:03:16 PM (14 years ago)
Author:
[email protected]
Message:

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

Reviewed by Dan Bernstein.

ASSERT running run-webkit-tests --threaded.
https://bugs.webkit.org/show_bug.cgi?id=52971


SunSpider and v8 report no change.

  • runtime/ConservativeSet.cpp: (JSC::ConservativeSet::grow): (JSC::ConservativeSet::add):
  • runtime/ConservativeSet.h: Tweaked the inline capacity to 128, and the growth policy to 2X, to make SunSpider and v8 happy. (JSC::ConservativeSet::ConservativeSet): (JSC::ConservativeSet::~ConservativeSet): (JSC::ConservativeSet::mark): Use OSAllocator directly, instead of malloc. Malloc is forbidden during a multi-threaded mark phase because it can cause deadlock.

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

Reviewed by Dan Bernstein.

Beefed up --threaded mode to catch even more kinds of errors.
https://bugs.webkit.org/show_bug.cgi?id=52971

  • DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp: Use a shared context group to force JSC to mark multiple threads. (This used to be the default, but it changed in SnowLeopard.) (runJavaScriptThread): Do more locking and unlocking, and more allocation, to give threading mistakes more chances to show themselves. (startJavaScriptThreads): (stopJavaScriptThreads):
File:
1 edited

Legend:

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

    r76454 r76457  
    3838public:
    3939    ConservativeSet(Heap*);
     40    ~ConservativeSet();
    4041
    4142    void add(void* begin, void* end);
     
    4344
    4445private:
     46    static const size_t inlineCapacity = 128;
     47    static const size_t nonInlineCapacity = 8192 / sizeof(JSCell*);
     48   
     49    void grow();
     50
    4551    Heap* m_heap;
    46     Vector<JSCell*, 64> m_vector;
     52    JSCell** m_set;
     53    size_t m_size;
     54    size_t m_capacity;
     55    JSCell* m_inlineSet[inlineCapacity];
    4756};
    4857
    4958inline ConservativeSet::ConservativeSet(Heap* heap)
    5059    : m_heap(heap)
     60    , m_set(m_inlineSet)
     61    , m_size(0)
     62    , m_capacity(inlineCapacity)
    5163{
     64}
     65
     66inline ConservativeSet::~ConservativeSet()
     67{
     68    if (m_set != m_inlineSet)
     69        OSAllocator::decommitAndRelease(m_set, m_capacity * sizeof(JSCell*));
    5270}
    5371
    5472inline void ConservativeSet::mark(MarkStack& markStack)
    5573{
    56     for (size_t i = 0; i < m_vector.size(); ++i)
    57         markStack.append(m_vector[i]);
     74    for (size_t i = 0; i < m_size; ++i)
     75        markStack.append(m_set[i]);
    5876}
    5977
Note: See TracChangeset for help on using the changeset viewer.