| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #ifdef __linux__ | 7 #ifdef __linux__ |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 return dummy; | 94 return dummy; |
| 95 } | 95 } |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 v8::Platform* platform_; | 98 v8::Platform* platform_; |
| 99 Task* task_; | 99 Task* task_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 TEST(IncrementalMarkingUsingTasks) { | 102 TEST(IncrementalMarkingUsingTasks) { |
| 103 if (!i::FLAG_incremental_marking) return; | 103 if (!i::FLAG_incremental_marking) return; |
| 104 FLAG_stress_incremental_marking = false; |
| 104 CcTest::InitializeVM(); | 105 CcTest::InitializeVM(); |
| 105 v8::Platform* old_platform = i::V8::GetCurrentPlatform(); | 106 v8::Platform* old_platform = i::V8::GetCurrentPlatform(); |
| 106 MockPlatform platform(old_platform); | 107 MockPlatform platform(old_platform); |
| 107 i::V8::SetPlatformForTesting(&platform); | 108 i::V8::SetPlatformForTesting(&platform); |
| 108 i::heap::SimulateFullSpace(CcTest::heap()->old_space()); | 109 i::heap::SimulateFullSpace(CcTest::heap()->old_space()); |
| 109 i::IncrementalMarking* marking = CcTest::heap()->incremental_marking(); | 110 i::IncrementalMarking* marking = CcTest::heap()->incremental_marking(); |
| 110 marking->Stop(); | 111 marking->Stop(); |
| 111 marking->Start(i::GarbageCollectionReason::kTesting); | 112 marking->Start(i::GarbageCollectionReason::kTesting); |
| 112 CHECK(platform.PendingTask()); | 113 CHECK(platform.PendingTask()); |
| 113 while (platform.PendingTask()) { | 114 while (platform.PendingTask()) { |
| 114 platform.PerformTask(); | 115 platform.PerformTask(); |
| 115 } | 116 } |
| 116 CHECK(marking->IsStopped()); | 117 CHECK(marking->IsStopped()); |
| 117 i::V8::SetPlatformForTesting(old_platform); | 118 i::V8::SetPlatformForTesting(old_platform); |
| 118 } | 119 } |
| 119 | 120 |
| 120 } // namespace internal | 121 } // namespace internal |
| 121 } // namespace v8 | 122 } // namespace v8 |
| OLD | NEW |