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

Side by Side Diff: runtime/vm/pages.cc

Issue 1965823002: Initial isolate reload support (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 839
840 const int64_t start = OS::GetCurrentTimeMicros(); 840 const int64_t start = OS::GetCurrentTimeMicros();
841 841
842 // Make code pages writable. 842 // Make code pages writable.
843 WriteProtectCode(false); 843 WriteProtectCode(false);
844 844
845 // Save old value before GCMarker visits the weak persistent handles. 845 // Save old value before GCMarker visits the weak persistent handles.
846 SpaceUsage usage_before = GetCurrentUsage(); 846 SpaceUsage usage_before = GetCurrentUsage();
847 847
848 // Mark all reachable old-gen objects. 848 // Mark all reachable old-gen objects.
849 bool collect_code = FLAG_collect_code && ShouldCollectCode(); 849 bool collect_code = FLAG_collect_code &&
850 ShouldCollectCode() &&
851 !isolate->HasAttemptedReload();
850 GCMarker marker(heap_); 852 GCMarker marker(heap_);
851 marker.MarkObjects(isolate, this, invoke_api_callbacks, collect_code); 853 marker.MarkObjects(isolate, this, invoke_api_callbacks, collect_code);
852 usage_.used_in_words = marker.marked_words(); 854 usage_.used_in_words = marker.marked_words();
853 855
854 int64_t mid1 = OS::GetCurrentTimeMicros(); 856 int64_t mid1 = OS::GetCurrentTimeMicros();
855 857
856 // Abandon the remainder of the bump allocation block. 858 // Abandon the remainder of the bump allocation block.
857 AbandonBumpAllocation(); 859 AbandonBumpAllocation();
858 // Reset the freelists and setup sweeping. 860 // Reset the freelists and setup sweeping.
859 freelist_[HeapPage::kData].Reset(); 861 freelist_[HeapPage::kData].Reset();
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 return 0; 1238 return 0;
1237 } else { 1239 } else {
1238 ASSERT(total_time >= gc_time); 1240 ASSERT(total_time >= gc_time);
1239 int result = static_cast<int>((static_cast<double>(gc_time) / 1241 int result = static_cast<int>((static_cast<double>(gc_time) /
1240 static_cast<double>(total_time)) * 100); 1242 static_cast<double>(total_time)) * 100);
1241 return result; 1243 return result;
1242 } 1244 }
1243 } 1245 }
1244 1246
1245 } // namespace dart 1247 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698