本文整理汇总了C++中ProfileGenerator类的典型用法代码示例。如果您正苦于以下问题:C++ ProfileGenerator类的具体用法?C++ ProfileGenerator怎么用?C++ ProfileGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProfileGenerator类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stopProfiling
void Profiler::stopProfiling(ExecState* exec, const UString& title)
{
ExecState* globalExec = exec->lexicalGlobalObject()->globalExec();
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (!profileGenerator->stoppedProfiling() && profileGenerator->originatingGlobalExec() == globalExec && (title.isNull() || profileGenerator->title() == title))
m_currentProfiles[i]->stopProfiling();
}
}
示例2: stopProfiling
void Profiler::stopProfiling(JSGlobalObject* origin)
{
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->origin() == origin) {
profileGenerator->stopProfiling();
m_currentProfiles.remove(i);
if (!m_currentProfiles.size())
origin->globalData().m_enabledProfiler = 0;
}
}
}
示例3: stopProfiling
void LegacyProfiler::stopProfiling(JSGlobalObject* origin)
{
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->origin() == origin) {
profileGenerator->stopProfiling();
m_currentProfiles.remove(i);
if (!m_currentProfiles.size())
origin->vm().setEnabledProfiler(nullptr);
}
}
}
示例4: stopProfiling
void Profiler::stopProfiling(JSGlobalObject* origin)
{
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->origin() == origin) {
profileGenerator->stopProfiling();
m_currentProfiles.remove(i);
if (!m_currentProfiles.size())
s_sharedEnabledProfilerReference = 0;
}
}
}
示例5: startProfiling
void Profiler::startProfiling(ExecState* exec, const UString& title)
{
// Check if we currently have a Profile for this global ExecState and title.
// If so return early and don't create a new Profile.
ExecState* globalExec = exec ? exec->lexicalGlobalObject()->globalExec() : 0;
for (size_t i = 0; i < m_currentProfiles.size(); ++i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->originatingGlobalExec() == globalExec && profileGenerator->title() == title)
return;
}
s_sharedEnabledProfilerReference = this;
RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(title, exec, ++ProfilesUID);
m_currentProfiles.append(profileGenerator);
}
示例6: didFinishAllExecution
void Profiler::didFinishAllExecution(ExecState* exec)
{
ExecState* globalExec = exec->lexicalGlobalObject()->globalExec();
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->originatingGlobalExec() == globalExec && profileGenerator->didFinishAllExecution()) {
PassRefPtr<ProfileGenerator> prpProfileGenerator = m_currentProfiles[i].release();
m_currentProfiles.remove(i);
if (!m_currentProfiles.size())
s_sharedEnabledProfilerReference = 0;
if (ProfilerClient* client = prpProfileGenerator->client())
client->finishedProfiling(prpProfileGenerator->profile());
}
}
}
示例7: ASSERT_ARG
void Profiler::startProfiling(ExecState* exec, const String& title)
{
ASSERT_ARG(title, !title.isNull());
// Check if we currently have a Profile for this global ExecState and title.
// If so return early and don't create a new Profile.
JSGlobalObject* origin = exec ? exec->lexicalGlobalObject() : 0;
for (size_t i = 0; i < m_currentProfiles.size(); ++i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->origin() == origin && profileGenerator->title() == title)
return;
}
exec->globalData().m_enabledProfiler = this;
RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(exec, title, ++ProfilesUID);
m_currentProfiles.append(profileGenerator);
}
示例8:
PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const UString& title)
{
ExecState* globalExec = exec ? exec->lexicalGlobalObject()->globalExec() : 0;
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->originatingGlobalExec() == globalExec && (title.isNull() || profileGenerator->title() == title)) {
profileGenerator->stopProfiling();
RefPtr<Profile> returnProfile = profileGenerator->profile();
m_currentProfiles.remove(i);
if (!m_currentProfiles.size())
s_sharedEnabledProfilerReference = 0;
return returnProfile;
}
}
return 0;
}
示例9:
PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const String& title)
{
JSGlobalObject* origin = exec ? exec->lexicalGlobalObject() : 0;
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
if (profileGenerator->origin() == origin && (title.isNull() || profileGenerator->title() == title)) {
profileGenerator->stopProfiling();
RefPtr<Profile> returnProfile = profileGenerator->profile();
m_currentProfiles.remove(i);
if (!m_currentProfiles.size())
exec->globalData().m_enabledProfiler = 0;
return returnProfile;
}
}
return 0;
}