Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: runtime/vm/visitor.h

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/virtual_memory_win.cc ('k') | runtime/vm/weak_code.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_VISITOR_H_ 5 #ifndef RUNTIME_VM_VISITOR_H_
6 #define RUNTIME_VM_VISITOR_H_ 6 #define RUNTIME_VM_VISITOR_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 25 matching lines...) Expand all
36 36
37 void VisitPointer(RawObject** p) { VisitPointers(p, p); } 37 void VisitPointer(RawObject** p) { VisitPointers(p, p); }
38 38
39 private: 39 private:
40 Isolate* isolate_; 40 Isolate* isolate_;
41 NoSafepointScope no_safepoints_; 41 NoSafepointScope no_safepoints_;
42 42
43 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectPointerVisitor); 43 DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectPointerVisitor);
44 }; 44 };
45 45
46
47 // An object visitor interface. 46 // An object visitor interface.
48 class ObjectVisitor { 47 class ObjectVisitor {
49 public: 48 public:
50 ObjectVisitor() {} 49 ObjectVisitor() {}
51 50
52 virtual ~ObjectVisitor() {} 51 virtual ~ObjectVisitor() {}
53 52
54 // Invoked for each object. 53 // Invoked for each object.
55 virtual void VisitObject(RawObject* obj) = 0; 54 virtual void VisitObject(RawObject* obj) = 0;
56 55
57 private: 56 private:
58 DISALLOW_COPY_AND_ASSIGN(ObjectVisitor); 57 DISALLOW_COPY_AND_ASSIGN(ObjectVisitor);
59 }; 58 };
60 59
61
62 // An object finder visitor interface. 60 // An object finder visitor interface.
63 class FindObjectVisitor { 61 class FindObjectVisitor {
64 public: 62 public:
65 FindObjectVisitor() {} 63 FindObjectVisitor() {}
66 virtual ~FindObjectVisitor() {} 64 virtual ~FindObjectVisitor() {}
67 65
68 // Allow to specify a address filter. 66 // Allow to specify a address filter.
69 virtual uword filter_addr() const { return 0; } 67 virtual uword filter_addr() const { return 0; }
70 bool VisitRange(uword begin_addr, uword end_addr) const { 68 bool VisitRange(uword begin_addr, uword end_addr) const {
71 uword addr = filter_addr(); 69 uword addr = filter_addr();
72 return (addr == 0) || ((begin_addr <= addr) && (addr < end_addr)); 70 return (addr == 0) || ((begin_addr <= addr) && (addr < end_addr));
73 } 71 }
74 72
75 // Check if object matches find condition. 73 // Check if object matches find condition.
76 virtual bool FindObject(RawObject* obj) const = 0; 74 virtual bool FindObject(RawObject* obj) const = 0;
77 75
78 private: 76 private:
79 DISALLOW_COPY_AND_ASSIGN(FindObjectVisitor); 77 DISALLOW_COPY_AND_ASSIGN(FindObjectVisitor);
80 }; 78 };
81 79
82 } // namespace dart 80 } // namespace dart
83 81
84 #endif // RUNTIME_VM_VISITOR_H_ 82 #endif // RUNTIME_VM_VISITOR_H_
OLDNEW
« no previous file with comments | « runtime/vm/virtual_memory_win.cc ('k') | runtime/vm/weak_code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698