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

Unified Diff: runtime/vm/isolate.cc

Issue 2160953002: Add a verification step which iterates over the heap and verifies that all canonical objects are co… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review comments. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698