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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 if (raw_obj->IsHeapObject()) { | 694 if (raw_obj->IsHeapObject()) { |
695 // Skip visits of FreeListElements. | 695 // Skip visits of FreeListElements. |
696 if (raw_obj->GetClassId() == kFreeListElement) { | 696 if (raw_obj->GetClassId() == kFreeListElement) { |
697 // Only the class of the free list element should ever be visited. | 697 // Only the class of the free list element should ever be visited. |
698 ASSERT(first == last); | 698 ASSERT(first == last); |
699 return; | 699 return; |
700 } | 700 } |
701 uword obj_addr = RawObject::ToAddr(raw_obj); | 701 uword obj_addr = RawObject::ToAddr(raw_obj); |
702 if (!Isolate::Current()->heap()->Contains(obj_addr) && | 702 if (!Isolate::Current()->heap()->Contains(obj_addr) && |
703 !Dart::vm_isolate()->heap()->Contains(obj_addr)) { | 703 !Dart::vm_isolate()->heap()->Contains(obj_addr)) { |
704 FATAL1("Invalid object pointer encountered 0x%lx\n", obj_addr); | 704 FATAL1("Invalid object pointer encountered %#"Px"\n", obj_addr); |
705 } | 705 } |
706 } | 706 } |
707 profiler_->WriteRoot(raw_obj); | 707 profiler_->WriteRoot(raw_obj); |
708 } | 708 } |
709 } | 709 } |
710 | 710 |
711 | 711 |
712 void HeapProfilerWeakRootVisitor::VisitHandle(uword addr) { | 712 void HeapProfilerWeakRootVisitor::VisitHandle(uword addr) { |
713 FinalizablePersistentHandle* handle = | 713 FinalizablePersistentHandle* handle = |
714 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 714 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
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 |