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

Side by Side Diff: test/cctest/test-heap.cc

Issue 186733006: Ensure lazy sweeping is complete before simulating incremental marking in test-heap. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « no previous file | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 27 matching lines...) Expand all
38 #include "stub-cache.h" 38 #include "stub-cache.h"
39 #include "cctest.h" 39 #include "cctest.h"
40 40
41 using namespace v8::internal; 41 using namespace v8::internal;
42 42
43 43
44 // Go through all incremental marking steps in one swoop. 44 // Go through all incremental marking steps in one swoop.
45 static void SimulateIncrementalMarking() { 45 static void SimulateIncrementalMarking() {
46 MarkCompactCollector* collector = CcTest::heap()->mark_compact_collector(); 46 MarkCompactCollector* collector = CcTest::heap()->mark_compact_collector();
47 IncrementalMarking* marking = CcTest::heap()->incremental_marking(); 47 IncrementalMarking* marking = CcTest::heap()->incremental_marking();
48 while (!CcTest::heap()->old_pointer_space()->IsLazySweepingComplete()) {
49 CcTest::heap()->old_pointer_space()->AdvanceSweeper(KB);
50 }
48 if (collector->IsConcurrentSweepingInProgress()) { 51 if (collector->IsConcurrentSweepingInProgress()) {
49 collector->WaitUntilSweepingCompleted(); 52 collector->WaitUntilSweepingCompleted();
50 } 53 }
51 CHECK(marking->IsMarking() || marking->IsStopped()); 54 CHECK(marking->IsMarking() || marking->IsStopped());
52 if (marking->IsStopped()) { 55 if (marking->IsStopped()) {
53 marking->Start(); 56 marking->Start();
54 } 57 }
55 CHECK(marking->IsMarking()); 58 CHECK(marking->IsMarking());
56 while (!marking->IsComplete()) { 59 while (!marking->IsComplete()) {
57 marking->Step(MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); 60 marking->Step(MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
(...skipping 3628 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 code = scope.CloseAndEscape(Handle<Code>(bar->code())); 3689 code = scope.CloseAndEscape(Handle<Code>(bar->code()));
3687 } 3690 }
3688 3691
3689 // Now make sure that a gc should get rid of the function 3692 // Now make sure that a gc should get rid of the function
3690 for (int i = 0; i < 4; i++) { 3693 for (int i = 0; i < 4; i++) {
3691 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); 3694 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
3692 } 3695 }
3693 3696
3694 ASSERT(code->marked_for_deoptimization()); 3697 ASSERT(code->marked_for_deoptimization());
3695 } 3698 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698