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):
(JSC::SamplingRegion::SamplingRegion):
(JSC::SamplingRegion::~SamplingRegion):
(JSC::SamplingRegion::exchangeCurrent):
- bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::DFG::compile):
(JSC::Heap::markRoots):
(JSC::Heap::collect):
(JSC::VTableSpectrum::countVPtr):
(JSC::VTableSpectrum::dump):
- heap/VTableSpectrum.h:
- jsc.cpp:
(main):
(runWithScripts):
(JSC::parse):
(JSC::EvalExecutable::compileInternal):
(JSC::ProgramExecutable::compileInternal):
(JSC::FunctionExecutable::compileForCallInternal):
(JSC::FunctionExecutable::compileForConstructInternal):
(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):
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.