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

Side by Side Diff: src/tracing/traced-value.cc

Issue 2418303002: Use TracedValue in runtime statistics. (Closed)
Patch Set: rebase Created 4 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
« no previous file with comments | « src/tracing/traced-value.h ('k') | 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/tracing/traced-value.h" 5 #include "src/tracing/traced-value.h"
6 6
7 #include "src/base/platform/platform.h" 7 #include "src/base/platform/platform.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace tracing { 10 namespace tracing {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 data_ += '['; 114 data_ += '[';
115 first_item_ = true; 115 first_item_ = true;
116 } 116 }
117 117
118 void TracedValue::AppendInteger(int value) { 118 void TracedValue::AppendInteger(int value) {
119 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); 119 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray);
120 WriteComma(); 120 WriteComma();
121 data_ += std::to_string(value); 121 data_ += std::to_string(value);
122 } 122 }
123 123
124 void TracedValue::AppendLongInteger(int64_t value) {
125 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray);
126 WriteComma();
127 data_ += std::to_string(value);
128 }
129
124 void TracedValue::AppendDouble(double value) { 130 void TracedValue::AppendDouble(double value) {
125 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); 131 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray);
126 WriteComma(); 132 WriteComma();
127 data_ += std::to_string(value); 133 data_ += std::to_string(value);
128 } 134 }
129 135
130 void TracedValue::AppendBoolean(bool value) { 136 void TracedValue::AppendBoolean(bool value) {
131 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); 137 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray);
132 WriteComma(); 138 WriteComma();
133 data_ += value ? "true" : "false"; 139 data_ += value ? "true" : "false";
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 191 }
186 192
187 void TracedValue::AppendAsTraceFormat(std::string* out) const { 193 void TracedValue::AppendAsTraceFormat(std::string* out) const {
188 *out += '{'; 194 *out += '{';
189 *out += data_; 195 *out += data_;
190 *out += '}'; 196 *out += '}';
191 } 197 }
192 198
193 } // namespace tracing 199 } // namespace tracing
194 } // namespace v8 200 } // namespace v8
OLDNEW
« no previous file with comments | « src/tracing/traced-value.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698