Commit aeb5dd75 authored by timothy@apple.com's avatar timothy@apple.com

Fixes a couple performance issues with the profiler. Also fixes

a regression where some nodes wouldn't be added to the tree.

Reviewed by Kevin McCullough.

* profiler/ProfileNode.cpp:
(KJS::ProfileNode::addChild): Compare callIdentifier instead
of functionName.
* profiler/ProfileNode.h:
(CallIdentifier.operator==): Compare the CallIdentifiers in
an order that fails sooner for non-matches.
(CallIdentifier.callIdentifier): Return the CallIdentifier by
reference to prevent making a new copy each time.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5ac91ee6
2008-05-20 Timothy Hatcher <timothy@apple.com>
Fixes a couple performance issues with the profiler. Also fixes
a regression where some nodes wouldn't be added to the tree.
Reviewed by Kevin McCullough.
* profiler/ProfileNode.cpp:
(KJS::ProfileNode::addChild): Compare callIdentifier instead
of functionName.
* profiler/ProfileNode.h:
(CallIdentifier.operator==): Compare the CallIdentifiers in
an order that fails sooner for non-matches.
(CallIdentifier.callIdentifier): Return the CallIdentifier by
reference to prevent making a new copy each time.
2008-05-20 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin.
......
......@@ -77,7 +77,7 @@ void ProfileNode::addChild(PassRefPtr<ProfileNode> prpChild)
RefPtr<ProfileNode> child = prpChild;
for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) {
if ((*currentChild)->functionName() == child->functionName())
if ((*currentChild)->callIdentifier() == child->callIdentifier())
return;
}
......
......@@ -50,7 +50,7 @@ namespace KJS {
CallIdentifier(UString name, UString url, int lineNumber) : name(name), url(url), lineNumber(lineNumber) {}
CallIdentifier(const CallIdentifier& ci) : name(ci.name), url(ci.url), lineNumber(ci.lineNumber) {}
inline bool operator== (const CallIdentifier& ci) const { return ci.name == name && ci.lineNumber == lineNumber && ci.url == url; }
inline bool operator== (const CallIdentifier& ci) const { return ci.lineNumber == lineNumber && ci.name == name && ci.url == url; }
};
class ProfileNode : public RefCounted<ProfileNode> {
......@@ -65,7 +65,7 @@ namespace KJS {
void stopProfiling(double totalProfileTime, bool headProfileNode = false);
CallIdentifier callIdentifier() const { return m_callIdentifier; }
const CallIdentifier& callIdentifier() const { return m_callIdentifier; }
UString functionName() const { return m_callIdentifier.name; }
UString url() const { return m_callIdentifier.url; }
unsigned lineNumber() const { return m_callIdentifier.lineNumber; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment