| Index: runtime/vm/pages.cc
|
| diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
|
| index da7ec8059aeb03c5534002221013e17a36e4c5ff..6dc7e9320cd4ea722b2cd4d03175d1055618451a 100644
|
| --- a/runtime/vm/pages.cc
|
| +++ b/runtime/vm/pages.cc
|
| @@ -657,13 +657,15 @@ RawObject* PageSpace::FindObject(FindObjectVisitor* visitor,
|
| }
|
|
|
|
|
| -void PageSpace::WriteProtect(bool read_only) {
|
| +void PageSpace::WriteProtect(bool read_only, bool include_code_pages) {
|
| if (read_only) {
|
| // Avoid MakeIterable trying to write to the heap.
|
| AbandonBumpAllocation();
|
| }
|
| for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) {
|
| - it.page()->WriteProtect(read_only);
|
| + if ((it.page()->type() != HeapPage::kExecutable) || include_code_pages) {
|
| + it.page()->WriteProtect(read_only);
|
| + }
|
| }
|
| }
|
|
|
|
|