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 VM_VERIFIER_H_ | 5 #ifndef VM_VERIFIER_H_ |
6 #define VM_VERIFIER_H_ | 6 #define 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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 | 23 |
24 // Forward declarations. | 24 // Forward declarations. |
25 class Isolate; | 25 class Isolate; |
26 class RawObject; | 26 class RawObject; |
27 | 27 |
28 // A sample object pointer visitor implementation which verifies that | 28 // A sample object pointer visitor implementation which verifies that |
29 // the pointers visited are contained in the isolate heap. | 29 // the pointers visited are contained in the isolate heap. |
30 class VerifyPointersVisitor : public ObjectPointerVisitor { | 30 class VerifyPointersVisitor : public ObjectPointerVisitor { |
31 public: | 31 public: |
32 explicit VerifyPointersVisitor(Isolate* isolate) : isolate_(isolate) {} | 32 explicit VerifyPointersVisitor(Isolate* isolate) |
| 33 : ObjectPointerVisitor(isolate) { |
| 34 } |
33 | 35 |
34 virtual void VisitPointers(RawObject** first, RawObject** last); | 36 virtual void VisitPointers(RawObject** first, RawObject** last); |
35 | 37 |
36 static void VerifyPointers(); | 38 static void VerifyPointers(); |
37 | 39 |
38 private: | 40 private: |
39 Isolate* isolate_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(VerifyPointersVisitor); | 41 DISALLOW_COPY_AND_ASSIGN(VerifyPointersVisitor); |
42 }; | 42 }; |
43 | 43 |
44 class VerifyWeakPointersVisitor : public HandleVisitor { | 44 class VerifyWeakPointersVisitor : public HandleVisitor { |
45 public: | 45 public: |
46 explicit VerifyWeakPointersVisitor(VerifyPointersVisitor* visitor) | 46 explicit VerifyWeakPointersVisitor(VerifyPointersVisitor* visitor) |
47 : visitor_(visitor) { | 47 : visitor_(visitor) { |
48 } | 48 } |
49 | 49 |
50 virtual void VisitHandle(uword addr); | 50 virtual void VisitHandle(uword addr); |
51 | 51 |
52 private: | 52 private: |
53 ObjectPointerVisitor* visitor_; | 53 ObjectPointerVisitor* visitor_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(VerifyWeakPointersVisitor); | 55 DISALLOW_COPY_AND_ASSIGN(VerifyWeakPointersVisitor); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace dart | 58 } // namespace dart |
59 | 59 |
60 #endif // VM_VERIFIER_H_ | 60 #endif // VM_VERIFIER_H_ |
OLD | NEW |