Title: [86947] trunk/Source/WebCore
- Revision
- 86947
- Author
- mnaga...@chromium.org
- Date
- 2011-05-20 06:46:03 -0700 (Fri, 20 May 2011)
Log Message
2011-05-20 Mikhail Naganov <mnaga...@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: [Chromium] Use bottom-up CPU profile tree built in VM,
instead of building it on Inspector's side.
https://bugs.webkit.org/show_bug.cgi?id=61185
* bindings/js/ScriptProfile.cpp:
(WebCore::ScriptProfile::bottomUpHead):
(WebCore::ScriptProfile::buildInspectorObjectForBottomUpHead):
* bindings/js/ScriptProfile.h:
* bindings/v8/ScriptProfile.cpp:
(WebCore::ScriptProfile::bottomUpHead):
(WebCore::ScriptProfile::buildInspectorObjectForBottomUpHead):
* bindings/v8/ScriptProfile.h:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::getProfile):
* inspector/front-end/ProfileView.js:
(WebInspector.CPUProfileView.prototype.get bottomUpProfileDataGridTree):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (86946 => 86947)
--- trunk/Source/WebCore/ChangeLog 2011-05-20 13:32:03 UTC (rev 86946)
+++ trunk/Source/WebCore/ChangeLog 2011-05-20 13:46:03 UTC (rev 86947)
@@ -1,3 +1,24 @@
+2011-05-20 Mikhail Naganov <mnaga...@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [Chromium] Use bottom-up CPU profile tree built in VM,
+ instead of building it on Inspector's side.
+ https://bugs.webkit.org/show_bug.cgi?id=61185
+
+ * bindings/js/ScriptProfile.cpp:
+ (WebCore::ScriptProfile::bottomUpHead):
+ (WebCore::ScriptProfile::buildInspectorObjectForBottomUpHead):
+ * bindings/js/ScriptProfile.h:
+ * bindings/v8/ScriptProfile.cpp:
+ (WebCore::ScriptProfile::bottomUpHead):
+ (WebCore::ScriptProfile::buildInspectorObjectForBottomUpHead):
+ * bindings/v8/ScriptProfile.h:
+ * inspector/InspectorProfilerAgent.cpp:
+ (WebCore::InspectorProfilerAgent::getProfile):
+ * inspector/front-end/ProfileView.js:
+ (WebInspector.CPUProfileView.prototype.get bottomUpProfileDataGridTree):
+
2011-05-20 Adam Roben <aro...@apple.com>
Mac build fix after r86936
Modified: trunk/Source/WebCore/bindings/js/ScriptProfile.cpp (86946 => 86947)
--- trunk/Source/WebCore/bindings/js/ScriptProfile.cpp 2011-05-20 13:32:03 UTC (rev 86946)
+++ trunk/Source/WebCore/bindings/js/ScriptProfile.cpp 2011-05-20 13:46:03 UTC (rev 86947)
@@ -66,6 +66,13 @@
return m_profile->head();
}
+PassRefPtr<ScriptProfileNode> ScriptProfile::bottomUpHead() const
+{
+ // FIXME: implement building bottom-up profiles in C++ code,
+ // but consider https://bugs.webkit.org/show_bug.cgi?id=24604
+ return 0;
+}
+
#if ENABLE(INSPECTOR)
static PassRefPtr<InspectorObject> buildInspectorObjectFor(const JSC::ProfileNode* node)
{
@@ -95,6 +102,11 @@
{
return buildInspectorObjectFor(m_profile->head());
}
+
+PassRefPtr<InspectorObject> ScriptProfile::buildInspectorObjectForBottomUpHead() const
+{
+ return 0;
+}
#endif
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/ScriptProfile.h (86946 => 86947)
--- trunk/Source/WebCore/bindings/js/ScriptProfile.h 2011-05-20 13:32:03 UTC (rev 86946)
+++ trunk/Source/WebCore/bindings/js/ScriptProfile.h 2011-05-20 13:46:03 UTC (rev 86947)
@@ -50,9 +50,11 @@
String title() const;
unsigned int uid() const;
ScriptProfileNode* head() const;
+ PassRefPtr<ScriptProfileNode> bottomUpHead() const;
#if ENABLE(INSPECTOR)
PassRefPtr<InspectorObject> buildInspectorObjectForHead() const;
+ PassRefPtr<InspectorObject> buildInspectorObjectForBottomUpHead() const;
#endif
private:
Modified: trunk/Source/WebCore/bindings/v8/ScriptProfile.cpp (86946 => 86947)
--- trunk/Source/WebCore/bindings/v8/ScriptProfile.cpp 2011-05-20 13:32:03 UTC (rev 86946)
+++ trunk/Source/WebCore/bindings/v8/ScriptProfile.cpp 2011-05-20 13:46:03 UTC (rev 86947)
@@ -60,6 +60,11 @@
return ScriptProfileNode::create(m_profile->GetTopDownRoot());
}
+PassRefPtr<ScriptProfileNode> ScriptProfile::bottomUpHead() const
+{
+ return ScriptProfileNode::create(m_profile->GetBottomUpRoot());
+}
+
static PassRefPtr<InspectorObject> buildInspectorObjectFor(const v8::CpuProfileNode* node)
{
v8::HandleScope handleScope;
@@ -88,4 +93,9 @@
return buildInspectorObjectFor(m_profile->GetTopDownRoot());
}
+PassRefPtr<InspectorObject> ScriptProfile::buildInspectorObjectForBottomUpHead() const
+{
+ return buildInspectorObjectFor(m_profile->GetBottomUpRoot());
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/v8/ScriptProfile.h (86946 => 86947)
--- trunk/Source/WebCore/bindings/v8/ScriptProfile.h 2011-05-20 13:32:03 UTC (rev 86946)
+++ trunk/Source/WebCore/bindings/v8/ScriptProfile.h 2011-05-20 13:46:03 UTC (rev 86947)
@@ -53,8 +53,10 @@
String title() const;
unsigned int uid() const;
PassRefPtr<ScriptProfileNode> head() const;
+ PassRefPtr<ScriptProfileNode> bottomUpHead() const;
PassRefPtr<InspectorObject> buildInspectorObjectForHead() const;
+ PassRefPtr<InspectorObject> buildInspectorObjectForBottomUpHead() const;
private:
ScriptProfile(const v8::CpuProfile* profile)
Modified: trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp (86946 => 86947)
--- trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp 2011-05-20 13:32:03 UTC (rev 86946)
+++ trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp 2011-05-20 13:46:03 UTC (rev 86947)
@@ -212,6 +212,8 @@
if (it != m_profiles.end()) {
*profileObject = createProfileHeader(*it->second);
(*profileObject)->setObject("head", it->second->buildInspectorObjectForHead());
+ if (it->second->bottomUpHead())
+ (*profileObject)->setObject("bottomUpHead", it->second->buildInspectorObjectForBottomUpHead());
}
} else if (type == HeapProfileType) {
HeapSnapshotsMap::iterator it = m_snapshots.find(uid);
Modified: trunk/Source/WebCore/inspector/front-end/ProfileView.js (86946 => 86947)
--- trunk/Source/WebCore/inspector/front-end/ProfileView.js 2011-05-20 13:32:03 UTC (rev 86946)
+++ trunk/Source/WebCore/inspector/front-end/ProfileView.js 2011-05-20 13:46:03 UTC (rev 86947)
@@ -117,8 +117,12 @@
get bottomUpProfileDataGridTree()
{
- if (!this._bottomUpProfileDataGridTree)
- this._bottomUpProfileDataGridTree = new WebInspector.BottomUpProfileDataGridTree(this, this.profile.head);
+ if (!this._bottomUpProfileDataGridTree) {
+ if (this.profile.bottomUpHead)
+ this._bottomUpProfileDataGridTree = new WebInspector.TopDownProfileDataGridTree(this, this.profile.bottomUpHead);
+ else
+ this._bottomUpProfileDataGridTree = new WebInspector.BottomUpProfileDataGridTree(this, this.profile.head);
+ }
return this._bottomUpProfileDataGridTree;
},
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes