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

    r76454 r76457  
    3434}
    3535
     36void ConservativeSet::grow()
     37{
     38    size_t newCapacity = m_capacity == inlineCapacity ? nonInlineCapacity : m_capacity * 2;
     39    JSCell** newSet = static_cast<JSCell**>(OSAllocator::reserveAndCommit(newCapacity * sizeof(JSCell*)));
     40    memcpy(newSet, m_set, m_size * sizeof(JSCell*));
     41    if (m_set != m_inlineSet)
     42        OSAllocator::decommitAndRelease(m_set, m_capacity * sizeof(JSCell*));
     43    m_capacity = newCapacity;
     44    m_set = newSet;
     45}
     46
    3647void ConservativeSet::add(void* begin, void* end)
    3748{
     
    4455        if (!m_heap->contains(*it))
    4556            continue;
    46         m_vector.append(reinterpret_cast<JSCell*>(*it));
     57
     58        if (m_size == m_capacity)
     59            grow();
     60
     61        m_set[m_size++] = reinterpret_cast<JSCell*>(*it);
    4762    }
    4863}
Note: See TracChangeset for help on using the changeset viewer.