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

Side by Side Diff: src/counters.h

Issue 1955943002: Fix bug with runtime-call-stats timers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 parent_ = parent; 498 parent_ = parent;
499 } 499 }
500 500
501 inline void Start() { 501 inline void Start() {
502 timer_.Start(); 502 timer_.Start();
503 counter_->count++; 503 counter_->count++;
504 } 504 }
505 505
506 inline RuntimeCallTimer* Stop() { 506 inline RuntimeCallTimer* Stop() {
507 base::TimeDelta delta = timer_.Elapsed(); 507 base::TimeDelta delta = timer_.Elapsed();
508 timer_.Stop();
508 counter_->time += delta; 509 counter_->time += delta;
509 if (parent_ != NULL) { 510 if (parent_ != NULL) {
510 parent_->AdjustForSubTimer(delta); 511 parent_->AdjustForSubTimer(delta);
511 } 512 }
512 return parent_; 513 return parent_;
513 } 514 }
514 515
515 inline void AdjustForSubTimer(base::TimeDelta delta) { 516 inline void AdjustForSubTimer(base::TimeDelta delta) {
516 counter_->time -= delta; 517 counter_->time -= delta;
517 } 518 }
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 990
990 explicit Counters(Isolate* isolate); 991 explicit Counters(Isolate* isolate);
991 992
992 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); 993 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters);
993 }; 994 };
994 995
995 } // namespace internal 996 } // namespace internal
996 } // namespace v8 997 } // namespace v8
997 998
998 #endif // V8_COUNTERS_H_ 999 #endif // V8_COUNTERS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698