Changeset 35039 in webkit for trunk/JavaScriptCore/profiler/Profiler.cpp
- Timestamp:
- Jul 7, 2008, 11:12:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/Profiler.cpp
r35037 r35039 34 34 #include "JSGlobalObject.h" 35 35 #include "Profile.h" 36 #include "ProfileGenerator.h" 36 37 #include "ProfileNode.h" 37 38 #include <stdio.h> … … 64 65 ExecState* globalExec = exec->lexicalGlobalObject()->globalExec(); 65 66 for (size_t i = 0; i < m_currentProfiles.size(); ++i) { 66 Profile * profile= m_currentProfiles[i].get();67 if (!profile ->stoppedProfiling() && profile->originatingGlobalExec() == globalExec && profile->title() == title)67 ProfileGenerator* profileGenerator = m_currentProfiles[i].get(); 68 if (!profileGenerator->stoppedProfiling() && profileGenerator->originatingGlobalExec() == globalExec && profileGenerator->title() == title) 68 69 return; 69 70 } 70 71 71 72 s_sharedEnabledProfilerReference = this; 72 RefPtr<Profile > profile = Profile::create(title, globalExec, exec->lexicalGlobalObject()->pageGroupIdentifier(), client);73 m_currentProfiles.append(profile );73 RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(title, globalExec, exec->lexicalGlobalObject()->pageGroupIdentifier(), client); 74 m_currentProfiles.append(profileGenerator); 74 75 } 75 76 … … 78 79 ExecState* globalExec = exec->lexicalGlobalObject()->globalExec(); 79 80 for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) { 80 Profile * profile= m_currentProfiles[i].get();81 if (!profile ->stoppedProfiling() && profile->originatingGlobalExec() == globalExec && (title.isNull() || profile->title() == title))81 ProfileGenerator* profileGenerator = m_currentProfiles[i].get(); 82 if (!profileGenerator->stoppedProfiling() && profileGenerator->originatingGlobalExec() == globalExec && (title.isNull() || profileGenerator->title() == title)) 82 83 m_currentProfiles[i]->stopProfiling(); 83 84 } … … 88 89 ExecState* globalExec = exec->lexicalGlobalObject()->globalExec(); 89 90 for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) { 90 Profile * profile= m_currentProfiles[i].get();91 if (profile ->originatingGlobalExec() == globalExec && profile->didFinishAllExecution()) {92 PassRefPtr<Profile > prpProfile = m_currentProfiles[i].release();91 ProfileGenerator* profileGenerator = m_currentProfiles[i].get(); 92 if (profileGenerator->originatingGlobalExec() == globalExec && profileGenerator->didFinishAllExecution()) { 93 PassRefPtr<ProfileGenerator> prpProfileGenerator = m_currentProfiles[i].release(); 93 94 m_currentProfiles.remove(i); 94 95 … … 96 97 s_sharedEnabledProfilerReference = 0; 97 98 98 if (ProfilerClient* client = prpProfile ->client())99 client->finishedProfiling(prpProfile );99 if (ProfilerClient* client = prpProfileGenerator->client()) 100 client->finishedProfiling(prpProfileGenerator->profile()); 100 101 } 101 102 } 102 103 } 103 104 104 static inline void dispatchFunctionToProfiles(const Vector<RefPtr<Profile > >& profiles, Profile::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentPageGroupIdentifier)105 static inline void dispatchFunctionToProfiles(const Vector<RefPtr<ProfileGenerator> >& profiles, ProfileGenerator::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentPageGroupIdentifier) 105 106 { 106 107 for (size_t i = 0; i < profiles.size(); ++i) { … … 114 115 ASSERT(!m_currentProfiles.isEmpty()); 115 116 116 dispatchFunctionToProfiles(m_currentProfiles, &Profile ::willExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());117 dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::willExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier()); 117 118 } 118 119 … … 123 124 CallIdentifier callIdentifier = createCallIdentifier(sourceURL, startingLineNumber); 124 125 125 dispatchFunctionToProfiles(m_currentProfiles, &Profile ::willExecute, callIdentifier, exec->lexicalGlobalObject()->pageGroupIdentifier());126 dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::willExecute, callIdentifier, exec->lexicalGlobalObject()->pageGroupIdentifier()); 126 127 } 127 128 … … 130 131 ASSERT(!m_currentProfiles.isEmpty()); 131 132 132 dispatchFunctionToProfiles(m_currentProfiles, &Profile ::didExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());133 dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier()); 133 134 } 134 135 … … 137 138 ASSERT(!m_currentProfiles.isEmpty()); 138 139 139 dispatchFunctionToProfiles(m_currentProfiles, &Profile ::didExecute, createCallIdentifier(sourceURL, startingLineNumber), exec->lexicalGlobalObject()->pageGroupIdentifier());140 dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(sourceURL, startingLineNumber), exec->lexicalGlobalObject()->pageGroupIdentifier()); 140 141 } 141 142
Note:
See TracChangeset
for help on using the changeset viewer.