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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 marking_speed_ += kMarkingSpeedAccelleration; | 948 marking_speed_ += kMarkingSpeedAccelleration; |
949 marking_speed_ = static_cast<int>( | 949 marking_speed_ = static_cast<int>( |
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 delta = (end - start); | 958 double duration = (end - start); |
959 heap_->tracer()->AddIncrementalMarkingStep(delta); | 959 heap_->tracer()->AddIncrementalMarkingStep(duration, allocated_bytes); |
960 heap_->AddMarkingTime(delta); | 960 heap_->AddMarkingTime(duration); |
961 } | 961 } |
962 } | 962 } |
963 | 963 |
964 | 964 |
965 void IncrementalMarking::ResetStepCounters() { | 965 void IncrementalMarking::ResetStepCounters() { |
966 steps_count_ = 0; | 966 steps_count_ = 0; |
967 old_generation_space_available_at_start_of_incremental_ = | 967 old_generation_space_available_at_start_of_incremental_ = |
968 SpaceLeftInOldSpace(); | 968 SpaceLeftInOldSpace(); |
969 old_generation_space_used_at_start_of_incremental_ = | 969 old_generation_space_used_at_start_of_incremental_ = |
970 heap_->PromotedTotalSize(); | 970 heap_->PromotedTotalSize(); |
971 bytes_rescanned_ = 0; | 971 bytes_rescanned_ = 0; |
972 marking_speed_ = kInitialMarkingSpeed; | 972 marking_speed_ = kInitialMarkingSpeed; |
973 bytes_scanned_ = 0; | 973 bytes_scanned_ = 0; |
974 write_barriers_invoked_since_last_step_ = 0; | 974 write_barriers_invoked_since_last_step_ = 0; |
975 } | 975 } |
976 | 976 |
977 | 977 |
978 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 978 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
979 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 979 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
980 } | 980 } |
981 | 981 |
982 } } // namespace v8::internal | 982 } } // namespace v8::internal |
OLD | NEW |