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

Side by Side Diff: test/unittests/heap/gc-idle-time-handler-unittest.cc

Issue 712563002: Remove heap size filter for context disposal garbage collection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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/gc-idle-time-handler.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 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state); 214 GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
215 EXPECT_EQ(DO_FULL_GC, action.type); 215 EXPECT_EQ(DO_FULL_GC, action.type);
216 } 216 }
217 217
218 218
219 TEST_F(GCIdleTimeHandlerTest, AfterContextDisposeZeroIdleTime) { 219 TEST_F(GCIdleTimeHandlerTest, AfterContextDisposeZeroIdleTime) {
220 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState(); 220 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState();
221 heap_state.contexts_disposed = 1; 221 heap_state.contexts_disposed = 1;
222 heap_state.contexts_disposal_rate = 1.0; 222 heap_state.contexts_disposal_rate = 1.0;
223 heap_state.incremental_marking_stopped = true; 223 heap_state.incremental_marking_stopped = true;
224 heap_state.size_of_objects = GCIdleTimeHandler::kSmallHeapSize / 2;
225 int idle_time_ms = 0; 224 int idle_time_ms = 0;
226 GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state); 225 GCIdleTimeAction action = handler()->Compute(idle_time_ms, heap_state);
227 EXPECT_EQ(DO_FULL_GC, action.type); 226 EXPECT_EQ(DO_FULL_GC, action.type);
228 } 227 }
229 228
230 229
231 TEST_F(GCIdleTimeHandlerTest, AfterContextDisposeSmallIdleTime1) { 230 TEST_F(GCIdleTimeHandlerTest, AfterContextDisposeSmallIdleTime1) {
232 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState(); 231 GCIdleTimeHandler::HeapState heap_state = DefaultHeapState();
233 heap_state.contexts_disposed = 1; 232 heap_state.contexts_disposed = 1;
234 heap_state.contexts_disposal_rate = 1.0; 233 heap_state.contexts_disposal_rate = 1.0;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // Emulate mutator work. 414 // Emulate mutator work.
416 for (int i = 0; i < GCIdleTimeHandler::kIdleScavengeThreshold; i++) { 415 for (int i = 0; i < GCIdleTimeHandler::kIdleScavengeThreshold; i++) {
417 handler()->NotifyScavenge(); 416 handler()->NotifyScavenge();
418 } 417 }
419 action = handler()->Compute(0, heap_state); 418 action = handler()->Compute(0, heap_state);
420 EXPECT_EQ(DO_NOTHING, action.type); 419 EXPECT_EQ(DO_NOTHING, action.type);
421 } 420 }
422 421
423 } // namespace internal 422 } // namespace internal
424 } // namespace v8 423 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/gc-idle-time-handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698