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

Unified Diff: runtime/vm/verifier.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/verifier.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/verifier.cc
diff --git a/runtime/vm/verifier.cc b/runtime/vm/verifier.cc
index 0d62a583bbdb9e317985fd0501a4688aa4ae7063..37748b7593cf0adb2e6a99c0c2c30ab24d8b97ed 100644
--- a/runtime/vm/verifier.cc
+++ b/runtime/vm/verifier.cc
@@ -6,6 +6,7 @@
#include "vm/assert.h"
#include "vm/dart.h"
+#include "vm/dart_api_state.h"
#include "vm/freelist.h"
#include "vm/heap.h"
#include "vm/isolate.h"
@@ -39,11 +40,21 @@ void VerifyPointersVisitor::VisitPointers(RawObject** first, RawObject** last) {
}
+void VerifyWeakPointersVisitor::VisitHandle(uword addr) {
+ WeakPersistentHandle* handle = reinterpret_cast<WeakPersistentHandle*>(addr);
+ RawObject* raw_obj = handle->raw();
+ visitor_->VisitPointer(&raw_obj);
+}
+
+
void VerifyPointersVisitor::VerifyPointers() {
NoGCScope no_gc;
+ Isolate* isolate = Isolate::Current();
VerifyPointersVisitor visitor;
- Isolate::Current()->VisitObjectPointers(&visitor,
- StackFrameIterator::kValidateFrames);
+ isolate->VisitObjectPointers(&visitor,
+ StackFrameIterator::kValidateFrames);
+ VerifyWeakPointersVisitor weak_visitor(&visitor);
+ isolate->VisitWeakPersistentHandles(&weak_visitor);
}
} // namespace dart
« no previous file with comments | « runtime/vm/verifier.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698