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

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: a better strategy for protected handle checks 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
Index: runtime/vm/verifier.cc
diff --git a/runtime/vm/verifier.cc b/runtime/vm/verifier.cc
index 0d62a583bbdb9e317985fd0501a4688aa4ae7063..733a7b7b322dbeabc241e3c18f77975cf1e1c29d 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,20 @@ 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;
VerifyPointersVisitor visitor;
Isolate::Current()->VisitObjectPointers(&visitor,
Ivan Posva 2012/01/12 23:30:38 Isolate* isolate = Isolate::Current(); isolate->Vi
cshapiro 2012/01/13 01:30:03 Thanks, much cleaner. Done.
StackFrameIterator::kValidateFrames);
+ VerifyWeakPointersVisitor weak_visitor(&visitor);
+ Isolate::Current()->VisitWeakPersistentHandles(&weak_visitor);
}
} // namespace dart
« runtime/vm/handles.h ('K') | « 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