OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "src/heap/gc-idle-time-handler.h" | 7 #include "src/heap/gc-idle-time-handler.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 handler()->Compute(idle_time_ms, heap_state); | 87 handler()->Compute(idle_time_ms, heap_state); |
88 EXPECT_EQ(GCIdleTimeHandler::kReduceLatency, handler()->mode()); | 88 EXPECT_EQ(GCIdleTimeHandler::kReduceLatency, handler()->mode()); |
89 } | 89 } |
90 | 90 |
91 static const size_t kSizeOfObjects = 100 * MB; | 91 static const size_t kSizeOfObjects = 100 * MB; |
92 static const size_t kMarkCompactSpeed = 200 * KB; | 92 static const size_t kMarkCompactSpeed = 200 * KB; |
93 static const size_t kMarkingSpeed = 200 * KB; | 93 static const size_t kMarkingSpeed = 200 * KB; |
94 static const size_t kScavengeSpeed = 100 * KB; | 94 static const size_t kScavengeSpeed = 100 * KB; |
95 static const size_t kNewSpaceCapacity = 1 * MB; | 95 static const size_t kNewSpaceCapacity = 1 * MB; |
96 static const size_t kNewSpaceAllocationThroughput = 10 * KB; | 96 static const size_t kNewSpaceAllocationThroughput = 10 * KB; |
97 static const int kMaxNotifications = 100; | 97 static const int kMaxNotifications = 1000; |
98 | 98 |
99 private: | 99 private: |
100 GCIdleTimeHandler handler_; | 100 GCIdleTimeHandler handler_; |
101 }; | 101 }; |
102 | 102 |
103 } // namespace | 103 } // namespace |
104 | 104 |
105 | 105 |
106 TEST(GCIdleTimeHandler, EstimateMarkingStepSizeInitial) { | 106 TEST(GCIdleTimeHandler, EstimateMarkingStepSizeInitial) { |
107 size_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize(1, 0); | 107 size_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize(1, 0); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 handler()->NotifyMarkCompact(); | 620 handler()->NotifyMarkCompact(); |
621 handler()->NotifyIdleMarkCompact(); | 621 handler()->NotifyIdleMarkCompact(); |
622 } | 622 } |
623 action = handler()->Compute(idle_time_ms, heap_state); | 623 action = handler()->Compute(idle_time_ms, heap_state); |
624 EXPECT_EQ(DONE, action.type); | 624 EXPECT_EQ(DONE, action.type); |
625 } | 625 } |
626 | 626 |
627 | 627 |
628 } // namespace internal | 628 } // namespace internal |
629 } // namespace v8 | 629 } // namespace v8 |
OLD | NEW |