| 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_VISITOR_H_ | 5 #ifndef VM_VISITOR_H_ |
| 6 #define VM_VISITOR_H_ | 6 #define VM_VISITOR_H_ |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 void VisitPointer(RawObject** p) { VisitPointers(p , p); } | 32 void VisitPointer(RawObject** p) { VisitPointers(p , p); } |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 Isolate* isolate_; | 35 Isolate* isolate_; |
| 36 | 36 |
| 37 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectPointerVisitor); | 37 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectPointerVisitor); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 | 40 |
| 41 // An object visitor interface. |
| 42 class ObjectVisitor { |
| 43 public: |
| 44 virtual ~ObjectVisitor() {} |
| 45 |
| 46 // Invoked for each object. |
| 47 virtual void VisitObject(RawObject* obj) = 0; |
| 48 }; |
| 49 |
| 50 |
| 41 // An object finder visitor interface. | 51 // An object finder visitor interface. |
| 42 class FindObjectVisitor { | 52 class FindObjectVisitor { |
| 43 public: | 53 public: |
| 44 explicit FindObjectVisitor(Isolate* isolate) : isolate_(isolate) {} | 54 explicit FindObjectVisitor(Isolate* isolate) : isolate_(isolate) {} |
| 45 virtual ~FindObjectVisitor() {} | 55 virtual ~FindObjectVisitor() {} |
| 46 | 56 |
| 47 // Check if object matches find condition. | 57 // Check if object matches find condition. |
| 48 virtual bool FindObject(RawObject* obj) = 0; | 58 virtual bool FindObject(RawObject* obj) = 0; |
| 49 | 59 |
| 50 private: | 60 private: |
| 51 Isolate* isolate_; | 61 Isolate* isolate_; |
| 52 | 62 |
| 53 DISALLOW_IMPLICIT_CONSTRUCTORS(FindObjectVisitor); | 63 DISALLOW_IMPLICIT_CONSTRUCTORS(FindObjectVisitor); |
| 54 }; | 64 }; |
| 55 | 65 |
| 56 } // namespace dart | 66 } // namespace dart |
| 57 | 67 |
| 58 #endif // VM_VISITOR_H_ | 68 #endif // VM_VISITOR_H_ |
| OLD | NEW |