Changeset 43105 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Apr 30, 2009, 4:55:11 PM (16 years ago)
Author:
[email protected]
Message:

2009-04-30 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

OPCODE_SAMPLING without CODEBLOCK_SAMPLING is currently broken,
since SamplingTool::Sample::isNull() checks the m_codeBlock
member (which is always null without CODEBLOCK_SAMPLING).

Restructure the checks so make this work again.

  • bytecode/SamplingTool.cpp: (JSC::SamplingTool::doRun):
  • bytecode/SamplingTool.h: (JSC::SamplingTool::Sample::isNull):
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r43104 r43105  
     12009-04-30  Gavin Barraclough  <[email protected]>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        OPCODE_SAMPLING without CODEBLOCK_SAMPLING is currently broken,
     6        since SamplingTool::Sample::isNull() checks the m_codeBlock
     7        member (which is always null without CODEBLOCK_SAMPLING).
     8
     9        Restructure the checks so make this work again.
     10
     11        * bytecode/SamplingTool.cpp:
     12        (JSC::SamplingTool::doRun):
     13        * bytecode/SamplingTool.h:
     14        (JSC::SamplingTool::Sample::isNull):
     15
    1162009-04-30  Maciej Stachowiak  <[email protected]>
    217
  • trunk/JavaScriptCore/bytecode/SamplingTool.cpp

    r43087 r43105  
    196196
    197197#if ENABLE(CODEBLOCK_SAMPLING)
    198     MutexLocker locker(m_scopeSampleMapMutex);
    199     ScopeSampleRecord* record = m_scopeSampleMap->get(sample.codeBlock()->ownerNode());
    200     ASSERT(record);
    201     record->sample(sample.codeBlock(), sample.vPC());
     198    if (CodeBlock* codeBlock = sample.codeBlock()) {
     199        MutexLocker locker(m_scopeSampleMapMutex);
     200        ScopeSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerNode());
     201        ASSERT(record);
     202        record->sample(codeBlock, sample.vPC());
     203    }
    202204#endif
    203205}
  • trunk/JavaScriptCore/bytecode/SamplingTool.h

    r43087 r43105  
    235235            }
    236236           
    237             bool isNull() { return !m_sample || !m_codeBlock; }
     237            bool isNull() { return !m_sample; }
    238238            CodeBlock* codeBlock() { return m_codeBlock; }
    239239            Instruction* vPC() { return reinterpret_cast<Instruction*>(m_sample & ~0x3); }
Note: See TracChangeset for help on using the changeset viewer.