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

Side by Side Diff: runtime/vm/json_stream.cc

Issue 173013004: Add accumulator to allocation profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 #include "vm/json_stream.h" 9 #include "vm/json_stream.h"
10 #include "vm/message.h" 10 #include "vm/message.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 buffer_.Printf("%s", b ? "true" : "false"); 175 buffer_.Printf("%s", b ? "true" : "false");
176 } 176 }
177 177
178 178
179 void JSONStream::PrintValue(intptr_t i) { 179 void JSONStream::PrintValue(intptr_t i) {
180 PrintCommaIfNeeded(); 180 PrintCommaIfNeeded();
181 buffer_.Printf("%" Pd "", i); 181 buffer_.Printf("%" Pd "", i);
182 } 182 }
183 183
184 184
185 void JSONStream::PrintValue64(int64_t i) {
186 PrintCommaIfNeeded();
187 buffer_.Printf("%" Pd64 "", i);
188 }
189
190
185 void JSONStream::PrintValue(double d) { 191 void JSONStream::PrintValue(double d) {
186 PrintCommaIfNeeded(); 192 PrintCommaIfNeeded();
187 buffer_.Printf("%f", d); 193 buffer_.Printf("%f", d);
188 } 194 }
189 195
190 196
191 void JSONStream::PrintValue(const char* s) { 197 void JSONStream::PrintValue(const char* s) {
192 PrintCommaIfNeeded(); 198 PrintCommaIfNeeded();
193 buffer_.AddChar('"'); 199 buffer_.AddChar('"');
194 buffer_.AddEscapedString(s); 200 buffer_.AddEscapedString(s);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 PrintValueBool(b); 238 PrintValueBool(b);
233 } 239 }
234 240
235 241
236 void JSONStream::PrintProperty(const char* name, intptr_t i) { 242 void JSONStream::PrintProperty(const char* name, intptr_t i) {
237 PrintPropertyName(name); 243 PrintPropertyName(name);
238 PrintValue(i); 244 PrintValue(i);
239 } 245 }
240 246
241 247
248 void JSONStream::PrintProperty64(const char* name, int64_t i) {
249 PrintPropertyName(name);
250 PrintValue64(i);
251 }
252
253
242 void JSONStream::PrintProperty(const char* name, double d) { 254 void JSONStream::PrintProperty(const char* name, double d) {
243 PrintPropertyName(name); 255 PrintPropertyName(name);
244 PrintValue(d); 256 PrintValue(d);
245 } 257 }
246 258
247 259
248 void JSONStream::PrintProperty(const char* name, const char* s) { 260 void JSONStream::PrintProperty(const char* name, const char* s) {
249 PrintPropertyName(name); 261 PrintPropertyName(name);
250 PrintValue(s); 262 PrintValue(s);
251 } 263 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 370 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
359 va_end(args); 371 va_end(args);
360 ASSERT(len == len2); 372 ASSERT(len == len2);
361 stream_->buffer_.AddChar('"'); 373 stream_->buffer_.AddChar('"');
362 stream_->buffer_.AddEscapedString(p); 374 stream_->buffer_.AddEscapedString(p);
363 stream_->buffer_.AddChar('"'); 375 stream_->buffer_.AddChar('"');
364 free(p); 376 free(p);
365 } 377 }
366 378
367 } // namespace dart 379 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698