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/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include <unordered_map> | 7 #include <unordered_map> |
8 #include <unordered_set> | 8 #include <unordered_set> |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 5526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5537 } | 5537 } |
5538 | 5538 |
5539 // This function returns either kNoLimit, kSoftLimit, or kHardLimit. | 5539 // This function returns either kNoLimit, kSoftLimit, or kHardLimit. |
5540 // The kNoLimit means that either incremental marking is disabled or it is too | 5540 // The kNoLimit means that either incremental marking is disabled or it is too |
5541 // early to start incremental marking. | 5541 // early to start incremental marking. |
5542 // The kSoftLimit means that incremental marking should be started soon. | 5542 // The kSoftLimit means that incremental marking should be started soon. |
5543 // The kHardLimit means that incremental marking should be started immediately. | 5543 // The kHardLimit means that incremental marking should be started immediately. |
5544 Heap::IncrementalMarkingLimit Heap::IncrementalMarkingLimitReached() { | 5544 Heap::IncrementalMarkingLimit Heap::IncrementalMarkingLimitReached() { |
5545 // Code using an AlwaysAllocateScope assumes that the GC state does not | 5545 // Code using an AlwaysAllocateScope assumes that the GC state does not |
5546 // change; that implies that no marking steps must be performed. | 5546 // change; that implies that no marking steps must be performed. |
5547 if (!incremental_marking()->CanBeActivated() || always_allocate() || | 5547 if (!incremental_marking()->CanBeActivated() || always_allocate()) { |
5548 PromotedSpaceSizeOfObjects() <= | |
5549 IncrementalMarking::kActivationThreshold) { | |
5550 // Incremental marking is disabled or it is too early to start. | 5548 // Incremental marking is disabled or it is too early to start. |
5551 return IncrementalMarkingLimit::kNoLimit; | 5549 return IncrementalMarkingLimit::kNoLimit; |
5552 } | 5550 } |
| 5551 if (FLAG_stress_incremental_marking) { |
| 5552 return IncrementalMarkingLimit::kHardLimit; |
| 5553 } |
| 5554 if (PromotedSpaceSizeOfObjects() <= |
| 5555 IncrementalMarking::kActivationThreshold) { |
| 5556 // Incremental marking is disabled or it is too early to start. |
| 5557 return IncrementalMarkingLimit::kNoLimit; |
| 5558 } |
5553 if ((FLAG_stress_compaction && (gc_count_ & 1) != 0) || | 5559 if ((FLAG_stress_compaction && (gc_count_ & 1) != 0) || |
5554 HighMemoryPressure()) { | 5560 HighMemoryPressure()) { |
5555 // If there is high memory pressure or stress testing is enabled, then | 5561 // If there is high memory pressure or stress testing is enabled, then |
5556 // start marking immediately. | 5562 // start marking immediately. |
5557 return IncrementalMarkingLimit::kHardLimit; | 5563 return IncrementalMarkingLimit::kHardLimit; |
5558 } | 5564 } |
5559 size_t old_generation_space_available = OldGenerationSpaceAvailable(); | 5565 size_t old_generation_space_available = OldGenerationSpaceAvailable(); |
5560 if (old_generation_space_available > new_space_->Capacity()) { | 5566 if (old_generation_space_available > new_space_->Capacity()) { |
5561 return IncrementalMarkingLimit::kNoLimit; | 5567 return IncrementalMarkingLimit::kNoLimit; |
5562 } | 5568 } |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6572 case LO_SPACE: | 6578 case LO_SPACE: |
6573 return "LO_SPACE"; | 6579 return "LO_SPACE"; |
6574 default: | 6580 default: |
6575 UNREACHABLE(); | 6581 UNREACHABLE(); |
6576 } | 6582 } |
6577 return NULL; | 6583 return NULL; |
6578 } | 6584 } |
6579 | 6585 |
6580 } // namespace internal | 6586 } // namespace internal |
6581 } // namespace v8 | 6587 } // namespace v8 |
OLD | NEW |