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 // If there is high memory pressure or stress testing is enabled, then | |
5553 // start marking immediately. | |
Hannes Payer (out of office)
2017/05/29 08:46:21
This is unrelated of memory pressure.
ulan
2017/05/29 09:06:00
Left-over comment, removed.
| |
5554 return IncrementalMarkingLimit::kHardLimit; | |
5555 } | |
5556 if (PromotedSpaceSizeOfObjects() <= | |
5557 IncrementalMarking::kActivationThreshold) { | |
5558 // Incremental marking is disabled or it is too early to start. | |
5559 return IncrementalMarkingLimit::kNoLimit; | |
5560 } | |
5553 if ((FLAG_stress_compaction && (gc_count_ & 1) != 0) || | 5561 if ((FLAG_stress_compaction && (gc_count_ & 1) != 0) || |
5554 HighMemoryPressure()) { | 5562 HighMemoryPressure()) { |
5555 // If there is high memory pressure or stress testing is enabled, then | 5563 // If there is high memory pressure or stress testing is enabled, then |
5556 // start marking immediately. | 5564 // start marking immediately. |
5557 return IncrementalMarkingLimit::kHardLimit; | 5565 return IncrementalMarkingLimit::kHardLimit; |
5558 } | 5566 } |
5559 size_t old_generation_space_available = OldGenerationSpaceAvailable(); | 5567 size_t old_generation_space_available = OldGenerationSpaceAvailable(); |
5560 if (old_generation_space_available > new_space_->Capacity()) { | 5568 if (old_generation_space_available > new_space_->Capacity()) { |
5561 return IncrementalMarkingLimit::kNoLimit; | 5569 return IncrementalMarkingLimit::kNoLimit; |
5562 } | 5570 } |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6572 case LO_SPACE: | 6580 case LO_SPACE: |
6573 return "LO_SPACE"; | 6581 return "LO_SPACE"; |
6574 default: | 6582 default: |
6575 UNREACHABLE(); | 6583 UNREACHABLE(); |
6576 } | 6584 } |
6577 return NULL; | 6585 return NULL; |
6578 } | 6586 } |
6579 | 6587 |
6580 } // namespace internal | 6588 } // namespace internal |
6581 } // namespace v8 | 6589 } // namespace v8 |
OLD | NEW |