Changeset 34086 in webkit for trunk/JavaScriptCore/profiler/Profiler.cpp
- Timestamp:
- May 23, 2008, 12:12:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/Profiler.cpp
r34085 r34086 99 99 } 100 100 101 static inline bool shouldExcludeFunction(ExecState* exec, JSObject* calledFunction) 102 { 103 if (!calledFunction->inherits(&InternalFunctionImp::info)) 104 return false; 105 // Don't record a call for function.call and function.apply. 106 if (static_cast<InternalFunctionImp*>(calledFunction)->functionName() == exec->propertyNames().call) 107 return true; 108 if (static_cast<InternalFunctionImp*>(calledFunction)->functionName() == exec->propertyNames().apply) 109 return true; 110 return false; 111 } 112 101 113 static inline void dispatchFunctionToProfiles(const Vector<RefPtr<Profile> >& profiles, Profile::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentPageGroupIdentifier) 102 114 { … … 108 120 void Profiler::willExecute(ExecState* exec, JSObject* calledFunction) 109 121 { 110 ASSERT(!m_currentProfiles.isEmpty()); 122 if (m_currentProfiles.isEmpty()) 123 return; 124 125 if (shouldExcludeFunction(exec, calledFunction)) 126 return; 111 127 112 128 dispatchFunctionToProfiles(m_currentProfiles, &Profile::willExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier()); … … 115 131 void Profiler::willExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber) 116 132 { 117 ASSERT(!m_currentProfiles.isEmpty()); 133 if (m_currentProfiles.isEmpty()) 134 return; 118 135 119 136 CallIdentifier callIdentifier = createCallIdentifier(sourceURL, startingLineNumber); … … 124 141 void Profiler::didExecute(ExecState* exec, JSObject* calledFunction) 125 142 { 126 ASSERT(!m_currentProfiles.isEmpty()); 143 if (m_currentProfiles.isEmpty()) 144 return; 145 146 if (shouldExcludeFunction(exec, calledFunction)) 147 return; 127 148 128 149 dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier()); … … 131 152 void Profiler::didExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber) 132 153 { 133 ASSERT(!m_currentProfiles.isEmpty()); 154 if (m_currentProfiles.isEmpty()) 155 return; 134 156 135 157 dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(sourceURL, startingLineNumber), exec->lexicalGlobalObject()->pageGroupIdentifier());
Note:
See TracChangeset
for help on using the changeset viewer.