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

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2995543004: [vm, gc] Require a safepoint for heap iteration. (Closed)
Patch Set: explicit-thread Created 3 years, 4 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/isolate.cc ('k') | 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_reload.cc
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index eeff480c8cbcb0fc97031550570608a9dc312f35..80d8d8157bbf576977f7e64243aafd1336141bcb 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -1257,8 +1257,9 @@ void IsolateReloadContext::Commit() {
// corresponding canonical tables.
Thread* thread = Thread::Current();
I->heap()->CollectAllGarbage();
+ HeapIterationScope iteration(thread);
VerifyCanonicalVisitor check_canonical(thread);
- I->heap()->IterateObjects(&check_canonical);
+ iteration.IterateObjects(&check_canonical);
#endif // DEBUG
}
@@ -1355,7 +1356,10 @@ void IsolateReloadContext::MorphInstances() {
// Find all objects that need to be morphed.
ObjectLocator locator(this);
- isolate()->heap()->VisitObjects(&locator);
+ {
+ HeapIterationScope iteration(Thread::Current());
+ iteration.IterateObjects(&locator);
+ }
// Return if no objects are located.
intptr_t count = locator.count();
@@ -1616,10 +1620,9 @@ void IsolateReloadContext::MarkAllFunctionsForRecompilation() {
Thread* thread = Thread::Current();
StackZone stack_zone(thread);
Zone* zone = stack_zone.GetZone();
- NoSafepointScope no_safepoint;
- HeapIterationScope heap_iteration_scope;
+ HeapIterationScope iteration(thread);
MarkFunctionsForRecompilation visitor(isolate_, this, zone);
- isolate_->heap()->VisitObjects(&visitor);
+ iteration.IterateObjects(&visitor);
}
void IsolateReloadContext::InvalidateWorld() {
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698