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

Side by Side Diff: src/counters.h

Issue 1707563002: Split the TRACE_EVENTs from the LOG/HistogramTimers/TimerEvents functionality. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « src/compiler.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COUNTERS_H_ 5 #ifndef V8_COUNTERS_H_
6 #define V8_COUNTERS_H_ 6 #define V8_COUNTERS_H_
7 7
8 #include "include/v8.h" 8 #include "include/v8.h"
9 #include "src/allocation.h" 9 #include "src/allocation.h"
10 #include "src/base/platform/elapsed-timer.h" 10 #include "src/base/platform/elapsed-timer.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // Returns true if this histogram is enabled. 191 // Returns true if this histogram is enabled.
192 bool Enabled() { 192 bool Enabled() {
193 return GetHistogram() != NULL; 193 return GetHistogram() != NULL;
194 } 194 }
195 195
196 // Reset the cached internal pointer. 196 // Reset the cached internal pointer.
197 void Reset() { 197 void Reset() {
198 lookup_done_ = false; 198 lookup_done_ = false;
199 } 199 }
200 200
201 const char* name() { return name_; }
202
201 protected: 203 protected:
202 // Returns the handle to the histogram. 204 // Returns the handle to the histogram.
203 void* GetHistogram() { 205 void* GetHistogram() {
204 if (!lookup_done_) { 206 if (!lookup_done_) {
205 lookup_done_ = true; 207 lookup_done_ = true;
206 histogram_ = CreateHistogram(); 208 histogram_ = CreateHistogram();
207 } 209 }
208 return histogram_; 210 return histogram_;
209 } 211 }
210 212
211 const char* name() { return name_; }
212 Isolate* isolate() const { return isolate_; } 213 Isolate* isolate() const { return isolate_; }
213 214
214 private: 215 private:
215 void* CreateHistogram() const; 216 void* CreateHistogram() const;
216 217
217 const char* name_; 218 const char* name_;
218 int min_; 219 int min_;
219 int max_; 220 int max_;
220 int num_buckets_; 221 int num_buckets_;
221 void* histogram_; 222 void* histogram_;
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 917
917 explicit Counters(Isolate* isolate); 918 explicit Counters(Isolate* isolate);
918 919
919 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); 920 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters);
920 }; 921 };
921 922
922 } // namespace internal 923 } // namespace internal
923 } // namespace v8 924 } // namespace v8
924 925
925 #endif // V8_COUNTERS_H_ 926 #endif // V8_COUNTERS_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698