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

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

Issue 465473002: Use actual incremental marking throughput in IdleNotification to estimate marking step size. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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') | tools/gyp/v8.gyp » ('j') | 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 <climits>
6
7 #include "src/heap/gc-idle-time-handler.h"
8
5 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
6 10
7 namespace v8 { 11 namespace v8 {
8 namespace internal { 12 namespace internal {
9 13
10 TEST(HeapTest, Dummy) { 14 TEST(EstimateMarkingStepSizeTest, EstimateMarkingStepSizeInitial) {
11 EXPECT_FALSE(false); 15 intptr_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize(1, 0);
12 EXPECT_TRUE(true); 16 EXPECT_EQ(static_cast<intptr_t>(
17 GCIdleTimeHandler::kInitialConservativeMarkingSpeed *
18 GCIdleTimeHandler::kConservativeTimeRatio),
19 step_size);
20 }
21
22
23 TEST(EstimateMarkingStepSizeTest, EstimateMarkingStepSizeNonZero) {
24 intptr_t marking_speed_in_bytes_per_millisecond = 100;
25 intptr_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize(
26 1, marking_speed_in_bytes_per_millisecond);
27 EXPECT_EQ(static_cast<intptr_t>(marking_speed_in_bytes_per_millisecond *
28 GCIdleTimeHandler::kConservativeTimeRatio),
29 step_size);
30 }
31
32
33 TEST(EstimateMarkingStepSizeTest, EstimateMarkingStepSizeOverflow1) {
34 intptr_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize(10, INT_MAX);
35 EXPECT_EQ(INT_MAX, step_size);
36 }
37
38
39 TEST(EstimateMarkingStepSizeTest, EstimateMarkingStepSizeOverflow2) {
40 intptr_t step_size = GCIdleTimeHandler::EstimateMarkingStepSize(INT_MAX, 10);
41 EXPECT_EQ(INT_MAX, step_size);
13 } 42 }
14 43
15 } // namespace internal 44 } // namespace internal
16 } // namespace v8 45 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698