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

Unified Diff: test/unittests/heap/heap-unittest.cc

Issue 2895473003: [heap] Simplify and scale ResourceConstraints::ConfigureDefaults. (Closed)
Patch Set: rename Created 3 years, 7 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/zone/accounting-allocator.h ('k') | test/unittests/zone/segmentpool-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/heap/heap-unittest.cc
diff --git a/test/unittests/heap/heap-unittest.cc b/test/unittests/heap/heap-unittest.cc
index b738b44e835054df0c3803f634077ce80a8831fa..d378782fbb723b99a96f9f3ff6df36e48f30209d 100644
--- a/test/unittests/heap/heap-unittest.cc
+++ b/test/unittests/heap/heap-unittest.cc
@@ -45,5 +45,37 @@ TEST(Heap, HeapGrowingFactor) {
Heap::HeapGrowingFactor(400, 1));
}
+TEST(Heap, SemiSpaceSize) {
+ uint64_t configurations[][2] = {
+ {0, 1 * i::Heap::kPointerMultiplier},
+ {512 * i::MB, 1 * i::Heap::kPointerMultiplier},
+ {1 * i::GB, 3 * i::Heap::kPointerMultiplier},
+ {2 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize},
+ {4 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize},
+ {8 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize}};
+
+ for (auto configuration : configurations) {
+ ASSERT_EQ(configuration[1],
+ static_cast<uint64_t>(
+ i::Heap::ComputeMaxSemiSpaceSize(configuration[0])));
+ }
+}
+
+TEST(Heap, OldGenerationSize) {
+ uint64_t configurations[][2] = {
+ {0, i::Heap::kMinOldSpaceSize},
+ {512, i::Heap::kMinOldSpaceSize},
+ {1 * i::GB, 256 * i::Heap::kPointerMultiplier},
+ {2 * static_cast<uint64_t>(i::GB), 512 * i::Heap::kPointerMultiplier},
+ {4 * static_cast<uint64_t>(i::GB), i::Heap::kMaxOldSpaceSize},
+ {8 * static_cast<uint64_t>(i::GB), i::Heap::kMaxOldSpaceSize}};
+
+ for (auto configuration : configurations) {
+ ASSERT_EQ(configuration[1],
+ static_cast<uint64_t>(
+ i::Heap::ComputeMaxOldGenerationSize(configuration[0])));
+ }
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/zone/accounting-allocator.h ('k') | test/unittests/zone/segmentpool-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698