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

Side by Side Diff: src/counters.h

Issue 2329053002: Add delegating initialize method for RuntimeCallTimerScope. (Closed)
Patch Set: Created 4 years, 3 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 | src/counters-inl.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 #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 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 RuntimeCallStats::CounterId counter_id); 1250 RuntimeCallStats::CounterId counter_id);
1251 1251
1252 inline ~RuntimeCallTimerScope() { 1252 inline ~RuntimeCallTimerScope() {
1253 if (V8_UNLIKELY(isolate_ != nullptr)) { 1253 if (V8_UNLIKELY(isolate_ != nullptr)) {
1254 RuntimeCallStats::Leave(isolate_->counters()->runtime_call_stats(), 1254 RuntimeCallStats::Leave(isolate_->counters()->runtime_call_stats(),
1255 &timer_); 1255 &timer_);
1256 } 1256 }
1257 } 1257 }
1258 1258
1259 private: 1259 private:
1260 V8_INLINE void Initialize(Isolate* isolate,
1261 RuntimeCallStats::CounterId counter_id) {
1262 isolate_ = isolate;
1263 RuntimeCallStats::Enter(isolate_->counters()->runtime_call_stats(), &timer_,
1264 counter_id);
1265 }
1266
1260 Isolate* isolate_ = nullptr; 1267 Isolate* isolate_ = nullptr;
1261 RuntimeCallTimer timer_; 1268 RuntimeCallTimer timer_;
1262 }; 1269 };
1263 1270
1264 } // namespace internal 1271 } // namespace internal
1265 } // namespace v8 1272 } // namespace v8
1266 1273
1267 #endif // V8_COUNTERS_H_ 1274 #endif // V8_COUNTERS_H_
OLDNEW
« no previous file with comments | « no previous file | src/counters-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698