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

Unified Diff: src/profile-generator-inl.h

Issue 1523015: C++ profiles processor: align browser mode with the old implementation, sample VM state. (Closed)
Patch Set: Using Script::type to filter out native scripts. Created 10 years, 8 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 | « src/profile-generator.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator-inl.h
diff --git a/src/profile-generator-inl.h b/src/profile-generator-inl.h
index 5739ca76612f4784201985baa2bb97d2294ce929..b4fdfb7d78ea3e0e0ec3e9c8be11458207dbba44 100644
--- a/src/profile-generator-inl.h
+++ b/src/profile-generator-inl.h
@@ -49,10 +49,13 @@ CodeEntry::CodeEntry(Logger::LogEventsAndTags tag,
}
-bool CodeEntry::is_js_function() const {
- return tag_ == Logger::FUNCTION_TAG
- || tag_ == Logger::LAZY_COMPILE_TAG
- || tag_ == Logger::SCRIPT_TAG;
+bool CodeEntry::is_js_function_tag(Logger::LogEventsAndTags tag) {
+ return tag == Logger::FUNCTION_TAG
+ || tag == Logger::LAZY_COMPILE_TAG
+ || tag == Logger::SCRIPT_TAG
+ || tag == Logger::NATIVE_FUNCTION_TAG
+ || tag == Logger::NATIVE_LAZY_COMPILE_TAG
+ || tag == Logger::NATIVE_SCRIPT_TAG;
}
@@ -86,6 +89,33 @@ bool CpuProfilesCollection::is_last_profile() {
return current_profiles_.length() == 1;
}
+
+const char* CpuProfilesCollection::GetFunctionName(String* name) {
+ return GetFunctionName(GetName(name));
+}
+
+
+const char* CpuProfilesCollection::GetFunctionName(const char* name) {
+ return strlen(name) > 0 ? name : ProfileGenerator::kAnonymousFunctionName;
+}
+
+
+CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
+ switch (tag) {
+ case GC:
+ return gc_entry_;
+ case JS:
+ case COMPILER:
+ // DOM events handlers are reported as OTHER / EXTERNAL entries.
+ // To avoid confusing people, let's put all these entries into
+ // one bucket.
+ case OTHER:
+ case EXTERNAL:
+ return program_entry_;
+ default: return NULL;
+ }
+}
+
} } // namespace v8::internal
#endif // ENABLE_CPP_PROFILES_PROCESSOR
« no previous file with comments | « src/profile-generator.cc ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698