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 <utility> | 10 #include <utility> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void AbortAll(BlockingBehavior blocking); | 54 void AbortAll(BlockingBehavior blocking); |
55 | 55 |
56 private: | 56 private: |
57 FRIEND_TEST(CompilerDispatcherTest, IdleTaskSmallIdleTime); | 57 FRIEND_TEST(CompilerDispatcherTest, IdleTaskSmallIdleTime); |
58 | 58 |
59 typedef std::multimap<std::pair<int, int>, | 59 typedef std::multimap<std::pair<int, int>, |
60 std::unique_ptr<CompilerDispatcherJob>> | 60 std::unique_ptr<CompilerDispatcherJob>> |
61 JobMap; | 61 JobMap; |
62 class IdleTask; | 62 class IdleTask; |
63 | 63 |
| 64 bool IsEnabled() const; |
64 JobMap::const_iterator GetJobFor(Handle<SharedFunctionInfo> shared) const; | 65 JobMap::const_iterator GetJobFor(Handle<SharedFunctionInfo> shared) const; |
65 void ScheduleIdleTaskIfNeeded(); | 66 void ScheduleIdleTaskIfNeeded(); |
66 void DoIdleWork(double deadline_in_seconds); | 67 void DoIdleWork(double deadline_in_seconds); |
67 | 68 |
68 Isolate* isolate_; | 69 Isolate* isolate_; |
69 Platform* platform_; | 70 Platform* platform_; |
70 size_t max_stack_size_; | 71 size_t max_stack_size_; |
71 std::unique_ptr<CompilerDispatcherTracer> tracer_; | 72 std::unique_ptr<CompilerDispatcherTracer> tracer_; |
72 | 73 |
73 bool idle_task_scheduled_; | 74 bool idle_task_scheduled_; |
74 | 75 |
75 // Mapping from (script id, function literal id) to job. We use a multimap, | 76 // Mapping from (script id, function literal id) to job. We use a multimap, |
76 // as script id is not necessarily unique. | 77 // as script id is not necessarily unique. |
77 JobMap jobs_; | 78 JobMap jobs_; |
78 | 79 |
79 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcher); | 80 DISALLOW_COPY_AND_ASSIGN(CompilerDispatcher); |
80 }; | 81 }; |
81 | 82 |
82 } // namespace internal | 83 } // namespace internal |
83 } // namespace v8 | 84 } // namespace v8 |
84 | 85 |
85 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ | 86 #endif // V8_COMPILER_DISPATCHER_COMPILER_DISPATCHER_H_ |
OLD | NEW |