Ignore:
Timestamp:
Oct 27, 2008, 1:37:08 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-27 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Added a mutex around the SamplingTool's ScopeNode* map, to solve a crash
when sampling the v8 tests.

  • VM/SamplingTool.cpp: (JSC::SamplingTool::run): (JSC::SamplingTool::notifyOfScope):
  • VM/SamplingTool.h: Since new ScopeNodes can be created after the SamplingTools has begun sampling, reads and writes to / from the map need to be synchronized. Shark says this doesn't measurably increase sampling overhead.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/SamplingTool.cpp

    r37891 r37901  
    103103
    104104#if ENABLE(CODEBLOCK_SAMPLING)
     105        MutexLocker locker(m_scopeSampleMapMutex);
    105106        ScopeSampleRecord* record = m_scopeSampleMap->get(sample.codeBlock()->ownerNode);
    106107        ASSERT(record);
     
    118119void SamplingTool::notifyOfScope(ScopeNode* scope)
    119120{
     121    MutexLocker locker(m_scopeSampleMapMutex);
    120122    m_scopeSampleMap->set(scope, new ScopeSampleRecord(scope));
    121123}
Note: See TracChangeset for help on using the changeset viewer.