diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-12-04 08:20:37 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-12-06 15:23:33 +0100 |
commit | 9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3 (patch) | |
tree | 2b0c843168dafb939d8df8a15b2aa72b76dee51d /deps/v8/test/unittests/heap/heap-controller-unittest.cc | |
parent | b8fbe69db1292307adb2c2b2e0d5ef48c4ab2faf (diff) | |
download | android-node-v8-9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3.tar.gz android-node-v8-9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3.tar.bz2 android-node-v8-9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3.zip |
deps: update V8 to 7.1.302.28
PR-URL: https://github.com/nodejs/node/pull/23423
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/test/unittests/heap/heap-controller-unittest.cc')
-rw-r--r-- | deps/v8/test/unittests/heap/heap-controller-unittest.cc | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/deps/v8/test/unittests/heap/heap-controller-unittest.cc b/deps/v8/test/unittests/heap/heap-controller-unittest.cc index b2446afa84..42db9c4ba0 100644 --- a/deps/v8/test/unittests/heap/heap-controller-unittest.cc +++ b/deps/v8/test/unittests/heap/heap-controller-unittest.cc @@ -34,8 +34,8 @@ void CheckEqualRounded(double expected, double actual) { TEST_F(HeapControllerTest, HeapGrowingFactor) { HeapController heap_controller(i_isolate()->heap()); - double min_factor = heap_controller.kMinGrowingFactor; - double max_factor = heap_controller.kMaxGrowingFactor; + double min_factor = heap_controller.min_growing_factor_; + double max_factor = heap_controller.max_growing_factor_; CheckEqualRounded(max_factor, heap_controller.GrowingFactor(34, 1, 4.0)); CheckEqualRounded(3.553, heap_controller.GrowingFactor(45, 1, 4.0)); @@ -51,15 +51,15 @@ TEST_F(HeapControllerTest, HeapGrowingFactor) { TEST_F(HeapControllerTest, MaxHeapGrowingFactor) { HeapController heap_controller(i_isolate()->heap()); CheckEqualRounded( - 1.3, heap_controller.MaxGrowingFactor(heap_controller.kMinSize * MB)); + 1.3, heap_controller.MaxGrowingFactor(HeapController::kMinSize * MB)); CheckEqualRounded(1.600, heap_controller.MaxGrowingFactor( - heap_controller.kMaxSize / 2 * MB)); + HeapController::kMaxSize / 2 * MB)); CheckEqualRounded( 1.999, heap_controller.MaxGrowingFactor( - (heap_controller.kMaxSize - Heap::kPointerMultiplier) * MB)); + (HeapController::kMaxSize - Heap::kPointerMultiplier) * MB)); CheckEqualRounded(4.0, heap_controller.MaxGrowingFactor( - static_cast<size_t>(heap_controller.kMaxSize) * MB)); + static_cast<size_t>(HeapController::kMaxSize) * MB)); } TEST_F(HeapControllerTest, OldGenerationAllocationLimit) { @@ -75,39 +75,43 @@ TEST_F(HeapControllerTest, OldGenerationAllocationLimit) { double factor = heap_controller.GrowingFactor(gc_speed, mutator_speed, max_factor); - EXPECT_EQ(static_cast<size_t>(old_gen_size * factor + new_space_capacity), - heap->heap_controller()->CalculateAllocationLimit( - old_gen_size, max_old_generation_size, gc_speed, mutator_speed, - new_space_capacity, Heap::HeapGrowingMode::kDefault)); + EXPECT_EQ( + static_cast<size_t>(old_gen_size * factor + new_space_capacity), + heap->heap_controller()->CalculateAllocationLimit( + old_gen_size, max_old_generation_size, max_factor, gc_speed, + mutator_speed, new_space_capacity, Heap::HeapGrowingMode::kDefault)); - factor = Min(factor, heap_controller.kConservativeGrowingFactor); - EXPECT_EQ(static_cast<size_t>(old_gen_size * factor + new_space_capacity), - heap->heap_controller()->CalculateAllocationLimit( - old_gen_size, max_old_generation_size, gc_speed, mutator_speed, - new_space_capacity, Heap::HeapGrowingMode::kSlow)); - - factor = Min(factor, heap_controller.kConservativeGrowingFactor); - EXPECT_EQ(static_cast<size_t>(old_gen_size * factor + new_space_capacity), - heap->heap_controller()->CalculateAllocationLimit( - old_gen_size, max_old_generation_size, gc_speed, mutator_speed, - new_space_capacity, Heap::HeapGrowingMode::kConservative)); + factor = Min(factor, heap_controller.conservative_growing_factor_); + EXPECT_EQ( + static_cast<size_t>(old_gen_size * factor + new_space_capacity), + heap->heap_controller()->CalculateAllocationLimit( + old_gen_size, max_old_generation_size, max_factor, gc_speed, + mutator_speed, new_space_capacity, Heap::HeapGrowingMode::kSlow)); - factor = heap_controller.kMinGrowingFactor; + factor = Min(factor, heap_controller.conservative_growing_factor_); EXPECT_EQ(static_cast<size_t>(old_gen_size * factor + new_space_capacity), heap->heap_controller()->CalculateAllocationLimit( - old_gen_size, max_old_generation_size, gc_speed, mutator_speed, - new_space_capacity, Heap::HeapGrowingMode::kMinimal)); + old_gen_size, max_old_generation_size, max_factor, gc_speed, + mutator_speed, new_space_capacity, + Heap::HeapGrowingMode::kConservative)); + + factor = heap_controller.min_growing_factor_; + EXPECT_EQ( + static_cast<size_t>(old_gen_size * factor + new_space_capacity), + heap->heap_controller()->CalculateAllocationLimit( + old_gen_size, max_old_generation_size, max_factor, gc_speed, + mutator_speed, new_space_capacity, Heap::HeapGrowingMode::kMinimal)); } TEST_F(HeapControllerTest, MaxOldGenerationSize) { HeapController heap_controller(i_isolate()->heap()); uint64_t configurations[][2] = { - {0, heap_controller.kMinSize}, - {512, heap_controller.kMinSize}, + {0, HeapController::kMinSize}, + {512, HeapController::kMinSize}, {1 * GB, 256 * Heap::kPointerMultiplier}, {2 * static_cast<uint64_t>(GB), 512 * Heap::kPointerMultiplier}, - {4 * static_cast<uint64_t>(GB), heap_controller.kMaxSize}, - {8 * static_cast<uint64_t>(GB), heap_controller.kMaxSize}}; + {4 * static_cast<uint64_t>(GB), HeapController::kMaxSize}, + {8 * static_cast<uint64_t>(GB), HeapController::kMaxSize}}; for (auto configuration : configurations) { ASSERT_EQ(configuration[1], |