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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // Header | 298 // Header |
299 // | 299 // |
300 // Format: | 300 // Format: |
301 // [u1]* - format name | 301 // [u1]* - format name |
302 // u4 - size of identifiers | 302 // u4 - size of identifiers |
303 // u4 - high word of number of milliseconds since 0:00 GMT, 1/1/70 | 303 // u4 - high word of number of milliseconds since 0:00 GMT, 1/1/70 |
304 // u4 - low word of number of milliseconds since 0:00 GMT, 1/1/70 | 304 // u4 - low word of number of milliseconds since 0:00 GMT, 1/1/70 |
305 void HeapProfiler::WriteHeader() { | 305 void HeapProfiler::WriteHeader() { |
306 const char magic[] = "JAVA PROFILE 1.0.1"; | 306 const char magic[] = "JAVA PROFILE 1.0.1"; |
307 Write(magic, sizeof(magic)); | 307 Write(magic, sizeof(magic)); |
308 uint32_t size = htonl(8); | 308 uint32_t size = htonl(kObjectIdSize); |
309 Write(&size, sizeof(size)); | 309 Write(&size, sizeof(size)); |
310 uint64_t milliseconds = OS::GetCurrentTimeMillis(); | 310 uint64_t milliseconds = OS::GetCurrentTimeMillis(); |
311 uint32_t hi = htonl((uint32_t)((milliseconds >> 32) & 0x00000000FFFFFFFF)); | 311 uint32_t hi = htonl((uint32_t)((milliseconds >> 32) & 0x00000000FFFFFFFF)); |
312 Write(&hi, sizeof(hi)); | 312 Write(&hi, sizeof(hi)); |
313 uint32_t lo = htonl((uint32_t)(milliseconds & 0x00000000FFFFFFFF)); | 313 uint32_t lo = htonl((uint32_t)(milliseconds & 0x00000000FFFFFFFF)); |
314 Write(&lo, sizeof(lo)); | 314 Write(&lo, sizeof(lo)); |
315 } | 315 } |
316 | 316 |
317 | 317 |
318 // Record | 318 // Record |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 RawObject* raw_obj = handle->raw(); | 715 RawObject* raw_obj = handle->raw(); |
716 visitor_->VisitPointer(&raw_obj); | 716 visitor_->VisitPointer(&raw_obj); |
717 } | 717 } |
718 | 718 |
719 | 719 |
720 void HeapProfilerObjectVisitor::VisitObject(RawObject* raw_obj) { | 720 void HeapProfilerObjectVisitor::VisitObject(RawObject* raw_obj) { |
721 profiler_->WriteObject(raw_obj); | 721 profiler_->WriteObject(raw_obj); |
722 } | 722 } |
723 | 723 |
724 } // namespace dart | 724 } // namespace dart |
OLD | NEW |