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

Unified Diff: runtime/vm/object.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_reload.cc ('k') | runtime/vm/object_graph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index d1b188a1065a65122be9dafa4072899cb07673fc..d48ef6bba84114a4c648d55cf5b4a9609da6013e 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -1116,10 +1116,12 @@ void Object::FinalizeVMIsolate(Isolate* isolate) {
{
ASSERT(isolate == Dart::vm_isolate());
- WritableVMIsolateScope scope(Thread::Current());
+ Thread* thread = Thread::Current();
+ WritableVMIsolateScope scope(thread);
+ HeapIterationScope iteration(thread);
FinalizeVMIsolateVisitor premarker;
ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0);
- isolate->heap()->IterateOldObjectsNoImagePages(&premarker);
+ iteration.IterateOldObjectsNoImagePages(&premarker);
// Make the VM isolate read-only again after setting all objects as marked.
// Note objects in image pages are already pre-marked.
}
@@ -14126,7 +14128,7 @@ RawCode* Code::LookupCodeInIsolate(Isolate* isolate, uword pc) {
if (isolate->heap() == NULL) {
return Code::null();
}
- NoSafepointScope no_safepoint;
+ HeapIterationScope heap_iteration_scope(Thread::Current());
SlowFindRawCodeVisitor visitor(pc);
RawObject* needle = isolate->heap()->FindOldObject(&visitor);
if (needle != Code::null()) {
« no previous file with comments | « runtime/vm/isolate_reload.cc ('k') | runtime/vm/object_graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698