From: kmccullough@apple.com Date: Tue, 13 May 2008 21:18:02 +0000 (+0000) Subject: 2008-05-13 Kevin McCullough X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=71be1f666a336339cdc3381ce84d6bd21c76d52f 2008-05-13 Kevin McCullough Reviewed by Geoff. JavaScript profiler (10928) Use PassRefPtrs instead of RefPtrs when appropriate. * profiler/FunctionCallProfile.cpp: (KJS::FunctionCallProfile::addChild): * profiler/FunctionCallProfile.h: * profiler/Profile.h: (KJS::Profile::callTree): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@33388 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index b320ee6..0750cef 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,5 +1,18 @@ 2008-05-13 Kevin McCullough + Reviewed by Geoff. + + JavaScript profiler (10928) + Use PassRefPtrs instead of RefPtrs when appropriate. + + * profiler/FunctionCallProfile.cpp: + (KJS::FunctionCallProfile::addChild): + * profiler/FunctionCallProfile.h: + * profiler/Profile.h: + (KJS::Profile::callTree): + +2008-05-13 Kevin McCullough + Reviewed by Sam. JavaScript profiler (10928) diff --git a/JavaScriptCore/profiler/FunctionCallProfile.cpp b/JavaScriptCore/profiler/FunctionCallProfile.cpp index 7dd10f6..f8510a2 100644 --- a/JavaScriptCore/profiler/FunctionCallProfile.cpp +++ b/JavaScriptCore/profiler/FunctionCallProfile.cpp @@ -65,17 +65,17 @@ void FunctionCallProfile::didExecute(Vector stackNames, unsigned int st } } -void FunctionCallProfile::addChild(RefPtr& child) +void FunctionCallProfile::addChild(PassRefPtr prpChild) { - if (!child) - return; + ASSERT(prpChild); + RefPtr child = prpChild; for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) { if ((*currentChild)->functionName() == child->functionName()) return; } - m_children.append(child); + m_children.append(child.release()); } FunctionCallProfile* FunctionCallProfile::findChild(const UString& name) diff --git a/JavaScriptCore/profiler/FunctionCallProfile.h b/JavaScriptCore/profiler/FunctionCallProfile.h index a1018c3..43cf44a 100644 --- a/JavaScriptCore/profiler/FunctionCallProfile.h +++ b/JavaScriptCore/profiler/FunctionCallProfile.h @@ -49,7 +49,7 @@ namespace KJS { void willExecute(); void didExecute(Vector stackNames, unsigned int stackIndex); - void addChild(RefPtr& child); + void addChild(PassRefPtr prpChild); FunctionCallProfile* findChild(const UString& name); void stopProfiling(); diff --git a/JavaScriptCore/profiler/Profile.h b/JavaScriptCore/profiler/Profile.h index 2eca295..8456579 100644 --- a/JavaScriptCore/profiler/Profile.h +++ b/JavaScriptCore/profiler/Profile.h @@ -45,7 +45,7 @@ namespace KJS { void stopProfiling() { m_callTree->stopProfiling(); }; const UString& title() const { return m_title; }; - RefPtr callTree() const { return m_callTree; }; + FunctionCallProfile* callTree() const { return m_callTree.get(); }; void printDataInspectorStyle() const; void printDataSampleStyle() const;