Revision: 16116
Author: [email protected]
Date: Thu Aug 8 06:39:57 2013
Log: Deprecate self and total time getters and total sample count
getter on CpuProfileNode
All of these values are derived from the self samples count and there is no
need to evaluate them in v8 when clients can do that when needed on their
side.
Also added unsigned GetHitCount() which should be used instead of double
GetSelfSamplesCount(). I'm going to deprecate the latter one once Blink has
switched to GetHitCount.
BUG=267595
[email protected], [email protected]
Review URL: https://codereview.chromium.org/22347003
http://code.google.com/p/v8/source/detail?r=16116
Modified:
/branches/bleeding_edge/include/v8-profiler.h
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/profile-generator.cc
/branches/bleeding_edge/test/cctest/test-cpu-profiler.cc
=======================================
--- /branches/bleeding_edge/include/v8-profiler.h Wed Aug 7 10:04:27 2013
+++ /branches/bleeding_edge/include/v8-profiler.h Thu Aug 8 06:39:57 2013
@@ -61,20 +61,27 @@
* Returns total (self + children) execution time of the function,
* in milliseconds, estimated by samples count.
*/
- double GetTotalTime() const;
+ V8_DEPRECATED(double GetTotalTime() const);
/**
* Returns self execution time of the function, in milliseconds,
* estimated by samples count.
*/
- double GetSelfTime() const;
+ V8_DEPRECATED(double GetSelfTime() const);
/** Returns the count of samples where function exists. */
- double GetTotalSamplesCount() const;
+ V8_DEPRECATED(double GetTotalSamplesCount() const);
- /** Returns the count of samples where function was currently executing.
*/
+ /** DEPRECATED. Please use GetHitCount instead.
+ * Returns the count of samples where function was currently executing.
+ */
double GetSelfSamplesCount() const;
+ /**
+ * Returns the count of samples where the function was currently
executing.
+ */
+ unsigned GetHitCount() const;
+
/** Returns function entry UID. */
unsigned GetCallUid() const;
=======================================
--- /branches/bleeding_edge/src/api.cc Wed Aug 7 10:04:27 2013
+++ /branches/bleeding_edge/src/api.cc Thu Aug 8 06:39:57 2013
@@ -7477,8 +7477,6 @@
int CpuProfileNode::GetScriptId() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptId");
const i::ProfileNode* node = reinterpret_cast<const
i::ProfileNode*>(this);
const i::CodeEntry* entry = node->entry();
return entry->script_id();
@@ -7495,8 +7493,6 @@
int CpuProfileNode::GetLineNumber() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfileNode::GetLineNumber");
return reinterpret_cast<const
i::ProfileNode*>(this)->entry()->line_number();
}
@@ -7527,11 +7523,14 @@
IsDeadCheck(isolate, "v8::CpuProfileNode::GetSelfSamplesCount");
return reinterpret_cast<const i::ProfileNode*>(this)->self_ticks();
}
+
+
+unsigned CpuProfileNode::GetHitCount() const {
+ return reinterpret_cast<const i::ProfileNode*>(this)->self_ticks();
+}
unsigned CpuProfileNode::GetCallUid() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfileNode::GetCallUid");
return reinterpret_cast<const
i::ProfileNode*>(this)->entry()->GetCallUid();
}
@@ -7542,15 +7541,11 @@
int CpuProfileNode::GetChildrenCount() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfileNode::GetChildrenCount");
return reinterpret_cast<const
i::ProfileNode*>(this)->children()->length();
}
const CpuProfileNode* CpuProfileNode::GetChild(int index) const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfileNode::GetChild");
const i::ProfileNode* child =
reinterpret_cast<const i::ProfileNode*>(this)->children()->at(index);
return reinterpret_cast<const CpuProfileNode*>(child);
@@ -7571,8 +7566,6 @@
unsigned CpuProfile::GetUid() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfile::GetUid");
return reinterpret_cast<const i::CpuProfile*>(this)->uid();
}
@@ -7587,8 +7580,6 @@
const CpuProfileNode* CpuProfile::GetTopDownRoot() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfile::GetTopDownRoot");
const i::CpuProfile* profile = reinterpret_cast<const
i::CpuProfile*>(this);
return reinterpret_cast<const
CpuProfileNode*>(profile->top_down()->root());
}
=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Wed Aug 7 10:04:27
2013
+++ /branches/bleeding_edge/src/profile-generator.cc Thu Aug 8 06:39:57
2013
@@ -220,7 +220,7 @@
void ProfileNode::Print(int indent) {
- OS::Print("%5u %5u %*c %s%s #%d %d",
+ OS::Print("%5u %5u %*c %s%s %d #%d",
total_ticks_, self_ticks_,
indent, ' ',
entry_->name_prefix(),
=======================================
--- /branches/bleeding_edge/test/cctest/test-cpu-profiler.cc Wed Aug 7
10:04:27 2013
+++ /branches/bleeding_edge/test/cctest/test-cpu-profiler.cc Thu Aug 8
06:39:57 2013
@@ -1369,11 +1369,13 @@
GetChild(root, ProfileGenerator::kProgramEntryName);
CHECK_EQ(0, programNode->GetChildrenCount());
CHECK_GE(programNode->GetSelfSamplesCount(), 3);
+ CHECK_GE(programNode->GetHitCount(), 3);
const v8::CpuProfileNode* idleNode =
GetChild(root, ProfileGenerator::kIdleEntryName);
CHECK_EQ(0, idleNode->GetChildrenCount());
CHECK_GE(idleNode->GetSelfSamplesCount(), 3);
+ CHECK_GE(idleNode->GetHitCount(), 3);
cpu_profiler->DeleteAllCpuProfiles();
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.