| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #include "src/vm/heap_validator.h" | 5 #include "src/vm/heap_validator.h" |
| 6 #include "src/vm/process.h" | 6 #include "src/vm/process.h" |
| 7 | 7 |
| 8 namespace fletch { | 8 namespace dartino { |
| 9 | 9 |
| 10 void HeapPointerValidator::VisitBlock(Object** start, Object** end) { | 10 void HeapPointerValidator::VisitBlock(Object** start, Object** end) { |
| 11 for (; start != end; start++) { | 11 for (; start != end; start++) { |
| 12 ValidatePointer(*start); | 12 ValidatePointer(*start); |
| 13 } | 13 } |
| 14 } | 14 } |
| 15 | 15 |
| 16 void HeapPointerValidator::ValidatePointer(Object* object) { | 16 void HeapPointerValidator::ValidatePointer(Object* object) { |
| 17 if (!object->IsHeapObject()) return; | 17 if (!object->IsHeapObject()) return; |
| 18 | 18 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 HeapPointerValidator validator(program_heap_, process_heap); | 55 HeapPointerValidator validator(program_heap_, process_heap); |
| 56 | 56 |
| 57 HeapObjectPointerVisitor pointer_visitor(&validator); | 57 HeapObjectPointerVisitor pointer_visitor(&validator); |
| 58 process->IterateRoots(&validator); | 58 process->IterateRoots(&validator); |
| 59 process_heap->IterateObjects(&pointer_visitor); | 59 process_heap->IterateObjects(&pointer_visitor); |
| 60 process_heap->VisitWeakObjectPointers(&validator); | 60 process_heap->VisitWeakObjectPointers(&validator); |
| 61 process->mailbox()->IteratePointers(&validator); | 61 process->mailbox()->IteratePointers(&validator); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace fletch | 65 } // namespace dartino |
| OLD | NEW |