Commit 672d079c authored by ulan's avatar ulan Committed by Commit bot

[heap] Decouple old generation allocation limit from external memory.

We check for external memory limit in Heap::ReportExternalMemoryPressure.

BUG=chromium:616434

Review-Url: https://codereview.chromium.org/2329993002
Cr-Commit-Position: refs/heads/master@{#39374}
parent 069fcf4c
...@@ -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 (PromotedTotalSize() >= adjusted_allocation_limit) return true; if (PromotedSpaceSizeOfObjects() >= adjusted_allocation_limit) return true;
if (HighMemoryPressure()) return true; if (HighMemoryPressure()) return true;
......
...@@ -1352,16 +1352,6 @@ class Heap { ...@@ -1352,16 +1352,6 @@ 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();
...@@ -1804,7 +1794,7 @@ class Heap { ...@@ -1804,7 +1794,7 @@ class Heap {
// =========================================================================== // ===========================================================================
inline intptr_t OldGenerationSpaceAvailable() { inline intptr_t OldGenerationSpaceAvailable() {
return old_generation_allocation_limit_ - PromotedTotalSize(); return old_generation_allocation_limit_ - PromotedSpaceSizeOfObjects();
} }
// Returns maximum GC pause. // Returns maximum GC pause.
......
...@@ -1102,7 +1102,7 @@ void IncrementalMarking::SpeedUp() { ...@@ -1102,7 +1102,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_->PromotedTotalSize() > (heap_->PromotedSpaceSizeOfObjects() >
(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) {
...@@ -1115,7 +1115,7 @@ void IncrementalMarking::SpeedUp() { ...@@ -1115,7 +1115,7 @@ void IncrementalMarking::SpeedUp() {
} }
int64_t promoted_during_marking = int64_t promoted_during_marking =
heap_->PromotedTotalSize() - heap_->PromotedSpaceSizeOfObjects() -
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();
...@@ -1290,7 +1290,7 @@ void IncrementalMarking::ResetStepCounters() { ...@@ -1290,7 +1290,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_->PromotedTotalSize(); heap_->PromotedSpaceSizeOfObjects();
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