Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: runtime/vm/profiler_service.cc

Issue 1259243005: Add unit test for CPU profile inline function expansion (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/profiler_service.h ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index fc6acf98a5cc65483d4cd8373e4b944a639d8eab..0e38cbebb8979c63fa12f5360ab89fc056369707 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -1294,6 +1294,8 @@ class ProfileBuilder : public ValueObject {
const uword pc = sample->At(frame_index);
ProfileCode* profile_code = GetProfileCode(pc,
sample->timestamp());
+ ProfileFunction* function = profile_code->function();
+ ASSERT(function != NULL);
const intptr_t code_index = profile_code->code_table_index();
ASSERT(profile_code != NULL);
const Code& code = Code::ZoneHandle(profile_code->code());
@@ -1304,8 +1306,6 @@ class ProfileBuilder : public ValueObject {
}
if (code.IsNull() || (inlined_functions.length() == 0)) {
// No inlined functions.
- ProfileFunction* function = profile_code->function();
- ASSERT(function != NULL);
current = ProcessFunction(current,
sample_index,
sample,
@@ -1316,6 +1316,14 @@ class ProfileBuilder : public ValueObject {
}
if (inclusive_tree_) {
+ // Append the inliner.
+ current = ProcessFunction(current,
+ sample_index,
+ sample,
+ frame_index + inlined_functions.length(),
+ function,
+ code_index);
+ // Append the inlined children.
for (intptr_t i = inlined_functions.length() - 1; i >= 0; i--) {
Function* inlined_function = inlined_functions[i];
ASSERT(inlined_function != NULL);
@@ -1328,6 +1336,7 @@ class ProfileBuilder : public ValueObject {
code_index);
}
} else {
+ // Append the inlined children.
for (intptr_t i = 0; i < inlined_functions.length(); i++) {
Function* inlined_function = inlined_functions[i];
ASSERT(inlined_function != NULL);
@@ -1339,6 +1348,13 @@ class ProfileBuilder : public ValueObject {
inlined_function,
code_index);
}
+ // Append the inliner.
+ current = ProcessFunction(current,
+ sample_index,
+ sample,
+ frame_index + inlined_functions.length(),
+ function,
+ code_index);
}
return current;
@@ -2008,6 +2024,12 @@ bool ProfileTrieWalker::NextSibling() {
}
+intptr_t ProfileTrieWalker::SiblingCount() {
+ ASSERT(parent_ != NULL);
+ return parent_->NumChildren();
+}
+
+
void ProfilerService::PrintJSONImpl(Isolate* isolate,
JSONStream* stream,
Profile::TagOrder tag_order,
« no previous file with comments | « runtime/vm/profiler_service.h ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698