OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef RUNTIME_VM_VERIFIER_H_ | 5 #ifndef RUNTIME_VM_VERIFIER_H_ |
6 #define RUNTIME_VM_VERIFIER_H_ | 6 #define RUNTIME_VM_VERIFIER_H_ |
7 | 7 |
8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/handles.h" | 10 #include "vm/handles.h" |
11 #include "vm/visitor.h" | 11 #include "vm/visitor.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
15 // Forward declarations. | 15 // Forward declarations. |
16 class Isolate; | 16 class Isolate; |
17 class ObjectSet; | 17 class ObjectSet; |
18 class RawObject; | 18 class RawObject; |
19 | 19 |
20 | |
21 enum MarkExpectation { kForbidMarked, kAllowMarked, kRequireMarked }; | 20 enum MarkExpectation { kForbidMarked, kAllowMarked, kRequireMarked }; |
22 | 21 |
23 | |
24 class VerifyObjectVisitor : public ObjectVisitor { | 22 class VerifyObjectVisitor : public ObjectVisitor { |
25 public: | 23 public: |
26 VerifyObjectVisitor(Isolate* isolate, | 24 VerifyObjectVisitor(Isolate* isolate, |
27 ObjectSet* allocated_set, | 25 ObjectSet* allocated_set, |
28 MarkExpectation mark_expectation) | 26 MarkExpectation mark_expectation) |
29 : isolate_(isolate), | 27 : isolate_(isolate), |
30 allocated_set_(allocated_set), | 28 allocated_set_(allocated_set), |
31 mark_expectation_(mark_expectation) {} | 29 mark_expectation_(mark_expectation) {} |
32 | 30 |
33 virtual void VisitObject(RawObject* obj); | 31 virtual void VisitObject(RawObject* obj); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 virtual void VisitHandle(uword addr); | 63 virtual void VisitHandle(uword addr); |
66 | 64 |
67 private: | 65 private: |
68 ObjectPointerVisitor* visitor_; | 66 ObjectPointerVisitor* visitor_; |
69 | 67 |
70 ObjectSet* allocated_set; | 68 ObjectSet* allocated_set; |
71 | 69 |
72 DISALLOW_COPY_AND_ASSIGN(VerifyWeakPointersVisitor); | 70 DISALLOW_COPY_AND_ASSIGN(VerifyWeakPointersVisitor); |
73 }; | 71 }; |
74 | 72 |
75 | |
76 #if defined(DEBUG) | 73 #if defined(DEBUG) |
77 class VerifyCanonicalVisitor : public ObjectVisitor { | 74 class VerifyCanonicalVisitor : public ObjectVisitor { |
78 public: | 75 public: |
79 explicit VerifyCanonicalVisitor(Thread* thread); | 76 explicit VerifyCanonicalVisitor(Thread* thread); |
80 virtual void VisitObject(RawObject* obj); | 77 virtual void VisitObject(RawObject* obj); |
81 | 78 |
82 private: | 79 private: |
83 Thread* thread_; | 80 Thread* thread_; |
84 Instance& instanceHandle_; | 81 Instance& instanceHandle_; |
85 | 82 |
86 DISALLOW_COPY_AND_ASSIGN(VerifyCanonicalVisitor); | 83 DISALLOW_COPY_AND_ASSIGN(VerifyCanonicalVisitor); |
87 }; | 84 }; |
88 #endif // defined(DEBUG) | 85 #endif // defined(DEBUG) |
89 | 86 |
90 } // namespace dart | 87 } // namespace dart |
91 | 88 |
92 #endif // RUNTIME_VM_VERIFIER_H_ | 89 #endif // RUNTIME_VM_VERIFIER_H_ |
OLD | NEW |