Changeset 34085 in webkit for trunk/JavaScriptCore/profiler/Profiler.cpp
- Timestamp:
- May 23, 2008, 10:50:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/Profiler.cpp
r34065 r34085 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 113 101 static inline void dispatchFunctionToProfiles(const Vector<RefPtr<Profile> >& profiles, Profile::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentPageGroupIdentifier) 114 102 { … … 120 108 void Profiler::willExecute(ExecState* exec, JSObject* calledFunction) 121 109 { 122 if (m_currentProfiles.isEmpty()) 123 return; 124 125 if (shouldExcludeFunction(exec, calledFunction)) 126 return; 110 ASSERT(!m_currentProfiles.isEmpty()); 127 111 128 112 dispatchFunctionToProfiles(m_currentProfiles, &Profile::willExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier()); … … 131 115 void Profiler::willExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber) 132 116 { 133 if (m_currentProfiles.isEmpty()) 134 return; 117 ASSERT(!m_currentProfiles.isEmpty()); 135 118 136 119 CallIdentifier callIdentifier = createCallIdentifier(sourceURL, startingLineNumber); … … 141 124 void Profiler::didExecute(ExecState* exec, JSObject* calledFunction) 142 125 { 143 if (m_currentProfiles.isEmpty()) 144 return; 145 146 if (shouldExcludeFunction(exec, calledFunction)) 147 return; 126 ASSERT(!m_currentProfiles.isEmpty()); 148 127 149 128 dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier()); … … 152 131 void Profiler::didExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber) 153 132 { 154 if (m_currentProfiles.isEmpty()) 155 return; 133 ASSERT(!m_currentProfiles.isEmpty()); 156 134 157 135 dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(sourceURL, startingLineNumber), exec->lexicalGlobalObject()->pageGroupIdentifier());
Note:
See TracChangeset
for help on using the changeset viewer.