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" |
11 #include "vm/heap.h" | 11 #include "vm/heap.h" |
12 #include "vm/isolate.h" | 12 #include "vm/isolate.h" |
13 #include "vm/object.h" | 13 #include "vm/object.h" |
14 #include "vm/object_set.h" | 14 #include "vm/object_set.h" |
15 #include "vm/raw_object.h" | 15 #include "vm/raw_object.h" |
16 #include "vm/stack_frame.h" | 16 #include "vm/stack_frame.h" |
17 | 17 |
18 namespace dart { | 18 namespace dart { |
19 | 19 |
20 void VerifyObjectVisitor::VisitObject(RawObject* raw_obj) { | 20 void VerifyObjectVisitor::VisitObject(RawObject* raw_obj) { |
21 if (raw_obj->IsHeapObject()) { | 21 if (raw_obj->IsHeapObject()) { |
22 uword raw_addr = RawObject::ToAddr(raw_obj); | 22 uword raw_addr = RawObject::ToAddr(raw_obj); |
23 if (raw_obj->IsFreeListElement()) { | 23 if (raw_obj->IsFreeListElement() || raw_obj->IsForwardingCorpse()) { |
24 if (raw_obj->IsMarked()) { | 24 if (raw_obj->IsMarked()) { |
25 FATAL1("Marked free list element encountered %#" Px "\n", raw_addr); | 25 FATAL1("Marked free list element encountered %#" Px "\n", raw_addr); |
26 } | 26 } |
27 } else { | 27 } else { |
28 switch (mark_expectation_) { | 28 switch (mark_expectation_) { |
29 case kForbidMarked: | 29 case kForbidMarked: |
30 if (raw_obj->IsMarked()) { | 30 if (raw_obj->IsMarked()) { |
31 FATAL1("Marked object encountered %#" Px "\n", raw_addr); | 31 FATAL1("Marked object encountered %#" Px "\n", raw_addr); |
32 } | 32 } |
33 break; | 33 break; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Visit all strongly reachable objects. | 77 // Visit all strongly reachable objects. |
78 isolate->IterateObjectPointers(&visitor, | 78 isolate->IterateObjectPointers(&visitor, |
79 StackFrameIterator::kValidateFrames); | 79 StackFrameIterator::kValidateFrames); |
80 VerifyWeakPointersVisitor weak_visitor(&visitor); | 80 VerifyWeakPointersVisitor weak_visitor(&visitor); |
81 // Visit weak handles and prologue weak handles. | 81 // Visit weak handles and prologue weak handles. |
82 isolate->VisitWeakPersistentHandles(&weak_visitor); | 82 isolate->VisitWeakPersistentHandles(&weak_visitor); |
83 delete allocated_set; | 83 delete allocated_set; |
84 } | 84 } |
85 | 85 |
86 } // namespace dart | 86 } // namespace dart |
OLD | NEW |