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

Unified Diff: runtime/vm/snapshot.cc

Issue 2584613002: PATCH (not to be comitted): Support for printing instruction statistics
Patch Set: Fixed polymorphic call inside try, added more tags for remaining unknown code Created 4 years 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/snapshot.h ('k') | runtime/vm/stub_code.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index b7a1b83c5e8e6aa1d04e29462b6fd0e7ea240616..22a61b29d4c4b51707eab5f5d86655cffe8d83ab 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -20,6 +20,7 @@
#include "vm/symbols.h"
#include "vm/timeline.h"
#include "vm/version.h"
+#include "vm/code_statistics.h"
// We currently only expect the Dart mutator to read snapshots.
#define ASSERT_NO_SAFEPOINT_SCOPE() \
@@ -708,6 +709,35 @@ int32_t InstructionsWriter::GetObjectOffsetFor(RawObject* raw_object) {
}
+void InstructionsWriter::DumpCombinedCodeStatistics() const {
+ CombinedCodeStatistics instruction_stats;
+ intptr_t count = instructions_.length();
+ intptr_t missing_count = 0;
+ for (intptr_t i = 0; i < count; i++) {
+ const Code &code = *instructions_[i].code_;
+ CodeStatistics* stats = code.stats();
+ if (stats != NULL) {
+ stats->AppendTo(&instruction_stats);
+ } else {
+ missing_count++;
+ }
+ }
+ instruction_stats.DumpStatistics();
+ if (missing_count > 0) {
+ fprintf(stderr, "--------------------\n");
+ fprintf(
+ stderr,
+ "Missed statistics for %" Pd " out of %" Pd " functions\n",
+ missing_count, count);
+ fprintf(stderr, "--------------------\n");
+ }
+
+ fprintf(stderr, "--------------------\n");
+ fprintf(stderr, "Emitted %" Pd " functions\n", count);
+ fprintf(stderr, "--------------------\n");
+}
+
+
static void EnsureIdentifier(char* label) {
for (char c = *label; c != '\0'; c = *++label) {
if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) ||
« no previous file with comments | « runtime/vm/snapshot.h ('k') | runtime/vm/stub_code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698