summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/profiler
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-18 15:36:45 +0100
committerBen Murdoch <benm@google.com>2009-08-18 19:20:06 +0100
commitd227fc870c7a697500a3c900c31baf05fb9a8524 (patch)
treea3fa109aa5bf52fef562ac49d97a2f723889cc71 /JavaScriptCore/profiler
parentf2c627513266faa73f7669058d98c60769fb3524 (diff)
downloadexternal_webkit-d227fc870c7a697500a3c900c31baf05fb9a8524.zip
external_webkit-d227fc870c7a697500a3c900c31baf05fb9a8524.tar.gz
external_webkit-d227fc870c7a697500a3c900c31baf05fb9a8524.tar.bz2
Merge WebKit r47420
Diffstat (limited to 'JavaScriptCore/profiler')
-rw-r--r--JavaScriptCore/profiler/ProfileGenerator.cpp1
-rw-r--r--JavaScriptCore/profiler/Profiler.cpp23
2 files changed, 13 insertions, 11 deletions
diff --git a/JavaScriptCore/profiler/ProfileGenerator.cpp b/JavaScriptCore/profiler/ProfileGenerator.cpp
index 1a061cb..dc68ecb 100644
--- a/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ b/JavaScriptCore/profiler/ProfileGenerator.cpp
@@ -27,6 +27,7 @@
#include "ProfileGenerator.h"
#include "CallFrame.h"
+#include "CodeBlock.h"
#include "JSGlobalObject.h"
#include "JSStringRef.h"
#include "JSFunction.h"
diff --git a/JavaScriptCore/profiler/Profiler.cpp b/JavaScriptCore/profiler/Profiler.cpp
index e103fd1..4565fe6 100644
--- a/JavaScriptCore/profiler/Profiler.cpp
+++ b/JavaScriptCore/profiler/Profiler.cpp
@@ -31,6 +31,7 @@
#include "CommonIdentifiers.h"
#include "CallFrame.h"
+#include "CodeBlock.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
#include "Nodes.h"
@@ -134,26 +135,26 @@ void Profiler::didExecute(ExecState* exec, const UString& sourceURL, int startin
dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(&exec->globalData(), JSValue(), sourceURL, startingLineNumber), exec->lexicalGlobalObject()->profileGroup());
}
-CallIdentifier Profiler::createCallIdentifier(JSGlobalData* globalData, JSValue function, const UString& defaultSourceURL, int defaultLineNumber)
+CallIdentifier Profiler::createCallIdentifier(JSGlobalData* globalData, JSValue functionValue, const UString& defaultSourceURL, int defaultLineNumber)
{
- if (!function)
+ if (!functionValue)
return CallIdentifier(GlobalCodeExecution, defaultSourceURL, defaultLineNumber);
- if (!function.isObject())
+ if (!functionValue.isObject())
return CallIdentifier("(unknown)", defaultSourceURL, defaultLineNumber);
- if (asObject(function)->inherits(&JSFunction::info)) {
- JSFunction* func = asFunction(function);
- if (!func->isHostFunction())
- return createCallIdentifierFromFunctionImp(globalData, func);
+ if (asObject(functionValue)->inherits(&JSFunction::info)) {
+ JSFunction* function = asFunction(functionValue);
+ if (!function->executable()->isHostFunction())
+ return createCallIdentifierFromFunctionImp(globalData, function);
}
- if (asObject(function)->inherits(&InternalFunction::info))
- return CallIdentifier(static_cast<InternalFunction*>(asObject(function))->name(globalData), defaultSourceURL, defaultLineNumber);
- return CallIdentifier("(" + asObject(function)->className() + " object)", defaultSourceURL, defaultLineNumber);
+ if (asObject(functionValue)->inherits(&InternalFunction::info))
+ return CallIdentifier(static_cast<InternalFunction*>(asObject(functionValue))->name(globalData), defaultSourceURL, defaultLineNumber);
+ return CallIdentifier("(" + asObject(functionValue)->className() + " object)", defaultSourceURL, defaultLineNumber);
}
CallIdentifier createCallIdentifierFromFunctionImp(JSGlobalData* globalData, JSFunction* function)
{
const UString& name = function->calculatedDisplayName(globalData);
- return CallIdentifier(name.isEmpty() ? AnonymousFunction : name, function->body()->sourceURL(), function->body()->lineNo());
+ return CallIdentifier(name.isEmpty() ? AnonymousFunction : name, function->executable()->sourceURL(), function->executable()->lineNo());
}
} // namespace JSC