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

Side by Side Diff: src/log.cc

Issue 3845006: Try to simplify the semantics of the profiling code by making... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/platform.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // Ticker used to provide ticks to the profiler and the sliding state 184 // Ticker used to provide ticks to the profiler and the sliding state
185 // window. 185 // window.
186 // 186 //
187 class Ticker: public Sampler { 187 class Ticker: public Sampler {
188 public: 188 public:
189 explicit Ticker(int interval): 189 explicit Ticker(int interval):
190 Sampler(interval, FLAG_prof), window_(NULL), profiler_(NULL) {} 190 Sampler(interval, FLAG_prof), window_(NULL), profiler_(NULL) {}
191 191
192 ~Ticker() { if (IsActive()) Stop(); } 192 ~Ticker() { if (IsActive()) Stop(); }
193 193
194 void SampleStack(TickSample* sample) { 194 virtual void SampleStack(TickSample* sample) {
195 ASSERT(IsSynchronous());
195 StackTracer::Trace(sample); 196 StackTracer::Trace(sample);
196 } 197 }
197 198
198 void Tick(TickSample* sample) { 199 virtual void Tick(TickSample* sample) {
199 if (profiler_) profiler_->Insert(sample); 200 if (profiler_) profiler_->Insert(sample);
200 if (window_) window_->AddState(sample->state); 201 if (window_) window_->AddState(sample->state);
201 } 202 }
202 203
203 void SetWindow(SlidingStateWindow* window) { 204 void SetWindow(SlidingStateWindow* window) {
204 window_ = window; 205 window_ = window;
205 if (!IsActive()) Start(); 206 if (!IsActive()) Start();
206 } 207 }
207 208
208 void ClearWindow() { 209 void ClearWindow() {
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 } 1588 }
1588 // Otherwise, if the sliding state window computation has not been 1589 // Otherwise, if the sliding state window computation has not been
1589 // started we do it now. 1590 // started we do it now.
1590 if (sliding_state_window_ == NULL) { 1591 if (sliding_state_window_ == NULL) {
1591 sliding_state_window_ = new SlidingStateWindow(); 1592 sliding_state_window_ = new SlidingStateWindow();
1592 } 1593 }
1593 #endif 1594 #endif
1594 } 1595 }
1595 1596
1596 } } // namespace v8::internal 1597 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698