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

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

Issue 649743002: - Fine grain locking of free list when sweeping concurrently. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« runtime/vm/gc_sweeper.h ('K') | « runtime/vm/gc_sweeper.cc ('k') | no next file » | 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/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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 } 715 }
716 // Advance to the next page. 716 // Advance to the next page.
717 page = next_page; 717 page = next_page;
718 } 718 }
719 719
720 prev_page = NULL; 720 prev_page = NULL;
721 page = exec_pages_; 721 page = exec_pages_;
722 FreeList* freelist = &freelist_[HeapPage::kExecutable]; 722 FreeList* freelist = &freelist_[HeapPage::kExecutable];
723 while (page != NULL) { 723 while (page != NULL) {
724 HeapPage* next_page = page->next(); 724 HeapPage* next_page = page->next();
725 bool page_in_use = sweeper.SweepPage(page, freelist); 725 bool page_in_use = sweeper.SweepPage(page, freelist, true);
726 if (page_in_use) { 726 if (page_in_use) {
727 prev_page = page; 727 prev_page = page;
728 } else { 728 } else {
729 FreePage(page, prev_page); 729 FreePage(page, prev_page);
730 } 730 }
731 // Advance to the next page. 731 // Advance to the next page.
732 page = next_page; 732 page = next_page;
733 } 733 }
734 734
735 mid3 = OS::GetCurrentTimeMicros(); 735 mid3 = OS::GetCurrentTimeMicros();
736 736
737 if (!FLAG_concurrent_sweep) { 737 if (!FLAG_concurrent_sweep) {
738 // Sweep all regular sized pages now. 738 // Sweep all regular sized pages now.
739 prev_page = NULL; 739 prev_page = NULL;
740 page = pages_; 740 page = pages_;
741 while (page != NULL) { 741 while (page != NULL) {
742 HeapPage* next_page = page->next(); 742 HeapPage* next_page = page->next();
743 bool page_in_use = sweeper.SweepPage(page, &freelist_[page->type()]); 743 bool page_in_use = sweeper.SweepPage(
744 page, &freelist_[page->type()], true);
744 if (page_in_use) { 745 if (page_in_use) {
745 prev_page = page; 746 prev_page = page;
746 } else { 747 } else {
747 FreePage(page, prev_page); 748 FreePage(page, prev_page);
748 } 749 }
749 // Advance to the next page. 750 // Advance to the next page.
750 page = next_page; 751 page = next_page;
751 } 752 }
752 if (FLAG_verify_after_gc) { 753 if (FLAG_verify_after_gc) {
753 OS::PrintErr("Verifying after sweeping..."); 754 OS::PrintErr("Verifying after sweeping...");
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 return 0; 997 return 0;
997 } else { 998 } else {
998 ASSERT(total_time >= gc_time); 999 ASSERT(total_time >= gc_time);
999 int result= static_cast<int>((static_cast<double>(gc_time) / 1000 int result= static_cast<int>((static_cast<double>(gc_time) /
1000 static_cast<double>(total_time)) * 100); 1001 static_cast<double>(total_time)) * 100);
1001 return result; 1002 return result;
1002 } 1003 }
1003 } 1004 }
1004 1005
1005 } // namespace dart 1006 } // namespace dart
OLDNEW
« runtime/vm/gc_sweeper.h ('K') | « runtime/vm/gc_sweeper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698