OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ | 5 #ifndef V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ |
6 #define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ | 6 #define V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // Aborts all jobs. Blocks if requested. | 89 // Aborts all jobs. Blocks if requested. |
90 void AbortAll(BlockingBehavior blocking); | 90 void AbortAll(BlockingBehavior blocking); |
91 | 91 |
92 // Memory pressure notifications from the embedder. | 92 // Memory pressure notifications from the embedder. |
93 void MemoryPressureNotification(v8::MemoryPressureLevel level, | 93 void MemoryPressureNotification(v8::MemoryPressureLevel level, |
94 bool is_isolate_locked); | 94 bool is_isolate_locked); |
95 | 95 |
96 private: | 96 private: |
97 FRIEND_TEST(CompilerDispatcherTest, EnqueueAndStep); | 97 FRIEND_TEST(CompilerDispatcherTest, EnqueueAndStep); |
98 FRIEND_TEST(CompilerDispatcherTest, IdleTaskSmallIdleTime); | 98 FRIEND_TEST(CompilerDispatcherTest, IdleTaskSmallIdleTime); |
99 FRIEND_TEST(IgnitionCompilerDispatcherTest, CompileOnBackgroundThread); | 99 FRIEND_TEST(CompilerDispatcherTest, CompileOnBackgroundThread); |
100 FRIEND_TEST(IgnitionCompilerDispatcherTest, FinishNowWithBackgroundTask); | 100 FRIEND_TEST(CompilerDispatcherTest, FinishNowWithBackgroundTask); |
101 FRIEND_TEST(IgnitionCompilerDispatcherTest, | 101 FRIEND_TEST(CompilerDispatcherTest, AsyncAbortAllPendingBackgroundTask); |
102 AsyncAbortAllPendingBackgroundTask); | 102 FRIEND_TEST(CompilerDispatcherTest, AsyncAbortAllRunningBackgroundTask); |
103 FRIEND_TEST(IgnitionCompilerDispatcherTest, | 103 FRIEND_TEST(CompilerDispatcherTest, FinishNowDuringAbortAll); |
104 AsyncAbortAllRunningBackgroundTask); | |
105 FRIEND_TEST(IgnitionCompilerDispatcherTest, FinishNowDuringAbortAll); | |
106 | 104 |
107 typedef std::multimap<std::pair<int, int>, | 105 typedef std::multimap<std::pair<int, int>, |
108 std::unique_ptr<CompilerDispatcherJob>> | 106 std::unique_ptr<CompilerDispatcherJob>> |
109 JobMap; | 107 JobMap; |
110 class AbortTask; | 108 class AbortTask; |
111 class BackgroundTask; | 109 class BackgroundTask; |
112 class IdleTask; | 110 class IdleTask; |
113 | 111 |
114 void WaitForJobIfRunningOnBackground(CompilerDispatcherJob* job); | 112 void WaitForJobIfRunningOnBackground(CompilerDispatcherJob* job); |
115 bool IsEnabled() const; | 113 bool IsEnabled() const; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 base::AtomicValue<bool> block_for_testing_; | 166 base::AtomicValue<bool> block_for_testing_; |
169 base::Semaphore semaphore_for_testing_; | 167 base::Semaphore semaphore_for_testing_; |
170 | 168 |
171 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcher); | 169 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcher); |
172 }; | 170 }; |
173 | 171 |
174 } // namespace internal | 172 } // namespace internal |
175 } // namespace v8 | 173 } // namespace v8 |
176 | 174 |
177 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ | 175 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ |
OLD | NEW |