Changeset 99374 in webkit for trunk/Source/JavaScriptCore/jsc.cpp


Ignore:
Timestamp:
Nov 6, 2011, 3:39:12 AM (14 years ago)
Author:
[email protected]
Message:

JSC should be able to sample itself in a more flexible way than just sampling flags
https://bugs.webkit.org/show_bug.cgi?id=71522

Source/JavaScriptCore:

Reviewed by Gavin Barraclough.

Added a construct that looks like SamplingRegion samplingRegion("name").

(JSC::SamplingRegion::Locker::Locker):
(JSC::SamplingRegion::Locker::~Locker):
(JSC::SamplingRegion::sample):
(JSC::SamplingRegion::dump):
(JSC::SamplingRegion::dumpInternal):
(JSC::SamplingThread::threadStartFunc):

  • bytecode/SamplingTool.h:

(JSC::SamplingRegion::SamplingRegion):
(JSC::SamplingRegion::~SamplingRegion):
(JSC::SamplingRegion::exchangeCurrent):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::generate):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compile):

  • heap/Heap.cpp:

(JSC::Heap::markRoots):
(JSC::Heap::collect):

  • heap/VTableSpectrum.cpp:

(JSC::VTableSpectrum::countVPtr):
(JSC::VTableSpectrum::dump):

  • heap/VTableSpectrum.h:
  • jsc.cpp:

(main):
(runWithScripts):

  • parser/Parser.h:

(JSC::parse):

  • runtime/Executable.cpp:

(JSC::EvalExecutable::compileInternal):
(JSC::ProgramExecutable::compileInternal):
(JSC::FunctionExecutable::compileForCallInternal):
(JSC::FunctionExecutable::compileForConstructInternal):

  • wtf/Atomics.h:

(WTF::weakCompareAndSwap):

  • wtf/Platform.h:
  • wtf/Spectrum.h: Added.

(WTF::Spectrum::Spectrum):
(WTF::Spectrum::add):
(WTF::Spectrum::get):
(WTF::Spectrum::begin):
(WTF::Spectrum::end):
(WTF::Spectrum::KeyAndCount::KeyAndCount):
(WTF::Spectrum::KeyAndCount::operator<):
(WTF::Spectrum::buildList):

  • wtf/wtf.pri:

Source/JavaScriptGlue:

Reviewed by Gavin Barraclough.

  • ForwardingHeaders/wtf/Spectrum.h: Added.

Source/WebCore:

Reviewed by Gavin Barraclough.

No new tests, since no functionality changed.

  • ForwardingHeaders/wtf/Spectrum.h: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r99223 r99374  
    3232#include "JSLock.h"
    3333#include "JSString.h"
     34#include "MainThread.h"
    3435#include "SamplingTool.h"
    3536#include <math.h>
     
    405406
    406407    // Initialize JSC before getting JSGlobalData.
     408    WTF::initializeMainThread();
    407409    JSC::initializeThreading();
    408410
     
    472474#if ENABLE(SAMPLING_FLAGS)
    473475    SamplingFlags::stop();
     476#endif
     477#if ENABLE(SAMPLING_REGIONS)
     478    SamplingRegion::dump();
    474479#endif
    475480    globalData.dumpSampleData(globalObject->globalExec());
Note: See TracChangeset for help on using the changeset viewer.