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

Side by Side Diff: src/incremental-marking.cc

Issue 396443004: Remove sequential sweeping mode and perform lazy sweeping when no sweeper threads are active. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« no previous file with comments | « src/heap.cc ('k') | src/isolate.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/incremental-marking.h" 7 #include "src/incremental-marking.h"
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 529 }
530 ASSERT(FLAG_incremental_marking); 530 ASSERT(FLAG_incremental_marking);
531 ASSERT(FLAG_incremental_marking_steps); 531 ASSERT(FLAG_incremental_marking_steps);
532 ASSERT(state_ == STOPPED); 532 ASSERT(state_ == STOPPED);
533 ASSERT(heap_->gc_state() == Heap::NOT_IN_GC); 533 ASSERT(heap_->gc_state() == Heap::NOT_IN_GC);
534 ASSERT(!heap_->isolate()->serializer_enabled()); 534 ASSERT(!heap_->isolate()->serializer_enabled());
535 ASSERT(heap_->isolate()->IsInitialized()); 535 ASSERT(heap_->isolate()->IsInitialized());
536 536
537 ResetStepCounters(); 537 ResetStepCounters();
538 538
539 if (!heap_->mark_compact_collector()->IsConcurrentSweepingInProgress()) { 539 if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
540 StartMarking(flag); 540 StartMarking(flag);
541 } else { 541 } else {
542 if (FLAG_trace_incremental_marking) { 542 if (FLAG_trace_incremental_marking) {
543 PrintF("[IncrementalMarking] Start sweeping.\n"); 543 PrintF("[IncrementalMarking] Start sweeping.\n");
544 } 544 }
545 state_ = SWEEPING; 545 state_ = SWEEPING;
546 } 546 }
547 547
548 heap_->new_space()->LowerInlineAllocationLimit(kAllocatedThreshold); 548 heap_->new_space()->LowerInlineAllocationLimit(kAllocatedThreshold);
549 } 549 }
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 bytes_scanned_ += bytes_to_process; 876 bytes_scanned_ += bytes_to_process;
877 877
878 double start = 0; 878 double start = 0;
879 879
880 if (FLAG_trace_incremental_marking || FLAG_trace_gc || 880 if (FLAG_trace_incremental_marking || FLAG_trace_gc ||
881 FLAG_print_cumulative_gc_stat) { 881 FLAG_print_cumulative_gc_stat) {
882 start = base::OS::TimeCurrentMillis(); 882 start = base::OS::TimeCurrentMillis();
883 } 883 }
884 884
885 if (state_ == SWEEPING) { 885 if (state_ == SWEEPING) {
886 if (heap_->mark_compact_collector()->IsConcurrentSweepingInProgress() && 886 if (heap_->mark_compact_collector()->sweeping_in_progress() &&
887 heap_->mark_compact_collector()->IsSweepingCompleted()) { 887 heap_->mark_compact_collector()->IsSweepingCompleted()) {
888 heap_->mark_compact_collector()->WaitUntilSweepingCompleted(); 888 heap_->mark_compact_collector()->EnsureSweepingCompleted();
889 } 889 }
890 if (!heap_->mark_compact_collector()->IsConcurrentSweepingInProgress()) { 890 if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
891 bytes_scanned_ = 0; 891 bytes_scanned_ = 0;
892 StartMarking(PREVENT_COMPACTION); 892 StartMarking(PREVENT_COMPACTION);
893 } 893 }
894 } else if (state_ == MARKING) { 894 } else if (state_ == MARKING) {
895 ProcessMarkingDeque(bytes_to_process); 895 ProcessMarkingDeque(bytes_to_process);
896 if (marking_deque_.IsEmpty()) MarkingComplete(action); 896 if (marking_deque_.IsEmpty()) MarkingComplete(action);
897 } 897 }
898 898
899 steps_count_++; 899 steps_count_++;
900 steps_count_since_last_gc_++; 900 steps_count_since_last_gc_++;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 bytes_scanned_ = 0; 989 bytes_scanned_ = 0;
990 write_barriers_invoked_since_last_step_ = 0; 990 write_barriers_invoked_since_last_step_ = 0;
991 } 991 }
992 992
993 993
994 int64_t IncrementalMarking::SpaceLeftInOldSpace() { 994 int64_t IncrementalMarking::SpaceLeftInOldSpace() {
995 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); 995 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects();
996 } 996 }
997 997
998 } } // namespace v8::internal 998 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698