| OLD | NEW |
| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 RawObject* obj = it.page()->FindObject(visitor); | 650 RawObject* obj = it.page()->FindObject(visitor); |
| 651 if (obj != Object::null()) { | 651 if (obj != Object::null()) { |
| 652 return obj; | 652 return obj; |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 } | 655 } |
| 656 return Object::null(); | 656 return Object::null(); |
| 657 } | 657 } |
| 658 | 658 |
| 659 | 659 |
| 660 void PageSpace::WriteProtect(bool read_only) { | 660 void PageSpace::WriteProtect(bool read_only, bool include_code_pages) { |
| 661 if (read_only) { | 661 if (read_only) { |
| 662 // Avoid MakeIterable trying to write to the heap. | 662 // Avoid MakeIterable trying to write to the heap. |
| 663 AbandonBumpAllocation(); | 663 AbandonBumpAllocation(); |
| 664 } | 664 } |
| 665 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { | 665 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
| 666 it.page()->WriteProtect(read_only); | 666 if ((it.page()->type() != HeapPage::kExecutable) || include_code_pages) { |
| 667 it.page()->WriteProtect(read_only); |
| 668 } |
| 667 } | 669 } |
| 668 } | 670 } |
| 669 | 671 |
| 670 | 672 |
| 671 void PageSpace::PrintToJSONObject(JSONObject* object) const { | 673 void PageSpace::PrintToJSONObject(JSONObject* object) const { |
| 672 Isolate* isolate = Isolate::Current(); | 674 Isolate* isolate = Isolate::Current(); |
| 673 ASSERT(isolate != NULL); | 675 ASSERT(isolate != NULL); |
| 674 JSONObject space(object, "old"); | 676 JSONObject space(object, "old"); |
| 675 space.AddProperty("type", "HeapSpace"); | 677 space.AddProperty("type", "HeapSpace"); |
| 676 space.AddProperty("name", "old"); | 678 space.AddProperty("name", "old"); |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1213 return 0; | 1215 return 0; |
| 1214 } else { | 1216 } else { |
| 1215 ASSERT(total_time >= gc_time); | 1217 ASSERT(total_time >= gc_time); |
| 1216 int result = static_cast<int>((static_cast<double>(gc_time) / | 1218 int result = static_cast<int>((static_cast<double>(gc_time) / |
| 1217 static_cast<double>(total_time)) * 100); | 1219 static_cast<double>(total_time)) * 100); |
| 1218 return result; | 1220 return result; |
| 1219 } | 1221 } |
| 1220 } | 1222 } |
| 1221 | 1223 |
| 1222 } // namespace dart | 1224 } // namespace dart |
| OLD | NEW |