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

Side by Side Diff: runtime/vm/pages.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, 2 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 void HeapPage::WriteProtect(bool read_only) { 130 void HeapPage::WriteProtect(bool read_only) {
131 VirtualMemory::Protection prot; 131 VirtualMemory::Protection prot;
132 if (read_only) { 132 if (read_only) {
133 if (executable_) { 133 if (executable_) {
134 prot = VirtualMemory::kReadExecute; 134 prot = VirtualMemory::kReadExecute;
135 } else { 135 } else {
136 prot = VirtualMemory::kReadOnly; 136 prot = VirtualMemory::kReadOnly;
137 } 137 }
138 } else { 138 } else {
139 // TODO(23217): Should this really make all pages non-executable?
140 prot = VirtualMemory::kReadWrite; 139 prot = VirtualMemory::kReadWrite;
141 } 140 }
142 bool status = memory_->Protect(prot); 141 bool status = memory_->Protect(prot);
143 ASSERT(status); 142 ASSERT(status);
144 } 143 }
145 144
146 145
147 PageSpace::PageSpace(Heap* heap, 146 PageSpace::PageSpace(Heap* heap,
148 intptr_t max_capacity_in_words, 147 intptr_t max_capacity_in_words,
149 intptr_t max_external_in_words) 148 intptr_t max_external_in_words)
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 return 0; 1179 return 0;
1181 } else { 1180 } else {
1182 ASSERT(total_time >= gc_time); 1181 ASSERT(total_time >= gc_time);
1183 int result = static_cast<int>((static_cast<double>(gc_time) / 1182 int result = static_cast<int>((static_cast<double>(gc_time) /
1184 static_cast<double>(total_time)) * 100); 1183 static_cast<double>(total_time)) * 100);
1185 return result; 1184 return result;
1186 } 1185 }
1187 } 1186 }
1188 1187
1189 } // namespace dart 1188 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698