OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/heap_profiler.h" | 5 #include "vm/heap_profiler.h" |
6 | 6 |
7 #include "vm/dart_api_state.h" | 7 #include "vm/dart_api_state.h" |
8 #include "vm/object.h" | 8 #include "vm/object.h" |
9 #include "vm/raw_object.h" | 9 #include "vm/raw_object.h" |
10 #include "vm/stack_frame.h" | 10 #include "vm/stack_frame.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void HeapProfiler::SubRecord::Write64(uint64_t value) { | 106 void HeapProfiler::SubRecord::Write64(uint64_t value) { |
107 record_->Write64(value); | 107 record_->Write64(value); |
108 } | 108 } |
109 | 109 |
110 | 110 |
111 void HeapProfiler::SubRecord::WritePointer(const void* value) { | 111 void HeapProfiler::SubRecord::WritePointer(const void* value) { |
112 record_->WritePointer(value); | 112 record_->WritePointer(value); |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 HeapProfiler::HeapProfiler(Dart_HeapProfileWriteCallback callback, void* stream) | 116 HeapProfiler::HeapProfiler(Dart_FileWriteCallback callback, void* stream) |
117 : write_callback_(callback), | 117 : write_callback_(callback), |
118 output_stream_(stream), | 118 output_stream_(stream), |
119 heap_dump_record_(NULL) { | 119 heap_dump_record_(NULL) { |
120 WriteHeader(); | 120 WriteHeader(); |
121 WriteStackTrace(); | 121 WriteStackTrace(); |
122 heap_dump_record_ = new Record(kHeapDump, this); | 122 heap_dump_record_ = new Record(kHeapDump, this); |
123 } | 123 } |
124 | 124 |
125 | 125 |
126 HeapProfiler::~HeapProfiler() { | 126 HeapProfiler::~HeapProfiler() { |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 RawObject* raw_obj = handle->raw(); | 702 RawObject* raw_obj = handle->raw(); |
703 visitor_->VisitPointer(&raw_obj); | 703 visitor_->VisitPointer(&raw_obj); |
704 } | 704 } |
705 | 705 |
706 | 706 |
707 void HeapProfilerObjectVisitor::VisitObject(RawObject* raw_obj) { | 707 void HeapProfilerObjectVisitor::VisitObject(RawObject* raw_obj) { |
708 profiler_->WriteObject(raw_obj); | 708 profiler_->WriteObject(raw_obj); |
709 } | 709 } |
710 | 710 |
711 } // namespace dart | 711 } // namespace dart |
OLD | NEW |