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

Side by Side Diff: src/counters.h

Issue 2349593004: Revert of [Tracing] Remove unnecessary memory allocation in runtime call stats. (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.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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 RuntimeCallStats() { 795 RuntimeCallStats() {
796 Reset(); 796 Reset();
797 in_use_ = false; 797 in_use_ = false;
798 } 798 }
799 799
800 RuntimeCallTimer* current_timer() { return current_timer_; } 800 RuntimeCallTimer* current_timer() { return current_timer_; }
801 bool InUse() { return in_use_; } 801 bool InUse() { return in_use_; }
802 802
803 private: 803 private:
804 std::stringstream buffer_; 804 std::stringstream buffer_;
805 std::unique_ptr<char[]> buffer_c_str_;
806 size_t len_ = 0;
805 // Counter to track recursive time events. 807 // Counter to track recursive time events.
806 RuntimeCallTimer* current_timer_ = NULL; 808 RuntimeCallTimer* current_timer_ = NULL;
807 // Used to track nested tracing scopes. 809 // Used to track nested tracing scopes.
808 bool in_use_; 810 bool in_use_;
809 }; 811 };
810 812
811 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ 813 #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \
812 do { \ 814 do { \
813 if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() || \ 815 if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() || \
814 FLAG_runtime_call_stats)) { \ 816 FLAG_runtime_call_stats)) { \
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 } 1265 }
1264 1266
1265 Isolate* isolate_ = nullptr; 1267 Isolate* isolate_ = nullptr;
1266 RuntimeCallTimer timer_; 1268 RuntimeCallTimer timer_;
1267 }; 1269 };
1268 1270
1269 } // namespace internal 1271 } // namespace internal
1270 } // namespace v8 1272 } // namespace v8
1271 1273
1272 #endif // V8_COUNTERS_H_ 1274 #endif // V8_COUNTERS_H_
OLDNEW
« no previous file with comments | « no previous file | src/counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698