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 14 matching lines...) Expand all Loading... |
25 raw_obj->Validate(isolate()); | 25 raw_obj->Validate(isolate()); |
26 } | 26 } |
27 | 27 |
28 | 28 |
29 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) { | 29 void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) { |
30 for (RawObject** current = first; current <= last; current++) { | 30 for (RawObject** current = first; current <= last; current++) { |
31 RawObject* raw_obj = *current; | 31 RawObject* raw_obj = *current; |
32 if (raw_obj->IsHeapObject()) { | 32 if (raw_obj->IsHeapObject()) { |
33 if (!allocated_set_->Contains(raw_obj)) { | 33 if (!allocated_set_->Contains(raw_obj)) { |
34 uword raw_addr = RawObject::ToAddr(raw_obj); | 34 uword raw_addr = RawObject::ToAddr(raw_obj); |
35 FATAL1("Invalid object pointer encountered %#"Px"\n", raw_addr); | 35 FATAL1("Invalid object pointer encountered %#" Px "\n", raw_addr); |
36 } | 36 } |
37 } | 37 } |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 | 41 |
42 void VerifyWeakPointersVisitor::VisitHandle(uword addr) { | 42 void VerifyWeakPointersVisitor::VisitHandle(uword addr) { |
43 FinalizablePersistentHandle* handle = | 43 FinalizablePersistentHandle* handle = |
44 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 44 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
45 RawObject* raw_obj = handle->raw(); | 45 RawObject* raw_obj = handle->raw(); |
(...skipping 11 matching lines...) Expand all Loading... |
57 false, // skip prologue weak handles | 57 false, // skip prologue weak handles |
58 StackFrameIterator::kValidateFrames); | 58 StackFrameIterator::kValidateFrames); |
59 VerifyWeakPointersVisitor weak_visitor(&visitor); | 59 VerifyWeakPointersVisitor weak_visitor(&visitor); |
60 // Visit weak handles and prologue weak handles. | 60 // Visit weak handles and prologue weak handles. |
61 isolate->VisitWeakPersistentHandles(&weak_visitor, | 61 isolate->VisitWeakPersistentHandles(&weak_visitor, |
62 true); // visit prologue weak handles | 62 true); // visit prologue weak handles |
63 delete allocated_set; | 63 delete allocated_set; |
64 } | 64 } |
65 | 65 |
66 } // namespace dart | 66 } // namespace dart |
OLD | NEW |