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

Unified Diff: runtime/vm/pages.cc

Issue 266643002: Object graph visitor: general depth-first search. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
Index: runtime/vm/pages.cc
===================================================================
--- runtime/vm/pages.cc (revision 35709)
+++ runtime/vm/pages.cc (working copy)
@@ -445,6 +445,20 @@
}
+void PageSpace::WriteProtectCode(bool read_only) {
+ // TODO(koda): Is this flag still useful?
+ if (FLAG_write_protect_code) {
+ HeapPage* current_page = pages_;
+ while (current_page != NULL) {
+ if (current_page->type() == HeapPage::kExecutable) {
+ current_page->WriteProtect(read_only);
+ }
+ current_page = NextPageAnySize(current_page);
+ }
+ }
+}
+
+
void PageSpace::MarkSweep(bool invoke_api_callbacks) {
// MarkSweep is not reentrant. Make sure that is the case.
ASSERT(!sweeping_);
@@ -468,16 +482,8 @@
const int64_t start = OS::GetCurrentTimeMicros();
- if (FLAG_write_protect_code) {
- // Make code pages writable.
- HeapPage* current_page = pages_;
- while (current_page != NULL) {
- if (current_page->type() == HeapPage::kExecutable) {
- current_page->WriteProtect(false);
- }
- current_page = NextPageAnySize(current_page);
- }
- }
+ // Make code pages writable.
+ WriteProtectCode(false);
// Save old value before GCMarker visits the weak persistent handles.
SpaceUsage usage_before = usage_;
@@ -529,16 +535,8 @@
page = next_page;
}
- if (FLAG_write_protect_code) {
- // Make code pages read-only.
- HeapPage* current_page = pages_;
- while (current_page != NULL) {
- if (current_page->type() == HeapPage::kExecutable) {
- current_page->WriteProtect(true);
- }
- current_page = NextPageAnySize(current_page);
- }
- }
+ // Make code pages read-only.
+ WriteProtectCode(true);
int64_t end = OS::GetCurrentTimeMicros();
« runtime/vm/object_graph.cc ('K') | « runtime/vm/pages.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698