Ignore:
Timestamp:
May 8, 2009, 3:18:34 AM (16 years ago)
Author:
[email protected]
Message:

2009-05-08 Gavin Barraclough <[email protected]>

Reviewed by Oliver "I see lots of ifdefs" Hunt.

Fix (kinda) for sampling tool breakage. The codeblock sampling tool has become
b0rked due to recent changes in native function calling. The initialization of
a ScopeNode appears to now occur before the sampling tool (or possibly the
interpreter has been brought into existence, wihich leads to crashyness).

This patch doesn't fix the problem. The crash occurs when tracking a Scope, but
we shouldn't need to track scopes when we're just sampling opcodes, not
codeblocks. Not retaining Scopes when just opcode sampling will reduce sampling
overhead reducing any instrumentation skew, which is a good thing. As a side
benefit this patch also gets the opcode sampling going again, albeit in a bit of
a lame way. Will come back later with a proper fix from codeblock sampling.

  • JavaScriptCore.exp:
  • bytecode/SamplingTool.cpp: (JSC::compareLineCountInfoSampling): (JSC::SamplingTool::dump):
  • bytecode/SamplingTool.h: (JSC::SamplingTool::SamplingTool):
  • parser/Nodes.cpp: (JSC::ScopeNode::ScopeNode):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/SamplingTool.h

    r43392 r43395  
    192192            , m_sampleCount(0)
    193193            , m_opcodeSampleCount(0)
     194#if ENABLE(CODEBLOCK_SAMPLING)
    194195            , m_scopeSampleMap(new ScopeSampleRecordMap())
     196#endif
    195197        {
    196198            memset(m_opcodeSamples, 0, sizeof(m_opcodeSamples));
     
    198200        }
    199201
     202#if ENABLE(CODEBLOCK_SAMPLING)
    200203        ~SamplingTool()
    201204        {
    202205            deleteAllValues(*m_scopeSampleMap);
    203206        }
     207
     208        void notifyOfScope(ScopeNode* scope);
     209#endif
    204210
    205211        void setup();
    206212        void dump(ExecState*);
    207 
    208         void notifyOfScope(ScopeNode* scope);
    209213
    210214        void sample(CodeBlock* codeBlock, Instruction* vPC)
     
    261265        unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs];
    262266       
     267#if ENABLE(CODEBLOCK_SAMPLING)
    263268        Mutex m_scopeSampleMapMutex;
    264269        OwnPtr<ScopeSampleRecordMap> m_scopeSampleMap;
     270#endif
    265271    };
    266272
Note: See TracChangeset for help on using the changeset viewer.