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/verifier.h" | 5 #include "vm/verifier.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
9 #include "vm/dart_api_state.h" | 9 #include "vm/dart_api_state.h" |
10 #include "vm/freelist.h" | 10 #include "vm/freelist.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 } | 42 } |
43 } | 43 } |
44 allocated_set_->Add(raw_obj); | 44 allocated_set_->Add(raw_obj); |
45 raw_obj->Validate(isolate_); | 45 raw_obj->Validate(isolate_); |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) { | 49 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) { |
50 for (RawObject** current = first; current <= last; current++) { | 50 for (RawObject** current = first; current <= last; current++) { |
51 VerifiedMemory::Verify(reinterpret_cast<uword>(current), kWordSize); | |
52 RawObject* raw_obj = *current; | 51 RawObject* raw_obj = *current; |
53 if (raw_obj->IsHeapObject()) { | 52 if (raw_obj->IsHeapObject()) { |
54 if (!allocated_set_->Contains(raw_obj)) { | 53 if (!allocated_set_->Contains(raw_obj)) { |
55 uword raw_addr = RawObject::ToAddr(raw_obj); | 54 uword raw_addr = RawObject::ToAddr(raw_obj); |
56 FATAL1("Invalid object pointer encountered %#" Px "\n", raw_addr); | 55 FATAL1("Invalid object pointer encountered %#" Px "\n", raw_addr); |
57 } | 56 } |
58 } | 57 } |
59 } | 58 } |
60 } | 59 } |
61 | 60 |
(...skipping 15 matching lines...) Expand all Loading... |
77 // Visit all strongly reachable objects. | 76 // Visit all strongly reachable objects. |
78 isolate->IterateObjectPointers(&visitor, | 77 isolate->IterateObjectPointers(&visitor, |
79 StackFrameIterator::kValidateFrames); | 78 StackFrameIterator::kValidateFrames); |
80 VerifyWeakPointersVisitor weak_visitor(&visitor); | 79 VerifyWeakPointersVisitor weak_visitor(&visitor); |
81 // Visit weak handles and prologue weak handles. | 80 // Visit weak handles and prologue weak handles. |
82 isolate->VisitWeakPersistentHandles(&weak_visitor); | 81 isolate->VisitWeakPersistentHandles(&weak_visitor); |
83 delete allocated_set; | 82 delete allocated_set; |
84 } | 83 } |
85 | 84 |
86 } // namespace dart | 85 } // namespace dart |
OLD | NEW |