Commit eeb4f28a authored by ulan's avatar ulan Committed by Commit bot

Revert of [heap] Decouple old generation allocation limit from external...

Revert of [heap] Decouple old generation allocation limit from external memory. (patchset #1 id:1 of https://codereview.chromium.org/2329993002/ )

Reason for revert:
Regressions in telemetry benchmarks:
crbug.com/646819.

Original issue's description:
> [heap] Decouple old generation allocation limit from external memory.
>
> We check for external memory limit in Heap::ReportExternalMemoryPressure.
>
> BUG=chromium:616434
>
> Committed: https://crrev.com/672d079ccba686019fa1457c83b42c2e692ef88b
> Cr-Commit-Position: refs/heads/master@{#39374}

TBR=hpayer@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:616434

Review-Url: https://codereview.chromium.org/2339033005
Cr-Commit-Position: refs/heads/master@{#39442}
parent f84f45f9
...@@ -192,7 +192,7 @@ bool Heap::HeapIsFullEnoughToStartIncrementalMarking(intptr_t limit) { ...@@ -192,7 +192,7 @@ bool Heap::HeapIsFullEnoughToStartIncrementalMarking(intptr_t limit) {
intptr_t adjusted_allocation_limit = limit - new_space_->Capacity(); intptr_t adjusted_allocation_limit = limit - new_space_->Capacity();
if (PromotedSpaceSizeOfObjects() >= adjusted_allocation_limit) return true; if (PromotedTotalSize() >= adjusted_allocation_limit) return true;
if (HighMemoryPressure()) return true; if (HighMemoryPressure()) return true;
......
...@@ -1353,6 +1353,16 @@ class Heap { ...@@ -1353,6 +1353,16 @@ class Heap {
survived_since_last_expansion_ += survived; survived_since_last_expansion_ += survived;
} }
inline intptr_t PromotedTotalSize() {
int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
if (total > std::numeric_limits<intptr_t>::max()) {
// TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations.
return std::numeric_limits<intptr_t>::max();
}
if (total < 0) return 0;
return static_cast<intptr_t>(total);
}
inline void UpdateNewSpaceAllocationCounter(); inline void UpdateNewSpaceAllocationCounter();
inline size_t NewSpaceAllocationCounter(); inline size_t NewSpaceAllocationCounter();
...@@ -1795,7 +1805,7 @@ class Heap { ...@@ -1795,7 +1805,7 @@ class Heap {
// =========================================================================== // ===========================================================================
inline intptr_t OldGenerationSpaceAvailable() { inline intptr_t OldGenerationSpaceAvailable() {
return old_generation_allocation_limit_ - PromotedSpaceSizeOfObjects(); return old_generation_allocation_limit_ - PromotedTotalSize();
} }
// Returns maximum GC pause. // Returns maximum GC pause.
......
...@@ -1112,7 +1112,7 @@ void IncrementalMarking::SpeedUp() { ...@@ -1112,7 +1112,7 @@ void IncrementalMarking::SpeedUp() {
} }
bool size_of_old_space_multiplied_by_n_during_marking = bool size_of_old_space_multiplied_by_n_during_marking =
(heap_->PromotedSpaceSizeOfObjects() > (heap_->PromotedTotalSize() >
(marking_speed_ + 1) * (marking_speed_ + 1) *
old_generation_space_used_at_start_of_incremental_); old_generation_space_used_at_start_of_incremental_);
if (size_of_old_space_multiplied_by_n_during_marking) { if (size_of_old_space_multiplied_by_n_during_marking) {
...@@ -1125,7 +1125,7 @@ void IncrementalMarking::SpeedUp() { ...@@ -1125,7 +1125,7 @@ void IncrementalMarking::SpeedUp() {
} }
int64_t promoted_during_marking = int64_t promoted_during_marking =
heap_->PromotedSpaceSizeOfObjects() - heap_->PromotedTotalSize() -
old_generation_space_used_at_start_of_incremental_; old_generation_space_used_at_start_of_incremental_;
intptr_t delay = marking_speed_ * MB; intptr_t delay = marking_speed_ * MB;
intptr_t scavenge_slack = heap_->MaxSemiSpaceSize(); intptr_t scavenge_slack = heap_->MaxSemiSpaceSize();
...@@ -1300,7 +1300,7 @@ void IncrementalMarking::ResetStepCounters() { ...@@ -1300,7 +1300,7 @@ void IncrementalMarking::ResetStepCounters() {
old_generation_space_available_at_start_of_incremental_ = old_generation_space_available_at_start_of_incremental_ =
SpaceLeftInOldSpace(); SpaceLeftInOldSpace();
old_generation_space_used_at_start_of_incremental_ = old_generation_space_used_at_start_of_incremental_ =
heap_->PromotedSpaceSizeOfObjects(); heap_->PromotedTotalSize();
bytes_rescanned_ = 0; bytes_rescanned_ = 0;
marking_speed_ = kInitialMarkingSpeed; marking_speed_ = kInitialMarkingSpeed;
bytes_scanned_ = 0; bytes_scanned_ = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment