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 3001343002: Remove GC prologue and epilogue callbacks. (Closed)
Patch Set: Created 3 years, 4 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/scavenger.h » ('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/address_sanitizer.h" 7 #include "platform/address_sanitizer.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/compiler_stats.h" 9 #include "vm/compiler_stats.h"
10 #include "vm/gc_marker.h" 10 #include "vm/gc_marker.h"
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 page = large_pages_; 812 page = large_pages_;
813 while (page != NULL) { 813 while (page != NULL) {
814 if (page->type() == HeapPage::kExecutable && !page->is_image_page()) { 814 if (page->type() == HeapPage::kExecutable && !page->is_image_page()) {
815 page->WriteProtect(read_only); 815 page->WriteProtect(read_only);
816 } 816 }
817 page = page->next(); 817 page = page->next();
818 } 818 }
819 } 819 }
820 } 820 }
821 821
822 void PageSpace::MarkSweep(bool invoke_api_callbacks) { 822 void PageSpace::MarkSweep() {
823 Thread* thread = Thread::Current(); 823 Thread* thread = Thread::Current();
824 Isolate* isolate = heap_->isolate(); 824 Isolate* isolate = heap_->isolate();
825 ASSERT(isolate == Isolate::Current()); 825 ASSERT(isolate == Isolate::Current());
826 826
827 const int64_t pre_wait_for_sweepers = OS::GetCurrentMonotonicMicros(); 827 const int64_t pre_wait_for_sweepers = OS::GetCurrentMonotonicMicros();
828 828
829 // Wait for pending tasks to complete and then account for the driver task. 829 // Wait for pending tasks to complete and then account for the driver task.
830 { 830 {
831 MonitorLocker locker(tasks_lock()); 831 MonitorLocker locker(tasks_lock());
832 while (tasks() > 0) { 832 while (tasks() > 0) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 SpaceUsage usage_before = GetCurrentUsage(); 871 SpaceUsage usage_before = GetCurrentUsage();
872 872
873 // Mark all reachable old-gen objects. 873 // Mark all reachable old-gen objects.
874 #if defined(PRODUCT) 874 #if defined(PRODUCT)
875 bool collect_code = FLAG_collect_code && ShouldCollectCode(); 875 bool collect_code = FLAG_collect_code && ShouldCollectCode();
876 #else 876 #else
877 bool collect_code = FLAG_collect_code && ShouldCollectCode() && 877 bool collect_code = FLAG_collect_code && ShouldCollectCode() &&
878 !isolate->HasAttemptedReload(); 878 !isolate->HasAttemptedReload();
879 #endif // !defined(PRODUCT) 879 #endif // !defined(PRODUCT)
880 GCMarker marker(heap_); 880 GCMarker marker(heap_);
881 marker.MarkObjects(isolate, this, invoke_api_callbacks, collect_code); 881 marker.MarkObjects(isolate, this, collect_code);
882 usage_.used_in_words = marker.marked_words(); 882 usage_.used_in_words = marker.marked_words();
883 883
884 int64_t mid1 = OS::GetCurrentMonotonicMicros(); 884 int64_t mid1 = OS::GetCurrentMonotonicMicros();
885 885
886 // Abandon the remainder of the bump allocation block. 886 // Abandon the remainder of the bump allocation block.
887 AbandonBumpAllocation(); 887 AbandonBumpAllocation();
888 // Reset the freelists and setup sweeping. 888 // Reset the freelists and setup sweeping.
889 freelist_[HeapPage::kData].Reset(); 889 freelist_[HeapPage::kData].Reset();
890 freelist_[HeapPage::kExecutable].Reset(); 890 freelist_[HeapPage::kExecutable].Reset();
891 891
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 return 0; 1276 return 0;
1277 } else { 1277 } else {
1278 ASSERT(total_time >= gc_time); 1278 ASSERT(total_time >= gc_time);
1279 int result = static_cast<int>( 1279 int result = static_cast<int>(
1280 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100); 1280 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100);
1281 return result; 1281 return result;
1282 } 1282 }
1283 } 1283 }
1284 1284
1285 } // namespace dart 1285 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698