Changeset 106504 in webkit for trunk/Source/JavaScriptCore/profiler
- Timestamp:
- Feb 1, 2012, 3:23:30 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/profiler/Profiler.cpp
r99223 r106504 49 49 static unsigned ProfilesUID = 0; 50 50 51 static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JS Function*);51 static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JSObject*, const UString& defaultSourceURL, int defaultLineNumber); 52 52 53 53 Profiler* Profiler::s_sharedProfiler = 0; … … 164 164 if (!functionValue.isObject()) 165 165 return CallIdentifier("(unknown)", defaultSourceURL, defaultLineNumber); 166 if (asObject(functionValue)->inherits(&JSFunction::s_info)) { 167 JSFunction* function = asFunction(functionValue); 168 if (!function->executable()->isHostFunction()) 169 return createCallIdentifierFromFunctionImp(exec, function); 170 } 171 if (asObject(functionValue)->inherits(&JSFunction::s_info)) 172 return CallIdentifier(static_cast<JSFunction*>(asObject(functionValue))->name(exec), defaultSourceURL, defaultLineNumber); 173 if (asObject(functionValue)->inherits(&InternalFunction::s_info)) 174 return CallIdentifier(static_cast<InternalFunction*>(asObject(functionValue))->name(exec), defaultSourceURL, defaultLineNumber); 166 if (asObject(functionValue)->inherits(&JSFunction::s_info) || asObject(functionValue)->inherits(&InternalFunction::s_info)) 167 return createCallIdentifierFromFunctionImp(exec, asObject(functionValue), defaultSourceURL, defaultLineNumber); 175 168 return CallIdentifier(makeUString("(", asObject(functionValue)->methodTable()->className(asObject(functionValue)), " object)"), defaultSourceURL, defaultLineNumber); 176 169 } 177 170 178 CallIdentifier createCallIdentifierFromFunctionImp(ExecState* exec, JS Function* function)171 CallIdentifier createCallIdentifierFromFunctionImp(ExecState* exec, JSObject* function, const UString& defaultSourceURL, int defaultLineNumber) 179 172 { 180 ASSERT(!function->isHostFunction()); 181 const UString& name = function->calculatedDisplayName(exec); 182 return CallIdentifier(name.isEmpty() ? AnonymousFunction : name, function->jsExecutable()->sourceURL(), function->jsExecutable()->lineNo()); 173 const UString& name = getCalculatedDisplayName(exec, function); 174 JSFunction* jsFunction = jsDynamicCast<JSFunction*>(function); 175 if (jsFunction && !jsFunction->isHostFunction()) 176 return CallIdentifier(name.isEmpty() ? AnonymousFunction : name, jsFunction->jsExecutable()->sourceURL(), jsFunction->jsExecutable()->lineNo()); 177 return CallIdentifier(name.isEmpty() ? AnonymousFunction : name, defaultSourceURL, defaultLineNumber); 183 178 } 184 179
Note:
See TracChangeset
for help on using the changeset viewer.