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

Unified Diff: src/heap/heap.h

Issue 2218703004: Unify memory optimization modes and flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: x 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 7493c808b8e1f7da28fb76387ba31d7e1fe5a7da..f39b89393346a148abac7c9283f09f695311ad41 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -563,6 +563,7 @@ class Heap {
static const double kMaxHeapGrowingFactor;
static const double kMaxHeapGrowingFactorMemoryConstrained;
static const double kMaxHeapGrowingFactorIdle;
+ static const double kConservativeHeapGrowingFactor;
static const double kTargetMutatorUtilization;
static const int kNoGCFlags = 0;
@@ -888,11 +889,18 @@ class Heap {
bool HasHighFragmentation();
bool HasHighFragmentation(intptr_t used, intptr_t committed);
- void SetOptimizeForLatency() { optimize_for_memory_usage_ = false; }
- void SetOptimizeForMemoryUsage();
- bool ShouldOptimizeForMemoryUsage() {
- return optimize_for_memory_usage_ || HighMemoryPressure();
+ void ActivateMemoryReducerIfNeeded();
+
+ bool ShouldOptimizeForMemoryUsage();
+
+ bool IsLowMemoryDevice() {
+ return max_old_generation_size_ <= kMaxOldSpaceSizeLowMemoryDevice;
+ }
+
+ bool IsMemoryConstrainedDevice() {
+ return max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice;
}
+
bool HighMemoryPressure() {
return memory_pressure_level_.Value() != MemoryPressureLevel::kNone;
}
@@ -2119,10 +2127,6 @@ class Heap {
// last GC.
bool old_gen_exhausted_;
- // Indicates that memory usage is more important than latency.
- // TODO(ulan): Merge it with memory reducer once chromium:490559 is fixed.
- bool optimize_for_memory_usage_;
-
// Indicates that inline bump-pointer allocation has been globally disabled
// for all spaces. This is used to disable allocations in generated code.
bool inline_allocation_disabled_;
« no previous file with comments | « src/api.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698