OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |