Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: src/heap/heap-inl.h

Issue 2375983002: Revert of [heap] New heuristics for starting of incremental marking. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/incremental-marking.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_HEAP_HEAP_INL_H_ 5 #ifndef V8_HEAP_HEAP_INL_H_
6 #define V8_HEAP_HEAP_INL_H_ 6 #define V8_HEAP_HEAP_INL_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 Address* Heap::OldSpaceAllocationTopAddress() { 164 Address* Heap::OldSpaceAllocationTopAddress() {
165 return old_space_->allocation_top_address(); 165 return old_space_->allocation_top_address();
166 } 166 }
167 167
168 Address* Heap::OldSpaceAllocationLimitAddress() { 168 Address* Heap::OldSpaceAllocationLimitAddress() {
169 return old_space_->allocation_limit_address(); 169 return old_space_->allocation_limit_address();
170 } 170 }
171 171
172 bool Heap::HeapIsFullEnoughToStartIncrementalMarking(intptr_t limit) {
173 if (FLAG_stress_compaction && (gc_count_ & 1) != 0) return true;
174
175 intptr_t adjusted_allocation_limit = limit - new_space_->Capacity();
176
177 if (PromotedTotalSize() >= adjusted_allocation_limit) return true;
178
179 if (HighMemoryPressure()) return true;
180
181 return false;
182 }
183
172 void Heap::UpdateNewSpaceAllocationCounter() { 184 void Heap::UpdateNewSpaceAllocationCounter() {
173 new_space_allocation_counter_ = NewSpaceAllocationCounter(); 185 new_space_allocation_counter_ = NewSpaceAllocationCounter();
174 } 186 }
175 187
176 size_t Heap::NewSpaceAllocationCounter() { 188 size_t Heap::NewSpaceAllocationCounter() {
177 return new_space_allocation_counter_ + new_space()->AllocatedSinceLastGC(); 189 return new_space_allocation_counter_ + new_space()->AllocatedSinceLastGC();
178 } 190 }
179 191
180 template <> 192 template <>
181 bool inline Heap::IsOneByte(Vector<const char> str, int chars) { 193 bool inline Heap::IsOneByte(Vector<const char> str, int chars) {
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 bool Heap::InOldSpace(Object* object) { return old_space_->Contains(object); } 485 bool Heap::InOldSpace(Object* object) { return old_space_->Contains(object); }
474 486
475 bool Heap::InNewSpaceSlow(Address address) { 487 bool Heap::InNewSpaceSlow(Address address) {
476 return new_space_->ContainsSlow(address); 488 return new_space_->ContainsSlow(address);
477 } 489 }
478 490
479 bool Heap::InOldSpaceSlow(Address address) { 491 bool Heap::InOldSpaceSlow(Address address) {
480 return old_space_->ContainsSlow(address); 492 return old_space_->ContainsSlow(address);
481 } 493 }
482 494
495 bool Heap::OldGenerationAllocationLimitReached() {
496 if (!incremental_marking()->IsStopped() && !ShouldOptimizeForMemoryUsage()) {
497 return false;
498 }
499 return OldGenerationSpaceAvailable() < 0;
500 }
501
483 template <PromotionMode promotion_mode> 502 template <PromotionMode promotion_mode>
484 bool Heap::ShouldBePromoted(Address old_address, int object_size) { 503 bool Heap::ShouldBePromoted(Address old_address, int object_size) {
485 if (promotion_mode == PROMOTE_MARKED) { 504 if (promotion_mode == PROMOTE_MARKED) {
486 MarkBit mark_bit = ObjectMarking::MarkBitFrom(old_address); 505 MarkBit mark_bit = ObjectMarking::MarkBitFrom(old_address);
487 if (!Marking::IsWhite(mark_bit)) { 506 if (!Marking::IsWhite(mark_bit)) {
488 return true; 507 return true;
489 } 508 }
490 } 509 }
491 510
492 return Page::FromAddress(old_address)->InIntermediateGeneration(); 511 return Page::FromAddress(old_address)->InIntermediateGeneration();
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 849
831 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { 850 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) {
832 for (Object** current = start; current < end; current++) { 851 for (Object** current = start; current < end; current++) {
833 CHECK((*current)->IsSmi()); 852 CHECK((*current)->IsSmi());
834 } 853 }
835 } 854 }
836 } // namespace internal 855 } // namespace internal
837 } // namespace v8 856 } // namespace v8
838 857
839 #endif // V8_HEAP_HEAP_INL_H_ 858 #endif // V8_HEAP_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698