summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/profiler
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/profiler')
-rw-r--r--JavaScriptCore/profiler/CallIdentifier.h12
-rw-r--r--JavaScriptCore/profiler/Profile.cpp6
-rw-r--r--JavaScriptCore/profiler/ProfileGenerator.cpp41
-rw-r--r--JavaScriptCore/profiler/ProfileGenerator.h8
-rw-r--r--JavaScriptCore/profiler/ProfileNode.cpp27
-rw-r--r--JavaScriptCore/profiler/ProfileNode.h22
-rw-r--r--JavaScriptCore/profiler/Profiler.cpp35
-rw-r--r--JavaScriptCore/profiler/Profiler.h10
-rw-r--r--JavaScriptCore/profiler/ProfilerServer.mm6
9 files changed, 101 insertions, 66 deletions
diff --git a/JavaScriptCore/profiler/CallIdentifier.h b/JavaScriptCore/profiler/CallIdentifier.h
index ba48c55..76c1470 100644
--- a/JavaScriptCore/profiler/CallIdentifier.h
+++ b/JavaScriptCore/profiler/CallIdentifier.h
@@ -29,6 +29,8 @@
#include <runtime/UString.h>
#include "FastAllocBase.h"
+#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
namespace JSC {
@@ -44,7 +46,7 @@ namespace JSC {
CallIdentifier(const UString& name, const UString& url, int lineNumber)
: m_name(name)
- , m_url(url)
+ , m_url(!url.isNull() ? url : "")
, m_lineNumber(lineNumber)
{
}
@@ -56,11 +58,11 @@ namespace JSC {
static unsigned hash(const CallIdentifier& key)
{
unsigned hashCodes[3] = {
- key.m_name.rep()->hash(),
- key.m_url.rep()->hash(),
+ key.m_name.impl()->hash(),
+ key.m_url.impl()->hash(),
key.m_lineNumber
};
- return UString::Rep::computeHash(reinterpret_cast<char*>(hashCodes), sizeof(hashCodes));
+ return WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(hashCodes);
}
static bool equal(const CallIdentifier& a, const CallIdentifier& b) { return a == b; }
@@ -71,7 +73,7 @@ namespace JSC {
#ifndef NDEBUG
operator const char*() const { return c_str(); }
- const char* c_str() const { return m_name.UTF8String().c_str(); }
+ const char* c_str() const { return m_name.utf8().data(); }
#endif
};
diff --git a/JavaScriptCore/profiler/Profile.cpp b/JavaScriptCore/profiler/Profile.cpp
index c90f9b0..1a84518 100644
--- a/JavaScriptCore/profiler/Profile.cpp
+++ b/JavaScriptCore/profiler/Profile.cpp
@@ -42,7 +42,7 @@ Profile::Profile(const UString& title, unsigned uid)
{
// FIXME: When multi-threading is supported this will be a vector and calls
// into the profiler will need to know which thread it is executing on.
- m_head = ProfileNode::create(CallIdentifier("Thread_1", UString(), 0), 0, 0);
+ m_head = ProfileNode::create(0, CallIdentifier("Thread_1", UString(), 0), 0, 0);
}
Profile::~Profile()
@@ -106,7 +106,7 @@ void Profile::debugPrintData() const
m_head->debugPrintData(0);
}
-typedef pair<UString::Rep*, unsigned> NameCountPair;
+typedef pair<StringImpl*, unsigned> NameCountPair;
static inline bool functionNameCountPairComparator(const NameCountPair& a, const NameCountPair& b)
{
@@ -127,7 +127,7 @@ void Profile::debugPrintDataSampleStyle() const
std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
- printf(" %-12d%s\n", (*it).second, UString((*it).first).UTF8String().c_str());
+ printf(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data());
printf("\nSort by top of stack, same collapsed (when >= 5):\n");
}
diff --git a/JavaScriptCore/profiler/ProfileGenerator.cpp b/JavaScriptCore/profiler/ProfileGenerator.cpp
index f367033..68d1733 100644
--- a/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ b/JavaScriptCore/profiler/ProfileGenerator.cpp
@@ -63,7 +63,7 @@ void ProfileGenerator::addParentForConsoleStart(ExecState* exec)
JSValue function;
exec->interpreter()->retrieveLastCaller(exec, lineNumber, sourceID, sourceURL, function);
- m_currentNode = ProfileNode::create(Profiler::createCallIdentifier(exec, function ? function.toThisObject(exec) : 0, sourceURL, lineNumber), m_head.get(), m_head.get());
+ m_currentNode = ProfileNode::create(exec, Profiler::createCallIdentifier(exec, function ? function.toThisObject(exec) : 0, sourceURL, lineNumber), m_head.get(), m_head.get());
m_head->insertNode(m_currentNode.get());
}
@@ -72,35 +72,35 @@ const UString& ProfileGenerator::title() const
return m_profile->title();
}
-void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
+void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
{
if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
- CString name = callIdentifier.m_name.UTF8String();
- CString url = callIdentifier.m_url.UTF8String();
- JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
+ CString name = callIdentifier.m_name.utf8();
+ CString url = callIdentifier.m_url.utf8();
+ JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
}
if (!m_originatingGlobalExec)
return;
- ASSERT_ARG(m_currentNode, m_currentNode);
- m_currentNode = m_currentNode->willExecute(callIdentifier);
+ ASSERT(m_currentNode);
+ m_currentNode = m_currentNode->willExecute(callerCallFrame, callIdentifier);
}
-void ProfileGenerator::didExecute(const CallIdentifier& callIdentifier)
+void ProfileGenerator::didExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
{
if (JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED()) {
- CString name = callIdentifier.m_name.UTF8String();
- CString url = callIdentifier.m_url.UTF8String();
- JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
+ CString name = callIdentifier.m_name.utf8();
+ CString url = callIdentifier.m_url.utf8();
+ JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
}
if (!m_originatingGlobalExec)
return;
- ASSERT_ARG(m_currentNode, m_currentNode);
+ ASSERT(m_currentNode);
if (m_currentNode->callIdentifier() != callIdentifier) {
- RefPtr<ProfileNode> returningNode = ProfileNode::create(callIdentifier, m_head.get(), m_currentNode.get());
+ RefPtr<ProfileNode> returningNode = ProfileNode::create(callerCallFrame, callIdentifier, m_head.get(), m_currentNode.get());
returningNode->setStartTime(m_currentNode->startTime());
returningNode->didExecute();
m_currentNode->insertNode(returningNode.release());
@@ -110,6 +110,17 @@ void ProfileGenerator::didExecute(const CallIdentifier& callIdentifier)
m_currentNode = m_currentNode->didExecute();
}
+void ProfileGenerator::exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&)
+{
+ // If the current node was called by the handler (==) or any
+ // more nested function (>) the we have exited early from it.
+ ASSERT(m_currentNode);
+ while (m_currentNode->callerCallFrame() >= handlerCallFrame) {
+ didExecute(m_currentNode->callerCallFrame(), m_currentNode->callIdentifier());
+ ASSERT(m_currentNode);
+ }
+}
+
void ProfileGenerator::stopProfiling()
{
m_profile->forEach(&ProfileNode::stopProfiling);
@@ -117,14 +128,14 @@ void ProfileGenerator::stopProfiling()
removeProfileStart();
removeProfileEnd();
- ASSERT_ARG(m_currentNode, m_currentNode);
+ ASSERT(m_currentNode);
// Set the current node to the parent, because we are in a call that
// will not get didExecute call.
m_currentNode = m_currentNode->parent();
if (double headSelfTime = m_head->selfTime()) {
- RefPtr<ProfileNode> idleNode = ProfileNode::create(CallIdentifier(NonJSExecution, UString(), 0), m_head.get(), m_head.get());
+ RefPtr<ProfileNode> idleNode = ProfileNode::create(0, CallIdentifier(NonJSExecution, UString(), 0), m_head.get(), m_head.get());
idleNode->setTotalTime(headSelfTime);
idleNode->setSelfTime(headSelfTime);
diff --git a/JavaScriptCore/profiler/ProfileGenerator.h b/JavaScriptCore/profiler/ProfileGenerator.h
index 82149b3..cbed73b 100644
--- a/JavaScriptCore/profiler/ProfileGenerator.h
+++ b/JavaScriptCore/profiler/ProfileGenerator.h
@@ -50,13 +50,15 @@ namespace JSC {
unsigned profileGroup() const { return m_profileGroup; }
// Collecting
- void willExecute(const CallIdentifier&);
- void didExecute(const CallIdentifier&);
+ void willExecute(ExecState* callerCallFrame, const CallIdentifier&);
+ void didExecute(ExecState* callerCallFrame, const CallIdentifier&);
+
+ void exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&);
// Stopping Profiling
void stopProfiling();
- typedef void (ProfileGenerator::*ProfileFunction)(const CallIdentifier& callIdentifier);
+ typedef void (ProfileGenerator::*ProfileFunction)(ExecState* callerOrHandlerCallFrame, const CallIdentifier& callIdentifier);
private:
ProfileGenerator(const UString& title, ExecState* originatingExec, unsigned uid);
diff --git a/JavaScriptCore/profiler/ProfileNode.cpp b/JavaScriptCore/profiler/ProfileNode.cpp
index fb126b3..8f20bbe 100644
--- a/JavaScriptCore/profiler/ProfileNode.cpp
+++ b/JavaScriptCore/profiler/ProfileNode.cpp
@@ -32,6 +32,7 @@
#include "Profiler.h"
#include <stdio.h>
#include <wtf/DateMath.h>
+#include <wtf/text/StringHash.h>
#if OS(WINDOWS)
#include <windows.h>
@@ -44,7 +45,7 @@ namespace JSC {
static double getCount()
{
#if OS(WINDOWS)
- static LARGE_INTEGER frequency = {0};
+ static LARGE_INTEGER frequency;
if (!frequency.QuadPart)
QueryPerformanceFrequency(&frequency);
LARGE_INTEGER counter;
@@ -55,8 +56,9 @@ static double getCount()
#endif
}
-ProfileNode::ProfileNode(const CallIdentifier& callIdentifier, ProfileNode* headNode, ProfileNode* parentNode)
- : m_callIdentifier(callIdentifier)
+ProfileNode::ProfileNode(ExecState* callerCallFrame, const CallIdentifier& callIdentifier, ProfileNode* headNode, ProfileNode* parentNode)
+ : m_callerCallFrame(callerCallFrame)
+ , m_callIdentifier(callIdentifier)
, m_head(headNode)
, m_parent(parentNode)
, m_nextSibling(0)
@@ -71,8 +73,9 @@ ProfileNode::ProfileNode(const CallIdentifier& callIdentifier, ProfileNode* head
startTimer();
}
-ProfileNode::ProfileNode(ProfileNode* headNode, ProfileNode* nodeToCopy)
- : m_callIdentifier(nodeToCopy->callIdentifier())
+ProfileNode::ProfileNode(ExecState* callerCallFrame, ProfileNode* headNode, ProfileNode* nodeToCopy)
+ : m_callerCallFrame(callerCallFrame)
+ , m_callIdentifier(nodeToCopy->callIdentifier())
, m_head(headNode)
, m_parent(nodeToCopy->parent())
, m_nextSibling(0)
@@ -86,7 +89,7 @@ ProfileNode::ProfileNode(ProfileNode* headNode, ProfileNode* nodeToCopy)
{
}
-ProfileNode* ProfileNode::willExecute(const CallIdentifier& callIdentifier)
+ProfileNode* ProfileNode::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
{
for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) {
if ((*currentChild)->callIdentifier() == callIdentifier) {
@@ -95,7 +98,7 @@ ProfileNode* ProfileNode::willExecute(const CallIdentifier& callIdentifier)
}
}
- RefPtr<ProfileNode> newChild = ProfileNode::create(callIdentifier, m_head ? m_head : this, this); // If this ProfileNode has no head it is the head.
+ RefPtr<ProfileNode> newChild = ProfileNode::create(callerCallFrame, callIdentifier, m_head ? m_head : this, this); // If this ProfileNode has no head it is the head.
if (m_children.size())
m_children.last()->setNextSibling(newChild.get());
m_children.append(newChild.release());
@@ -293,11 +296,11 @@ void ProfileNode::debugPrintData(int indentLevel) const
printf(" ");
printf("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n",
- functionName().UTF8String().c_str(),
+ functionName().utf8().data(),
m_numberOfCalls, m_actualSelfTime, selfPercent(), m_actualTotalTime, totalPercent(),
m_visibleSelfTime, m_visibleTotalTime,
(m_visible ? "True" : "False"),
- m_nextSibling ? m_nextSibling->functionName().UTF8String().c_str() : "");
+ m_nextSibling ? m_nextSibling->functionName().utf8().data() : "");
++indentLevel;
@@ -312,13 +315,13 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC
printf(" ");
// Print function names
- const char* name = functionName().UTF8String().c_str();
+ const char* name = functionName().utf8().data();
double sampleCount = m_actualTotalTime * 1000;
if (indentLevel) {
for (int i = 0; i < indentLevel; ++i)
printf(" ");
- countedFunctions.add(functionName().rep());
+ countedFunctions.add(functionName().impl());
printf("%.0f %s\n", sampleCount ? sampleCount : 1, name);
} else
@@ -338,7 +341,7 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC
while (indentLevel--)
printf(" ");
- printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().UTF8String().c_str());
+ printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data());
}
return m_actualTotalTime;
diff --git a/JavaScriptCore/profiler/ProfileNode.h b/JavaScriptCore/profiler/ProfileNode.h
index 2b5a936..ffe7b6f 100644
--- a/JavaScriptCore/profiler/ProfileNode.h
+++ b/JavaScriptCore/profiler/ProfileNode.h
@@ -30,36 +30,39 @@
#define ProfileNode_h
#include "CallIdentifier.h"
-#include <wtf/Vector.h>
+#include <wtf/HashCountedSet.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
namespace JSC {
+ class ExecState;
class ProfileNode;
typedef Vector<RefPtr<ProfileNode> >::const_iterator StackIterator;
- typedef HashCountedSet<UString::Rep*> FunctionCallHashCount;
+ typedef HashCountedSet<StringImpl*> FunctionCallHashCount;
class ProfileNode : public RefCounted<ProfileNode> {
public:
- static PassRefPtr<ProfileNode> create(const CallIdentifier& callIdentifier, ProfileNode* headNode, ProfileNode* parentNode)
+ static PassRefPtr<ProfileNode> create(ExecState* callerCallFrame, const CallIdentifier& callIdentifier, ProfileNode* headNode, ProfileNode* parentNode)
{
- return adoptRef(new ProfileNode(callIdentifier, headNode, parentNode));
+ return adoptRef(new ProfileNode(callerCallFrame, callIdentifier, headNode, parentNode));
}
- static PassRefPtr<ProfileNode> create(ProfileNode* headNode, ProfileNode* node)
+ static PassRefPtr<ProfileNode> create(ExecState* callerCallFrame, ProfileNode* headNode, ProfileNode* node)
{
- return adoptRef(new ProfileNode(headNode, node));
+ return adoptRef(new ProfileNode(callerCallFrame, headNode, node));
}
bool operator==(ProfileNode* node) { return m_callIdentifier == node->callIdentifier(); }
- ProfileNode* willExecute(const CallIdentifier&);
+ ProfileNode* willExecute(ExecState* callerCallFrame, const CallIdentifier&);
ProfileNode* didExecute();
void stopProfiling();
// CallIdentifier members
+ ExecState* callerCallFrame() const { return m_callerCallFrame; }
const CallIdentifier& callIdentifier() const { return m_callIdentifier; }
const UString& functionName() const { return m_callIdentifier.m_name; }
const UString& url() const { return m_callIdentifier.m_url; }
@@ -127,8 +130,8 @@ namespace JSC {
#endif
private:
- ProfileNode(const CallIdentifier&, ProfileNode* headNode, ProfileNode* parentNode);
- ProfileNode(ProfileNode* headNode, ProfileNode* nodeToCopy);
+ ProfileNode(ExecState* callerCallFrame, const CallIdentifier&, ProfileNode* headNode, ProfileNode* parentNode);
+ ProfileNode(ExecState* callerCallFrame, ProfileNode* headNode, ProfileNode* nodeToCopy);
void startTimer();
void resetChildrensSiblings();
@@ -146,6 +149,7 @@ namespace JSC {
static inline bool functionNameDescendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return a->functionName() > b->functionName(); }
static inline bool functionNameAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) { return a->functionName() < b->functionName(); }
+ ExecState* m_callerCallFrame;
CallIdentifier m_callIdentifier;
ProfileNode* m_head;
ProfileNode* m_parent;
diff --git a/JavaScriptCore/profiler/Profiler.cpp b/JavaScriptCore/profiler/Profiler.cpp
index fe8727a..9ac73fd 100644
--- a/JavaScriptCore/profiler/Profiler.cpp
+++ b/JavaScriptCore/profiler/Profiler.cpp
@@ -32,12 +32,14 @@
#include "CommonIdentifiers.h"
#include "CallFrame.h"
#include "CodeBlock.h"
+#include "InternalFunction.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
#include "Nodes.h"
#include "Profile.h"
#include "ProfileGenerator.h"
#include "ProfileNode.h"
+#include "UStringConcatenate.h"
#include <stdio.h>
namespace JSC {
@@ -97,42 +99,49 @@ PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const UString& titl
return 0;
}
-static inline void dispatchFunctionToProfiles(const Vector<RefPtr<ProfileGenerator> >& profiles, ProfileGenerator::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentProfileTargetGroup)
+static inline void dispatchFunctionToProfiles(ExecState* callerOrHandlerCallFrame, const Vector<RefPtr<ProfileGenerator> >& profiles, ProfileGenerator::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentProfileTargetGroup)
{
for (size_t i = 0; i < profiles.size(); ++i) {
if (profiles[i]->profileGroup() == currentProfileTargetGroup || !profiles[i]->originatingGlobalExec())
- (profiles[i].get()->*function)(callIdentifier);
+ (profiles[i].get()->*function)(callerOrHandlerCallFrame, callIdentifier);
}
}
-void Profiler::willExecute(ExecState* exec, JSValue function)
+void Profiler::willExecute(ExecState* callerCallFrame, JSValue function)
{
ASSERT(!m_currentProfiles.isEmpty());
- dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::willExecute, createCallIdentifier(exec, function, "", 0), exec->lexicalGlobalObject()->profileGroup());
+ dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::willExecute, createCallIdentifier(callerCallFrame, function, "", 0), callerCallFrame->lexicalGlobalObject()->profileGroup());
}
-void Profiler::willExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber)
+void Profiler::willExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber)
{
ASSERT(!m_currentProfiles.isEmpty());
- CallIdentifier callIdentifier = createCallIdentifier(exec, JSValue(), sourceURL, startingLineNumber);
+ CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, JSValue(), sourceURL, startingLineNumber);
- dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::willExecute, callIdentifier, exec->lexicalGlobalObject()->profileGroup());
+ dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::willExecute, callIdentifier, callerCallFrame->lexicalGlobalObject()->profileGroup());
}
-void Profiler::didExecute(ExecState* exec, JSValue function)
+void Profiler::didExecute(ExecState* callerCallFrame, JSValue function)
{
ASSERT(!m_currentProfiles.isEmpty());
- dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(exec, function, "", 0), exec->lexicalGlobalObject()->profileGroup());
+ dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(callerCallFrame, function, "", 0), callerCallFrame->lexicalGlobalObject()->profileGroup());
}
-void Profiler::didExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber)
+void Profiler::didExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber)
{
ASSERT(!m_currentProfiles.isEmpty());
- dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(exec, JSValue(), sourceURL, startingLineNumber), exec->lexicalGlobalObject()->profileGroup());
+ dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(callerCallFrame, JSValue(), sourceURL, startingLineNumber), callerCallFrame->lexicalGlobalObject()->profileGroup());
+}
+
+void Profiler::exceptionUnwind(ExecState* handlerCallFrame)
+{
+ ASSERT(!m_currentProfiles.isEmpty());
+
+ dispatchFunctionToProfiles(handlerCallFrame, m_currentProfiles, &ProfileGenerator::exceptionUnwind, createCallIdentifier(handlerCallFrame, JSValue(), "", 0), handlerCallFrame->lexicalGlobalObject()->profileGroup());
}
CallIdentifier Profiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const UString& defaultSourceURL, int defaultLineNumber)
@@ -146,9 +155,11 @@ CallIdentifier Profiler::createCallIdentifier(ExecState* exec, JSValue functionV
if (!function->executable()->isHostFunction())
return createCallIdentifierFromFunctionImp(exec, function);
}
+ if (asObject(functionValue)->inherits(&JSFunction::info))
+ return CallIdentifier(static_cast<JSFunction*>(asObject(functionValue))->name(exec), defaultSourceURL, defaultLineNumber);
if (asObject(functionValue)->inherits(&InternalFunction::info))
return CallIdentifier(static_cast<InternalFunction*>(asObject(functionValue))->name(exec), defaultSourceURL, defaultLineNumber);
- return CallIdentifier(makeString("(", asObject(functionValue)->className(), " object)"), defaultSourceURL, defaultLineNumber);
+ return CallIdentifier(makeUString("(", asObject(functionValue)->className(), " object)"), defaultSourceURL, defaultLineNumber);
}
CallIdentifier createCallIdentifierFromFunctionImp(ExecState* exec, JSFunction* function)
diff --git a/JavaScriptCore/profiler/Profiler.h b/JavaScriptCore/profiler/Profiler.h
index 4b8b4a0..f9c2ccb 100644
--- a/JavaScriptCore/profiler/Profiler.h
+++ b/JavaScriptCore/profiler/Profiler.h
@@ -57,10 +57,12 @@ namespace JSC {
void startProfiling(ExecState*, const UString& title);
PassRefPtr<Profile> stopProfiling(ExecState*, const UString& title);
- void willExecute(ExecState*, JSValue function);
- void willExecute(ExecState*, const UString& sourceURL, int startingLineNumber);
- void didExecute(ExecState*, JSValue function);
- void didExecute(ExecState*, const UString& sourceURL, int startingLineNumber);
+ void willExecute(ExecState* callerCallFrame, JSValue function);
+ void willExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber);
+ void didExecute(ExecState* callerCallFrame, JSValue function);
+ void didExecute(ExecState* callerCallFrame, const UString& sourceURL, int startingLineNumber);
+
+ void exceptionUnwind(ExecState* handlerCallFrame);
const Vector<RefPtr<ProfileGenerator> >& currentProfiles() { return m_currentProfiles; };
diff --git a/JavaScriptCore/profiler/ProfilerServer.mm b/JavaScriptCore/profiler/ProfilerServer.mm
index a3944de..7d87f96 100644
--- a/JavaScriptCore/profiler/ProfilerServer.mm
+++ b/JavaScriptCore/profiler/ProfilerServer.mm
@@ -30,7 +30,7 @@
#import "JSRetainPtr.h"
#import <Foundation/Foundation.h>
-#if PLATFORM(IPHONE_SIMULATOR)
+#if PLATFORM(IOS_SIMULATOR)
#import <Foundation/NSDistributedNotificationCenter.h>
#endif
@@ -65,7 +65,7 @@
if ([defaults boolForKey:@"EnableJSProfiling"])
[self startProfiling];
-#if !PLATFORM(IPHONE) || PLATFORM(IPHONE_SIMULATOR)
+#if !PLATFORM(IOS) || PLATFORM(IOS_SIMULATOR)
// FIXME: <rdar://problem/6546135>
// The catch-all notifications
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(startProfiling) name:@"ProfilerServerStartNotification" object:nil];
@@ -76,7 +76,7 @@
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
_serverName = [[NSString alloc] initWithFormat:@"ProfilerServer-%d", [processInfo processIdentifier]];
-#if !PLATFORM(IPHONE) || PLATFORM(IPHONE_SIMULATOR)
+#if !PLATFORM(IOS) || PLATFORM(IOS_SIMULATOR)
// FIXME: <rdar://problem/6546135>
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(startProfiling) name:[_serverName stringByAppendingString:@"-Start"] object:nil];
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(stopProfiling) name:[_serverName stringByAppendingString:@"-Stop"] object:nil];