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

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

Issue 1124153006: Heap snapshot visualizations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 5 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object_graph.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 "vm/object_graph.h" 5 #include "vm/object_graph.h"
6 6
7 #include "vm/dart.h" 7 #include "vm/dart.h"
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 intptr_t count() const { return count_; } 440 intptr_t count() const { return count_; }
441 441
442 private: 442 private:
443 WriteStream* stream_; 443 WriteStream* stream_;
444 WritePointerVisitor ptr_writer_; 444 WritePointerVisitor ptr_writer_;
445 intptr_t count_; 445 intptr_t count_;
446 }; 446 };
447 447
448 448
449 void ObjectGraph::Serialize(WriteStream* stream) { 449 intptr_t ObjectGraph::Serialize(WriteStream* stream) {
450 // Current encoding assumes objects do not move, so promote everything to old. 450 // Current encoding assumes objects do not move, so promote everything to old.
451 isolate()->heap()->new_space()->Evacuate(); 451 isolate()->heap()->new_space()->Evacuate();
452 WriteGraphVisitor visitor(isolate(), stream); 452 WriteGraphVisitor visitor(isolate(), stream);
453 stream->WriteUnsigned(kObjectAlignment);
453 stream->WriteUnsigned(0); 454 stream->WriteUnsigned(0);
454 stream->WriteUnsigned(0); 455 stream->WriteUnsigned(0);
455 stream->WriteUnsigned(0); 456 stream->WriteUnsigned(0);
456 { 457 {
457 WritePointerVisitor ptr_writer(isolate(), stream); 458 WritePointerVisitor ptr_writer(isolate(), stream);
458 isolate()->VisitObjectPointers(&ptr_writer, false, false); 459 isolate()->VisitObjectPointers(&ptr_writer, false, false);
459 } 460 }
460 stream->WriteUnsigned(0); 461 stream->WriteUnsigned(0);
461 IterateObjects(&visitor); 462 IterateObjects(&visitor);
463 return visitor.count() + 1; // + root
462 } 464 }
463 465
464 } // namespace dart 466 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_graph.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698