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

Side by Side Diff: src/heap.cc

Issue 6970004: Introduce lazy sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 #endif 471 #endif
472 472
473 if (collector == SCAVENGER && !incremental_marking()->IsStopped()) { 473 if (collector == SCAVENGER && !incremental_marking()->IsStopped()) {
474 if (FLAG_trace_incremental_marking) { 474 if (FLAG_trace_incremental_marking) {
475 PrintF("[IncrementalMarking] Scavenge during marking.\n"); 475 PrintF("[IncrementalMarking] Scavenge during marking.\n");
476 } 476 }
477 } 477 }
478 478
479 if (collector == MARK_COMPACTOR && 479 if (collector == MARK_COMPACTOR &&
480 !mark_compact_collector()->PreciseSweepingRequired() && 480 !mark_compact_collector()->PreciseSweepingRequired() &&
481 incremental_marking()->IsMarking() && 481 incremental_marking()->IsMarkingIncomplete() &&
482 !incremental_marking()->should_hurry() && 482 !incremental_marking()->should_hurry() &&
483 FLAG_incremental_marking_steps) { 483 FLAG_incremental_marking_steps) {
484 if (FLAG_trace_incremental_marking) { 484 if (FLAG_trace_incremental_marking) {
485 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); 485 PrintF("[IncrementalMarking] Delaying MarkSweep.\n");
486 } 486 }
487 collector = SCAVENGER; 487 collector = SCAVENGER;
488 } 488 }
489 489
490 bool next_gc_likely_to_collect_more = false; 490 bool next_gc_likely_to_collect_more = false;
491 491
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 996
997 // Used for updating survived_since_last_expansion_ at function end. 997 // Used for updating survived_since_last_expansion_ at function end.
998 intptr_t survived_watermark = PromotedSpaceSize(); 998 intptr_t survived_watermark = PromotedSpaceSize();
999 999
1000 CheckNewSpaceExpansionCriteria(); 1000 CheckNewSpaceExpansionCriteria();
1001 1001
1002 SelectScavengingVisitorsTable(); 1002 SelectScavengingVisitorsTable();
1003 1003
1004 incremental_marking()->PrepareForScavenge(); 1004 incremental_marking()->PrepareForScavenge();
1005 1005
1006 old_pointer_space()->AdvanceSweeper(new_space_.Size());
1007 old_data_space()->AdvanceSweeper(new_space_.Size());
1008
1006 // Flip the semispaces. After flipping, to space is empty, from space has 1009 // Flip the semispaces. After flipping, to space is empty, from space has
1007 // live objects. 1010 // live objects.
1008 new_space_.Flip(); 1011 new_space_.Flip();
1009 new_space_.ResetAllocationInfo(); 1012 new_space_.ResetAllocationInfo();
1010 1013
1011 // We need to sweep newly copied objects which can be either in the 1014 // We need to sweep newly copied objects which can be either in the
1012 // to space or promoted to the old generation. For to-space 1015 // to space or promoted to the old generation. For to-space
1013 // objects, we treat the bottom of the to space as a queue. Newly 1016 // objects, we treat the bottom of the to space as a queue. Newly
1014 // copied and unswept objects lie between a 'front' mark and the 1017 // copied and unswept objects lie between a 'front' mark and the
1015 // allocation pointer. 1018 // allocation pointer.
(...skipping 4878 matching lines...) Expand 10 before | Expand all | Expand 10 after
5894 } 5897 }
5895 5898
5896 5899
5897 void ExternalStringTable::TearDown() { 5900 void ExternalStringTable::TearDown() {
5898 new_space_strings_.Free(); 5901 new_space_strings_.Free();
5899 old_space_strings_.Free(); 5902 old_space_strings_.Free();
5900 } 5903 }
5901 5904
5902 5905
5903 } } // namespace v8::internal 5906 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/incremental-marking.h » ('j') | src/incremental-marking.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698