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

Unified Diff: runtime/vm/isolate.cc

Issue 2201473002: Trun on canonical objects verification after reload (still have one workaround for immutable arrays… (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.cc » ('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 c743fae446206b5c287d138a331ff82cb42b8794..3de4593c509835435b0b947070b505cf25202c48 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1098,19 +1098,25 @@ void Isolate::ReportReloadError(const Error& error) {
bool Isolate::ReloadSources(JSONStream* js,
bool force_reload,
bool dont_delete_reload_context) {
- // TODO(asiva): Add verification of canonical objects.
ASSERT(!IsReloading());
has_attempted_reload_ = true;
reload_context_ = new IsolateReloadContext(this, js);
reload_context_->StartReload(force_reload);
bool success = !reload_context_->has_error();
- // TODO(asiva): Add verification of canonical objects.
- if (dont_delete_reload_context) {
- // Unit tests use the reload context later. Caller is responsible
- // for deleting the context.
- return success;
+ // Unit tests use the reload context later. Caller is responsible
+ // for deleting the context.
+ if (!dont_delete_reload_context) {
+ DeleteReloadContext();
}
- DeleteReloadContext();
+#if defined(DEBUG)
+ if (success) {
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
+ isolate->heap()->CollectAllGarbage();
+ VerifyCanonicalVisitor check_canonical(thread);
+ isolate->heap()->IterateObjects(&check_canonical);
+ }
+#endif // DEBUG
return success;
}
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698