OLD | NEW |
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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "incremental-marking.h" | 7 #include "incremental-marking.h" |
8 | 8 |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "compilation-cache.h" | 10 #include "compilation-cache.h" |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 bytes_scanned_ += bytes_to_process; | 879 bytes_scanned_ += bytes_to_process; |
880 | 880 |
881 double start = 0; | 881 double start = 0; |
882 | 882 |
883 if (FLAG_trace_incremental_marking || FLAG_trace_gc || | 883 if (FLAG_trace_incremental_marking || FLAG_trace_gc || |
884 FLAG_print_cumulative_gc_stat) { | 884 FLAG_print_cumulative_gc_stat) { |
885 start = OS::TimeCurrentMillis(); | 885 start = OS::TimeCurrentMillis(); |
886 } | 886 } |
887 | 887 |
888 if (state_ == SWEEPING) { | 888 if (state_ == SWEEPING) { |
| 889 if (heap_->mark_compact_collector()->IsConcurrentSweepingInProgress() && |
| 890 heap_->mark_compact_collector()->IsSweepingCompleted()) { |
| 891 heap_->mark_compact_collector()->WaitUntilSweepingCompleted(); |
| 892 } |
889 if (!heap_->mark_compact_collector()->IsConcurrentSweepingInProgress()) { | 893 if (!heap_->mark_compact_collector()->IsConcurrentSweepingInProgress()) { |
890 bytes_scanned_ = 0; | 894 bytes_scanned_ = 0; |
891 StartMarking(PREVENT_COMPACTION); | 895 StartMarking(PREVENT_COMPACTION); |
892 } | 896 } |
893 } else if (state_ == MARKING) { | 897 } else if (state_ == MARKING) { |
894 ProcessMarkingDeque(bytes_to_process); | 898 ProcessMarkingDeque(bytes_to_process); |
895 if (marking_deque_.IsEmpty()) MarkingComplete(action); | 899 if (marking_deque_.IsEmpty()) MarkingComplete(action); |
896 } | 900 } |
897 | 901 |
898 steps_count_++; | 902 steps_count_++; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 bytes_scanned_ = 0; | 992 bytes_scanned_ = 0; |
989 write_barriers_invoked_since_last_step_ = 0; | 993 write_barriers_invoked_since_last_step_ = 0; |
990 } | 994 } |
991 | 995 |
992 | 996 |
993 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 997 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
994 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 998 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
995 } | 999 } |
996 | 1000 |
997 } } // namespace v8::internal | 1001 } } // namespace v8::internal |
OLD | NEW |