| 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 DEFINE_FLAG(bool, verify_on_transition, false, "Verify on dart <==> VM."); | |
| 21 | |
| 22 | |
| 23 void VerifyObjectVisitor::VisitObject(RawObject* raw_obj) { | 20 void VerifyObjectVisitor::VisitObject(RawObject* raw_obj) { |
| 24 if (raw_obj->IsHeapObject()) { | 21 if (raw_obj->IsHeapObject()) { |
| 25 uword raw_addr = RawObject::ToAddr(raw_obj); | 22 uword raw_addr = RawObject::ToAddr(raw_obj); |
| 26 if (raw_obj->IsFreeListElement()) { | 23 if (raw_obj->IsFreeListElement()) { |
| 27 if (raw_obj->IsMarked()) { | 24 if (raw_obj->IsMarked()) { |
| 28 FATAL1("Marked free list element encountered %#" Px "\n", raw_addr); | 25 FATAL1("Marked free list element encountered %#" Px "\n", raw_addr); |
| 29 } | 26 } |
| 30 } else { | 27 } else { |
| 31 switch (mark_expectation_) { | 28 switch (mark_expectation_) { |
| 32 case kForbidMarked: | 29 case kForbidMarked: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Visit all strongly reachable objects. | 77 // Visit all strongly reachable objects. |
| 81 isolate->IterateObjectPointers(&visitor, | 78 isolate->IterateObjectPointers(&visitor, |
| 82 StackFrameIterator::kValidateFrames); | 79 StackFrameIterator::kValidateFrames); |
| 83 VerifyWeakPointersVisitor weak_visitor(&visitor); | 80 VerifyWeakPointersVisitor weak_visitor(&visitor); |
| 84 // Visit weak handles and prologue weak handles. | 81 // Visit weak handles and prologue weak handles. |
| 85 isolate->VisitWeakPersistentHandles(&weak_visitor); | 82 isolate->VisitWeakPersistentHandles(&weak_visitor); |
| 86 delete allocated_set; | 83 delete allocated_set; |
| 87 } | 84 } |
| 88 | 85 |
| 89 } // namespace dart | 86 } // namespace dart |
| OLD | NEW |