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

Side by Side Diff: src/heap/heap.cc

Issue 2583033003: [heap] Use RAIL mode for starting incremental marking. (Closed)
Patch Set: adjust constant Created 4 years 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.h ('k') | no next file » | 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 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/context-slot-cache.h" 9 #include "src/ast/context-slot-cache.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 5290 matching lines...) Expand 10 before | Expand all | Expand 10 after
5301 "new limit: %" PRIuS " KB (%.1f)\n", 5301 "new limit: %" PRIuS " KB (%.1f)\n",
5302 old_gen_size / KB, old_generation_allocation_limit_ / KB, limit / KB, 5302 old_gen_size / KB, old_generation_allocation_limit_ / KB, limit / KB,
5303 factor); 5303 factor);
5304 } 5304 }
5305 old_generation_allocation_limit_ = limit; 5305 old_generation_allocation_limit_ = limit;
5306 } 5306 }
5307 } 5307 }
5308 5308
5309 bool Heap::ShouldOptimizeForLoadTime() { 5309 bool Heap::ShouldOptimizeForLoadTime() {
5310 return isolate()->rail_mode() == PERFORMANCE_LOAD && 5310 return isolate()->rail_mode() == PERFORMANCE_LOAD &&
5311 PromotedTotalSize() < initial_old_generation_size_ && 5311 !AllocationLimitOvershotByLargeMargin() &&
5312 MonotonicallyIncreasingTimeInMs() < 5312 MonotonicallyIncreasingTimeInMs() <
5313 isolate()->LoadStartTimeMs() + kMaxLoadTimeMs; 5313 isolate()->LoadStartTimeMs() + kMaxLoadTimeMs;
5314 } 5314 }
5315 5315
5316 // This predicate is called when an old generation space cannot allocated from 5316 // This predicate is called when an old generation space cannot allocated from
5317 // the free list and is about to add a new page. Returning false will cause a 5317 // the free list and is about to add a new page. Returning false will cause a
5318 // major GC. It happens when the old generation allocation limit is reached and 5318 // major GC. It happens when the old generation allocation limit is reached and
5319 // - either we need to optimize for memory usage, 5319 // - either we need to optimize for memory usage,
5320 // - or the incremental marking is not in progress and we cannot start it. 5320 // - or the incremental marking is not in progress and we cannot start it.
5321 bool Heap::ShouldExpandOldGenerationOnSlowAllocation() { 5321 bool Heap::ShouldExpandOldGenerationOnSlowAllocation() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5353 if ((FLAG_stress_compaction && (gc_count_ & 1) != 0) || 5353 if ((FLAG_stress_compaction && (gc_count_ & 1) != 0) ||
5354 HighMemoryPressure()) { 5354 HighMemoryPressure()) {
5355 // If there is high memory pressure or stress testing is enabled, then 5355 // If there is high memory pressure or stress testing is enabled, then
5356 // start marking immediately. 5356 // start marking immediately.
5357 return IncrementalMarkingLimit::kHardLimit; 5357 return IncrementalMarkingLimit::kHardLimit;
5358 } 5358 }
5359 size_t old_generation_space_available = OldGenerationSpaceAvailable(); 5359 size_t old_generation_space_available = OldGenerationSpaceAvailable();
5360 if (old_generation_space_available > new_space_->Capacity()) { 5360 if (old_generation_space_available > new_space_->Capacity()) {
5361 return IncrementalMarkingLimit::kNoLimit; 5361 return IncrementalMarkingLimit::kNoLimit;
5362 } 5362 }
5363 // We are close to the allocation limit. 5363 if (ShouldOptimizeForMemoryUsage()) {
5364 // Choose between the hard and the soft limits. 5364 return IncrementalMarkingLimit::kHardLimit;
5365 if (old_generation_space_available == 0 || ShouldOptimizeForMemoryUsage()) { 5365 }
5366 if (ShouldOptimizeForLoadTime()) {
5367 return IncrementalMarkingLimit::kNoLimit;
5368 }
5369 if (old_generation_space_available == 0) {
5366 return IncrementalMarkingLimit::kHardLimit; 5370 return IncrementalMarkingLimit::kHardLimit;
5367 } 5371 }
5368 return IncrementalMarkingLimit::kSoftLimit; 5372 return IncrementalMarkingLimit::kSoftLimit;
5369 } 5373 }
5370 5374
5371 void Heap::EnableInlineAllocation() { 5375 void Heap::EnableInlineAllocation() {
5372 if (!inline_allocation_disabled_) return; 5376 if (!inline_allocation_disabled_) return;
5373 inline_allocation_disabled_ = false; 5377 inline_allocation_disabled_ = false;
5374 5378
5375 // Update inline allocation limit for new space. 5379 // Update inline allocation limit for new space.
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
6501 } 6505 }
6502 6506
6503 6507
6504 // static 6508 // static
6505 int Heap::GetStaticVisitorIdForMap(Map* map) { 6509 int Heap::GetStaticVisitorIdForMap(Map* map) {
6506 return StaticVisitorBase::GetVisitorId(map); 6510 return StaticVisitorBase::GetVisitorId(map);
6507 } 6511 }
6508 6512
6509 } // namespace internal 6513 } // namespace internal
6510 } // namespace v8 6514 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698