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

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

Issue 10869063: Add attributions so printf like functions can have their arguments checked. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 years, 3 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/heap.cc ('k') | runtime/vm/il_printer.h » ('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) 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
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
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/il_printer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698