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

Unified Diff: runtime/vm/object.cc

Issue 1374373004: Clarify heap write protection interface and use WritableVMIsolateScope to resolve issue 23217. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/heap.cc ('k') | runtime/vm/pages.h » ('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 9311f7264ea62585ef7cbdbf9f8883bb00b96cac..95f3b9773d263dff3390770b79bee2d799d398a0 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -951,12 +951,14 @@ void Object::FinalizeVMIsolate(Isolate* isolate) {
cls = isolate->object_store()->one_byte_string_class();
cls.set_name(Symbols::OneByteString());
- // Make the VM isolate read-only after setting all objects as marked.
- PremarkingVisitor premarker(isolate);
- isolate->heap()->WriteProtect(false);
- ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0);
- isolate->heap()->IterateOldObjects(&premarker);
- isolate->heap()->WriteProtect(true);
+ {
+ ASSERT(isolate == Dart::vm_isolate());
+ WritableVMIsolateScope scope(Thread::Current());
+ PremarkingVisitor premarker(isolate);
+ ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0);
+ isolate->heap()->IterateOldObjects(&premarker);
+ // Make the VM isolate read-only again after setting all objects as marked.
+ }
}
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698