| 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 | 837 |
| 838 const int64_t start = OS::GetCurrentTimeMicros(); | 838 const int64_t start = OS::GetCurrentTimeMicros(); |
| 839 | 839 |
| 840 // Make code pages writable. | 840 // Make code pages writable. |
| 841 WriteProtectCode(false); | 841 WriteProtectCode(false); |
| 842 | 842 |
| 843 // Save old value before GCMarker visits the weak persistent handles. | 843 // Save old value before GCMarker visits the weak persistent handles. |
| 844 SpaceUsage usage_before = GetCurrentUsage(); | 844 SpaceUsage usage_before = GetCurrentUsage(); |
| 845 | 845 |
| 846 // Mark all reachable old-gen objects. | 846 // Mark all reachable old-gen objects. |
| 847 bool collect_code = FLAG_collect_code && ShouldCollectCode(); | 847 bool collect_code = FLAG_collect_code && |
| 848 ShouldCollectCode() && |
| 849 !isolate->HasAttemptedReload(); |
| 848 GCMarker marker(heap_); | 850 GCMarker marker(heap_); |
| 849 marker.MarkObjects(isolate, this, invoke_api_callbacks, collect_code); | 851 marker.MarkObjects(isolate, this, invoke_api_callbacks, collect_code); |
| 850 usage_.used_in_words = marker.marked_words(); | 852 usage_.used_in_words = marker.marked_words(); |
| 851 | 853 |
| 852 int64_t mid1 = OS::GetCurrentTimeMicros(); | 854 int64_t mid1 = OS::GetCurrentTimeMicros(); |
| 853 | 855 |
| 854 // Abandon the remainder of the bump allocation block. | 856 // Abandon the remainder of the bump allocation block. |
| 855 AbandonBumpAllocation(); | 857 AbandonBumpAllocation(); |
| 856 // Reset the freelists and setup sweeping. | 858 // Reset the freelists and setup sweeping. |
| 857 freelist_[HeapPage::kData].Reset(); | 859 freelist_[HeapPage::kData].Reset(); |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 return 0; | 1236 return 0; |
| 1235 } else { | 1237 } else { |
| 1236 ASSERT(total_time >= gc_time); | 1238 ASSERT(total_time >= gc_time); |
| 1237 int result = static_cast<int>((static_cast<double>(gc_time) / | 1239 int result = static_cast<int>((static_cast<double>(gc_time) / |
| 1238 static_cast<double>(total_time)) * 100); | 1240 static_cast<double>(total_time)) * 100); |
| 1239 return result; | 1241 return result; |
| 1240 } | 1242 } |
| 1241 } | 1243 } |
| 1242 | 1244 |
| 1243 } // namespace dart | 1245 } // namespace dart |
| OLD | NEW |