Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index c20def45467837153a63515762f8a6c5f22139bb..c0571f89a1fd78190003e60a566d0583835f2019 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -45,6 +45,7 @@ |
#include "vm/timeline.h" |
#include "vm/timeline_analysis.h" |
#include "vm/timer.h" |
+#include "vm/verifier.h" |
#include "vm/visitor.h" |
@@ -1091,10 +1092,12 @@ void Isolate::ReportReloadError(const Error& error) { |
void Isolate::ReloadSources(bool test_mode) { |
+ // TODO(asiva): Add verification of canonical objects. |
ASSERT(!IsReloading()); |
has_attempted_reload_ = true; |
reload_context_ = new IsolateReloadContext(this, test_mode); |
reload_context_->StartReload(); |
+ // TODO(asiva): Add verification of canonical objects. |
} |
#endif // !PRODUCT |
@@ -1492,6 +1495,13 @@ static void ShutdownIsolate(uword parameter) { |
ASSERT(thread->isolate() == isolate); |
StackZone zone(thread); |
HandleScope handle_scope(thread); |
+#if defined(DEBUG) |
+ if (!isolate->HasAttemptedReload()) { |
+ isolate->heap()->CollectAllGarbage(); |
+ VerifyCanonicalVisitor check_canonical(thread); |
+ isolate->heap()->IterateObjects(&check_canonical); |
+ } |
+#endif // DEBUG |
const Error& error = Error::Handle(thread->sticky_error()); |
if (!error.IsNull() && !error.IsUnwindError()) { |
OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); |