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

Side by Side Diff: src/counters.cc

Issue 1826833002: Reland of [counters] adding runtime call timers for GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/counters.h ('k') | src/heap/gc-tracer.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 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 #include "src/counters.h" 5 #include "src/counters.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 #define PRINT_COUNTER(name, nargs, ressize) entries.Add(&this->Runtime_##name); 299 #define PRINT_COUNTER(name, nargs, ressize) entries.Add(&this->Runtime_##name);
300 FOR_EACH_INTRINSIC(PRINT_COUNTER) 300 FOR_EACH_INTRINSIC(PRINT_COUNTER)
301 #undef PRINT_COUNTER 301 #undef PRINT_COUNTER
302 302
303 #define PRINT_COUNTER(name, type) entries.Add(&this->Builtin_##name); 303 #define PRINT_COUNTER(name, type) entries.Add(&this->Builtin_##name);
304 BUILTIN_LIST_C(PRINT_COUNTER) 304 BUILTIN_LIST_C(PRINT_COUNTER)
305 #undef PRINT_COUNTER 305 #undef PRINT_COUNTER
306 306
307 entries.Add(&this->ExternalCallback); 307 entries.Add(&this->ExternalCallback);
308 entries.Add(&this->GC);
308 entries.Add(&this->UnexpectedStubMiss); 309 entries.Add(&this->UnexpectedStubMiss);
309 310
310 entries.Print(os); 311 entries.Print(os);
311 } 312 }
312 313
313 void RuntimeCallStats::Reset() { 314 void RuntimeCallStats::Reset() {
314 if (!FLAG_runtime_call_stats) return; 315 if (!FLAG_runtime_call_stats) return;
315 #define RESET_COUNTER(name, nargs, ressize) this->Runtime_##name.Reset(); 316 #define RESET_COUNTER(name, nargs, ressize) this->Runtime_##name.Reset();
316 FOR_EACH_INTRINSIC(RESET_COUNTER) 317 FOR_EACH_INTRINSIC(RESET_COUNTER)
317 #undef RESET_COUNTER 318 #undef RESET_COUNTER
318 #define RESET_COUNTER(name, type) this->Builtin_##name.Reset(); 319 #define RESET_COUNTER(name, type) this->Builtin_##name.Reset();
319 BUILTIN_LIST_C(RESET_COUNTER) 320 BUILTIN_LIST_C(RESET_COUNTER)
320 #undef RESET_COUNTER 321 #undef RESET_COUNTER
321 this->ExternalCallback.Reset(); 322 this->ExternalCallback.Reset();
323 this->GC.Reset();
322 this->UnexpectedStubMiss.Reset(); 324 this->UnexpectedStubMiss.Reset();
323 } 325 }
324 326
325 void RuntimeCallTimerScope::Enter(Isolate* isolate, 327 void RuntimeCallTimerScope::Enter(Isolate* isolate,
326 RuntimeCallCounter* counter) { 328 RuntimeCallCounter* counter) {
327 isolate_ = isolate; 329 isolate_ = isolate;
328 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); 330 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats();
329 timer_.Initialize(counter, stats->current_timer()); 331 timer_.Initialize(counter, stats->current_timer());
330 stats->Enter(&timer_); 332 stats->Enter(&timer_);
331 } 333 }
332 334
333 void RuntimeCallTimerScope::Leave() { 335 void RuntimeCallTimerScope::Leave() {
334 isolate_->counters()->runtime_call_stats()->Leave(&timer_); 336 isolate_->counters()->runtime_call_stats()->Leave(&timer_);
335 } 337 }
336 338
337 } // namespace internal 339 } // namespace internal
338 } // namespace v8 340 } // namespace v8
OLDNEW
« no previous file with comments | « src/counters.h ('k') | src/heap/gc-tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698