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

Side by Side Diff: runtime/vm/compiler_stats.cc

Issue 1850693004: Fix product run (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/compiler_stats.h" 5 #include "vm/compiler_stats.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/log.h" 8 #include "vm/log.h"
9 #include "vm/object_graph.h" 9 #include "vm/object_graph.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 #define INITIALIZE_COUNTERS(counter_name) \ 59 #define INITIALIZE_COUNTERS(counter_name) \
60 counter_name(0), 60 counter_name(0),
61 STAT_COUNTERS(INITIALIZE_COUNTERS) 61 STAT_COUNTERS(INITIALIZE_COUNTERS)
62 #undef INITIALIZE_COUNTERS 62 #undef INITIALIZE_COUNTERS
63 text(NULL), 63 text(NULL),
64 use_benchmark_output(false) { 64 use_benchmark_output(false) {
65 } 65 }
66 66
67 67
68 #ifndef PRODUCT
69
70
68 // Used to aggregate stats. Must be atomic. 71 // Used to aggregate stats. Must be atomic.
69 void CompilerStats::Add(const CompilerStats& other) { 72 void CompilerStats::Add(const CompilerStats& other) {
70 #define ADD_TOTAL(timer_name, literal) \ 73 #define ADD_TOTAL(timer_name, literal) \
71 timer_name.AddTotal(other.timer_name); 74 timer_name.AddTotal(other.timer_name);
72 75
73 STAT_TIMERS(ADD_TOTAL) 76 STAT_TIMERS(ADD_TOTAL)
74 #undef ADD_TOTAL 77 #undef ADD_TOTAL
75 78
76 #define ADD_COUNTER(counter_name) \ 79 #define ADD_COUNTER(counter_name) \
77 AtomicOperations::IncrementInt64By(&counter_name, other.counter_name); 80 AtomicOperations::IncrementInt64By(&counter_name, other.counter_name);
(...skipping 27 matching lines...) Expand all
105 108
106 #define CHECK_COUNTERS(counter_name) \ 109 #define CHECK_COUNTERS(counter_name) \
107 if (counter_name != 0) return false; 110 if (counter_name != 0) return false;
108 111
109 STAT_COUNTERS(CHECK_COUNTERS) 112 STAT_COUNTERS(CHECK_COUNTERS)
110 #undef CHECK_COUNTERS 113 #undef CHECK_COUNTERS
111 return true; 114 return true;
112 } 115 }
113 116
114 117
115 #ifndef PRODUCT
116
117
118 // This function is used as a callback in the log object to which the 118 // This function is used as a callback in the log object to which the
119 // compiler stats are printed. It will be called only once, to print 119 // compiler stats are printed. It will be called only once, to print
120 // the accumulated text when all of the compiler stats values are 120 // the accumulated text when all of the compiler stats values are
121 // added to the log. 121 // added to the log.
122 static void PrintToStats(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); 122 static void PrintToStats(const char* format, ...) PRINTF_ATTRIBUTE(1, 2);
123 static void PrintToStats(const char* format, ...) { 123 static void PrintToStats(const char* format, ...) {
124 Thread* thread = Thread::Current(); 124 Thread* thread = Thread::Current();
125 Isolate* isolate = thread->isolate(); 125 Isolate* isolate = thread->isolate();
126 CompilerStats* stats = isolate->aggregate_compiler_stats(); 126 CompilerStats* stats = isolate->aggregate_compiler_stats();
127 Zone* zone = thread->zone(); 127 Zone* zone = thread->zone();
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024); 308 log.Print(" VarDesc size: %" Pd64 " KB\n", vardesc_size / 1024);
309 log.Flush(); 309 log.Flush();
310 char* stats_text = text; 310 char* stats_text = text;
311 text = NULL; 311 text = NULL;
312 return stats_text; 312 return stats_text;
313 } 313 }
314 314
315 #endif // !PRODUCT 315 #endif // !PRODUCT
316 316
317 } // namespace dart 317 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698