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 "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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 PrintF("[IncrementalMarking] Hurry\n"); | 722 PrintF("[IncrementalMarking] Hurry\n"); |
723 } | 723 } |
724 } | 724 } |
725 // TODO(gc) hurry can mark objects it encounters black as mutator | 725 // TODO(gc) hurry can mark objects it encounters black as mutator |
726 // was stopped. | 726 // was stopped. |
727 ProcessMarkingDeque(); | 727 ProcessMarkingDeque(); |
728 state_ = COMPLETE; | 728 state_ = COMPLETE; |
729 if (FLAG_trace_incremental_marking || FLAG_print_cumulative_gc_stat) { | 729 if (FLAG_trace_incremental_marking || FLAG_print_cumulative_gc_stat) { |
730 double end = base::OS::TimeCurrentMillis(); | 730 double end = base::OS::TimeCurrentMillis(); |
731 double delta = end - start; | 731 double delta = end - start; |
732 heap_->AddMarkingTime(delta); | 732 heap_->tracer()->AddMarkingTime(delta); |
733 if (FLAG_trace_incremental_marking) { | 733 if (FLAG_trace_incremental_marking) { |
734 PrintF("[IncrementalMarking] Complete (hurry), spent %d ms.\n", | 734 PrintF("[IncrementalMarking] Complete (hurry), spent %d ms.\n", |
735 static_cast<int>(delta)); | 735 static_cast<int>(delta)); |
736 } | 736 } |
737 } | 737 } |
738 } | 738 } |
739 | 739 |
740 if (FLAG_cleanup_code_caches_at_gc) { | 740 if (FLAG_cleanup_code_caches_at_gc) { |
741 PolymorphicCodeCache* poly_cache = heap_->polymorphic_code_cache(); | 741 PolymorphicCodeCache* poly_cache = heap_->polymorphic_code_cache(); |
742 Marking::GreyToBlack(Marking::MarkBitFrom(poly_cache)); | 742 Marking::GreyToBlack(Marking::MarkBitFrom(poly_cache)); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 Min(kMaxMarkingSpeed, static_cast<intptr_t>(marking_speed_ * 1.3))); | 950 Min(kMaxMarkingSpeed, static_cast<intptr_t>(marking_speed_ * 1.3))); |
951 if (FLAG_trace_gc) { | 951 if (FLAG_trace_gc) { |
952 PrintPID("Marking speed increased to %d\n", marking_speed_); | 952 PrintPID("Marking speed increased to %d\n", marking_speed_); |
953 } | 953 } |
954 } | 954 } |
955 } | 955 } |
956 | 956 |
957 double end = base::OS::TimeCurrentMillis(); | 957 double end = base::OS::TimeCurrentMillis(); |
958 double duration = (end - start); | 958 double duration = (end - start); |
959 heap_->tracer()->AddIncrementalMarkingStep(duration, allocated_bytes); | 959 heap_->tracer()->AddIncrementalMarkingStep(duration, allocated_bytes); |
960 heap_->AddMarkingTime(duration); | |
961 } | 960 } |
962 } | 961 } |
963 | 962 |
964 | 963 |
965 void IncrementalMarking::ResetStepCounters() { | 964 void IncrementalMarking::ResetStepCounters() { |
966 steps_count_ = 0; | 965 steps_count_ = 0; |
967 old_generation_space_available_at_start_of_incremental_ = | 966 old_generation_space_available_at_start_of_incremental_ = |
968 SpaceLeftInOldSpace(); | 967 SpaceLeftInOldSpace(); |
969 old_generation_space_used_at_start_of_incremental_ = | 968 old_generation_space_used_at_start_of_incremental_ = |
970 heap_->PromotedTotalSize(); | 969 heap_->PromotedTotalSize(); |
971 bytes_rescanned_ = 0; | 970 bytes_rescanned_ = 0; |
972 marking_speed_ = kInitialMarkingSpeed; | 971 marking_speed_ = kInitialMarkingSpeed; |
973 bytes_scanned_ = 0; | 972 bytes_scanned_ = 0; |
974 write_barriers_invoked_since_last_step_ = 0; | 973 write_barriers_invoked_since_last_step_ = 0; |
975 } | 974 } |
976 | 975 |
977 | 976 |
978 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 977 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
979 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 978 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
980 } | 979 } |
981 | 980 |
982 } } // namespace v8::internal | 981 } } // namespace v8::internal |
OLD | NEW |