Changeset 37901 in webkit for trunk/JavaScriptCore


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.
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37894 r37901  
     12008-10-27  Geoffrey Garen  <[email protected]>
     2
     3        Reviewed by Sam Weinig.
     4       
     5        Added a mutex around the SamplingTool's ScopeNode* map, to solve a crash
     6        when sampling the v8 tests.
     7
     8        * VM/SamplingTool.cpp:
     9        (JSC::SamplingTool::run):
     10        (JSC::SamplingTool::notifyOfScope):
     11        * VM/SamplingTool.h: Since new ScopeNodes can be created after
     12        the SamplingTools has begun sampling, reads and writes to / from the
     13        map need to be synchronized. Shark says this doesn't measurably increase
     14        sampling overhead.
     15
    1162008-10-25  Geoffrey Garen  <[email protected]>
    217
  • 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}
  • trunk/JavaScriptCore/VM/SamplingTool.h

    r37893 r37901  
    203203        unsigned m_opcodeSamples[numOpcodeIDs];
    204204        unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs];
     205       
     206        Mutex m_scopeSampleMapMutex;
    205207        OwnPtr<ScopeSampleRecordMap> m_scopeSampleMap;
    206208    };
Note: See TracChangeset for help on using the changeset viewer.