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 28 matching lines...) Expand all Loading... |
39 break; | 39 break; |
40 } | 40 } |
41 } | 41 } |
42 allocated_set_->Add(raw_obj); | 42 allocated_set_->Add(raw_obj); |
43 raw_obj->Validate(isolate()); | 43 raw_obj->Validate(isolate()); |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) { | 47 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) { |
48 for (RawObject** current = first; current <= last; current++) { | 48 for (RawObject** current = first; current <= last; current++) { |
| 49 VerifiedMemory::Verify(reinterpret_cast<uword>(current), kWordSize); |
49 RawObject* raw_obj = *current; | 50 RawObject* raw_obj = *current; |
50 if (raw_obj->IsHeapObject()) { | 51 if (raw_obj->IsHeapObject()) { |
51 if (!allocated_set_->Contains(raw_obj)) { | 52 if (!allocated_set_->Contains(raw_obj)) { |
52 uword raw_addr = RawObject::ToAddr(raw_obj); | 53 uword raw_addr = RawObject::ToAddr(raw_obj); |
53 FATAL1("Invalid object pointer encountered %#" Px "\n", raw_addr); | 54 FATAL1("Invalid object pointer encountered %#" Px "\n", raw_addr); |
54 } | 55 } |
55 } | 56 } |
56 } | 57 } |
57 } | 58 } |
58 | 59 |
(...skipping 17 matching lines...) Expand all Loading... |
76 false, // skip prologue weak handles | 77 false, // skip prologue weak handles |
77 StackFrameIterator::kValidateFrames); | 78 StackFrameIterator::kValidateFrames); |
78 VerifyWeakPointersVisitor weak_visitor(&visitor); | 79 VerifyWeakPointersVisitor weak_visitor(&visitor); |
79 // Visit weak handles and prologue weak handles. | 80 // Visit weak handles and prologue weak handles. |
80 isolate->VisitWeakPersistentHandles(&weak_visitor, | 81 isolate->VisitWeakPersistentHandles(&weak_visitor, |
81 true); // visit prologue weak handles | 82 true); // visit prologue weak handles |
82 delete allocated_set; | 83 delete allocated_set; |
83 } | 84 } |
84 | 85 |
85 } // namespace dart | 86 } // namespace dart |
OLD | NEW |