From d227fc870c7a697500a3c900c31baf05fb9a8524 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 18 Aug 2009 15:36:45 +0100 Subject: Merge WebKit r47420 --- JavaScriptCore/profiler/ProfileGenerator.cpp | 1 + JavaScriptCore/profiler/Profiler.cpp | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'JavaScriptCore/profiler') 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(asObject(function))->name(globalData), defaultSourceURL, defaultLineNumber); - return CallIdentifier("(" + asObject(function)->className() + " object)", defaultSourceURL, defaultLineNumber); + if (asObject(functionValue)->inherits(&InternalFunction::info)) + return CallIdentifier(static_cast(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 -- cgit v1.1