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

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

Issue 2223493002: [heap] Use smaller minimum allocation limit growing step when optimizing for memory usage. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix test Created 4 years, 4 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.h ('k') | test/mjsunit/regress/regress-crbug-500497.js » ('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 #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 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 2007
2008 2008
2009 void Heap::UnregisterArrayBuffer(JSArrayBuffer* buffer) { 2009 void Heap::UnregisterArrayBuffer(JSArrayBuffer* buffer) {
2010 ArrayBufferTracker::Unregister(this, buffer); 2010 ArrayBufferTracker::Unregister(this, buffer);
2011 } 2011 }
2012 2012
2013 2013
2014 void Heap::ConfigureInitialOldGenerationSize() { 2014 void Heap::ConfigureInitialOldGenerationSize() {
2015 if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) { 2015 if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) {
2016 old_generation_allocation_limit_ = 2016 old_generation_allocation_limit_ =
2017 Max(kMinimumOldGenerationAllocationLimit, 2017 Max(MinimumAllocationLimitGrowingStep(),
2018 static_cast<intptr_t>( 2018 static_cast<intptr_t>(
2019 static_cast<double>(old_generation_allocation_limit_) * 2019 static_cast<double>(old_generation_allocation_limit_) *
2020 (tracer()->AverageSurvivalRatio() / 100))); 2020 (tracer()->AverageSurvivalRatio() / 100)));
2021 } 2021 }
2022 } 2022 }
2023 2023
2024 2024
2025 AllocationResult Heap::AllocatePartialMap(InstanceType instance_type, 2025 AllocationResult Heap::AllocatePartialMap(InstanceType instance_type,
2026 int instance_size) { 2026 int instance_size) {
2027 Object* result = nullptr; 2027 Object* result = nullptr;
(...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after
5144 factor = Max(factor, kMinHeapGrowingFactor); 5144 factor = Max(factor, kMinHeapGrowingFactor);
5145 return factor; 5145 return factor;
5146 } 5146 }
5147 5147
5148 5148
5149 intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor, 5149 intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor,
5150 intptr_t old_gen_size) { 5150 intptr_t old_gen_size) {
5151 CHECK(factor > 1.0); 5151 CHECK(factor > 1.0);
5152 CHECK(old_gen_size > 0); 5152 CHECK(old_gen_size > 0);
5153 intptr_t limit = static_cast<intptr_t>(old_gen_size * factor); 5153 intptr_t limit = static_cast<intptr_t>(old_gen_size * factor);
5154 limit = Max(limit, old_gen_size + kMinimumOldGenerationAllocationLimit); 5154 limit = Max(limit, old_gen_size + MinimumAllocationLimitGrowingStep());
5155 limit += new_space_.Capacity(); 5155 limit += new_space_.Capacity();
5156 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; 5156 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
5157 return Min(limit, halfway_to_the_max); 5157 return Min(limit, halfway_to_the_max);
5158 } 5158 }
5159 5159
5160 5160
5161 void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size, 5161 void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
5162 double gc_speed, 5162 double gc_speed,
5163 double mutator_speed) { 5163 double mutator_speed) {
5164 double factor = HeapGrowingFactor(gc_speed, mutator_speed); 5164 double factor = HeapGrowingFactor(gc_speed, mutator_speed);
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
6461 } 6461 }
6462 6462
6463 6463
6464 // static 6464 // static
6465 int Heap::GetStaticVisitorIdForMap(Map* map) { 6465 int Heap::GetStaticVisitorIdForMap(Map* map) {
6466 return StaticVisitorBase::GetVisitorId(map); 6466 return StaticVisitorBase::GetVisitorId(map);
6467 } 6467 }
6468 6468
6469 } // namespace internal 6469 } // namespace internal
6470 } // namespace v8 6470 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | test/mjsunit/regress/regress-crbug-500497.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698