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

Unified Diff: test/cctest/test-heap.cc

Issue 1105293004: Add mode to reduce memory usage in idle notification. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add checks in tests Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 7bc1a88bb8aa1a6b917c2f12b448ce2a3f378406..8f9559d19577f779288397b046954dc0feae1bb6 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2243,28 +2243,10 @@ TEST(ResetSharedFunctionInfoCountersDuringIncrementalMarking) {
IncrementalMarking* marking = CcTest::heap()->incremental_marking();
marking->Abort();
marking->Start();
-
- // The following two calls will increment CcTest::heap()->global_ic_age().
- const double kLongIdlePauseInSeconds = 1.0;
+ // The following calls will increment CcTest::heap()->global_ic_age().
CcTest::isolate()->ContextDisposedNotification();
- CcTest::isolate()->IdleNotificationDeadline(
- (v8::base::TimeTicks::HighResolutionNow().ToInternalValue() /
- static_cast<double>(v8::base::Time::kMicrosecondsPerSecond)) +
- kLongIdlePauseInSeconds);
-
- while (!marking->IsStopped() && !marking->IsComplete()) {
- marking->Step(1 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
- }
- if (!marking->IsStopped() || marking->should_hurry()) {
- // We don't normally finish a GC via Step(), we normally finish by
- // setting the stack guard and then do the final steps in the stack
- // guard interrupt. But here we didn't ask for that, and there is no
- // JS code running to trigger the interrupt, so we explicitly finalize
- // here.
- CcTest::heap()->CollectAllGarbage(Heap::kFinalizeIncrementalMarkingMask,
- "Test finalizing incremental mark-sweep");
- }
-
+ SimulateIncrementalMarking(CcTest::heap());
+ CcTest::heap()->CollectAllGarbage();
CHECK_EQ(CcTest::heap()->global_ic_age(), f->shared()->ic_age());
CHECK_EQ(0, f->shared()->opt_count());
CHECK_EQ(0, f->shared()->code()->profiler_ticks());
@@ -2303,13 +2285,8 @@ TEST(ResetSharedFunctionInfoCountersDuringMarkSweep) {
CcTest::heap()->incremental_marking()->Abort();
// The following two calls will increment CcTest::heap()->global_ic_age().
- // Since incremental marking is off, IdleNotification will do full GC.
- const double kLongIdlePauseInSeconds = 1.0;
CcTest::isolate()->ContextDisposedNotification();
- CcTest::isolate()->IdleNotificationDeadline(
- (v8::base::TimeTicks::HighResolutionNow().ToInternalValue() /
- static_cast<double>(v8::base::Time::kMicrosecondsPerSecond)) +
- kLongIdlePauseInSeconds);
+ CcTest::heap()->CollectAllGarbage();
CHECK_EQ(CcTest::heap()->global_ic_age(), f->shared()->ic_age());
CHECK_EQ(0, f->shared()->opt_count());
« no previous file with comments | « src/heap/heap.cc ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698