| 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 24 matching lines...) Expand all Loading... |
| 35 break; | 35 break; |
| 36 case kRequireMarked: | 36 case kRequireMarked: |
| 37 if (!raw_obj->IsMarked()) { | 37 if (!raw_obj->IsMarked()) { |
| 38 FATAL1("Unmarked object encountered %#" Px "\n", raw_addr); | 38 FATAL1("Unmarked object encountered %#" Px "\n", raw_addr); |
| 39 } | 39 } |
| 40 break; | 40 break; |
| 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); | 51 VerifiedMemory::Verify(reinterpret_cast<uword>(current), kWordSize); |
| 52 RawObject* raw_obj = *current; | 52 RawObject* raw_obj = *current; |
| 53 if (raw_obj->IsHeapObject()) { | 53 if (raw_obj->IsHeapObject()) { |
| 54 if (!allocated_set_->Contains(raw_obj)) { | 54 if (!allocated_set_->Contains(raw_obj)) { |
| 55 uword raw_addr = RawObject::ToAddr(raw_obj); | 55 uword raw_addr = RawObject::ToAddr(raw_obj); |
| (...skipping 21 matching lines...) Expand all 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 |