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

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

Issue 9148051: Provide API support for weak handles and post-mortem finalization. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/scavenger.cc ('k') | runtime/vm/verifier.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 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/visitor.h" 11 #include "vm/visitor.h"
11 12
12 namespace dart { 13 namespace dart {
13 14
14 DECLARE_FLAG(bool, verify_on_transition); 15 DECLARE_FLAG(bool, verify_on_transition);
15 16
16 #define VERIFY_ON_TRANSITION \ 17 #define VERIFY_ON_TRANSITION \
17 if (FLAG_verify_on_transition) { \ 18 if (FLAG_verify_on_transition) { \
18 VerifyPointersVisitor::VerifyPointers(); \ 19 VerifyPointersVisitor::VerifyPointers(); \
19 Isolate::Current()->heap()->Verify(); \ 20 Isolate::Current()->heap()->Verify(); \
20 } \ 21 } \
21 22
22 23
23 // Forward declarations. 24 // Forward declarations.
24 class RawObject; 25 class RawObject;
25 26
26 // A sample object pointer visitor implementation which verifies that 27 // A sample object pointer visitor implementation which verifies that
27 // the pointers visited are contained in the isolate heap. 28 // the pointers visited are contained in the isolate heap.
28 class VerifyPointersVisitor : public ObjectPointerVisitor { 29 class VerifyPointersVisitor : public ObjectPointerVisitor {
29 public: 30 public:
30 VerifyPointersVisitor() {} 31 VerifyPointersVisitor() {}
31 32
32 virtual void VisitPointers(RawObject** first, RawObject** last); 33 virtual void VisitPointers(RawObject** first, RawObject** last);
33 34
34 static void VerifyPointers(); 35 static void VerifyPointers();
36
37 private:
38 DISALLOW_COPY_AND_ASSIGN(VerifyPointersVisitor);
39 };
40
41 class VerifyWeakPointersVisitor : public HandleVisitor {
42 public:
43 explicit VerifyWeakPointersVisitor(VerifyPointersVisitor* visitor)
44 : visitor_(visitor) {
45 }
46
47 virtual void VisitHandle(uword addr);
48
49 private:
50 ObjectPointerVisitor* visitor_;
51
52 DISALLOW_COPY_AND_ASSIGN(VerifyWeakPointersVisitor);
35 }; 53 };
36 54
37 } // namespace dart 55 } // namespace dart
38 56
39 #endif // VM_VERIFIER_H_ 57 #endif // VM_VERIFIER_H_
OLDNEW
« no previous file with comments | « runtime/vm/scavenger.cc ('k') | runtime/vm/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698