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

Side by Side Diff: test/heap-unittests/heap-unittest.cc

Issue 492763002: Move idle notification handling to GCIdleTimeHandler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Casts Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 40
41 TEST(EstimateMarkingStepSizeTest, EstimateMarkingStepSizeOverflow2) { 41 TEST(EstimateMarkingStepSizeTest, EstimateMarkingStepSizeOverflow2) {
42 size_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize( 42 size_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize(
43 std::numeric_limits<size_t>::max(), 10); 43 std::numeric_limits<size_t>::max(), 10);
44 EXPECT_EQ(static_cast<size_t>(GCIdleTimeHandler::kMaximumMarkingStepSize), 44 EXPECT_EQ(static_cast<size_t>(GCIdleTimeHandler::kMaximumMarkingStepSize),
45 step_size); 45 step_size);
46 } 46 }
47 47
48
49 TEST(EstimateMarkCompactTimeTest, EstimateMarkCompactTimeInitial) {
50 size_t size = 100 * MB;
51 size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, 0);
52 EXPECT_EQ(size / GCIdleTimeHandler::kInitialConservativeMarkCompactSpeed,
53 time);
54 }
55
56
57 TEST(EstimateMarkCompactTimeTest, EstimateMarkCompactTimeNonZero) {
58 size_t size = 100 * MB;
59 size_t speed = 10 * KB;
60 size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, speed);
61 EXPECT_EQ(size / speed, time);
62 }
63
64
65 TEST(EstimateMarkCompactTimeTest, EstimateMarkCompactTimeMax) {
66 size_t size = std::numeric_limits<size_t>::max();
67 size_t speed = 1;
68 size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, speed);
69 EXPECT_EQ(GCIdleTimeHandler::kMaxMarkCompactTimeInMs, time);
70 }
71
48 } // namespace internal 72 } // namespace internal
49 } // namespace v8 73 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698