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

Unified Diff: src/compiler-dispatcher/compiler-dispatcher.h

Issue 2573493002: Use idle time to make progress on scheduled compilation jobs (Closed)
Patch Set: updates Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler-dispatcher/compiler-dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler-dispatcher/compiler-dispatcher.h
diff --git a/src/compiler-dispatcher/compiler-dispatcher.h b/src/compiler-dispatcher/compiler-dispatcher.h
index e6737a002945175bcaaefd3bcf6d25bec2232edc..220fcd0596c2e0035b6b267681ed7ec5dbf09f43 100644
--- a/src/compiler-dispatcher/compiler-dispatcher.h
+++ b/src/compiler-dispatcher/compiler-dispatcher.h
@@ -11,8 +11,12 @@
#include "src/base/macros.h"
#include "src/globals.h"
+#include "testing/gtest/include/gtest/gtest_prod.h"
namespace v8 {
+
+class Platform;
+
namespace internal {
class CompilerDispatcherJob;
@@ -23,11 +27,14 @@ class SharedFunctionInfo;
template <typename T>
class Handle;
+// The CompilerDispatcher uses a combination of idle tasks and background tasks
+// to parse and compile lazily parsed functions.
class V8_EXPORT_PRIVATE CompilerDispatcher {
public:
enum class BlockingBehavior { kBlock, kDontBlock };
- CompilerDispatcher(Isolate* isolate, size_t max_stack_size);
+ CompilerDispatcher(Isolate* isolate, Platform* platform,
+ size_t max_stack_size);
~CompilerDispatcher();
// Returns true if a job was enqueued.
@@ -47,15 +54,24 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
void AbortAll(BlockingBehavior blocking);
private:
+ FRIEND_TEST(CompilerDispatcherTest, IdleTaskSmallIdleTime);
+
typedef std::multimap<std::pair<int, int>,
std::unique_ptr<CompilerDispatcherJob>>
JobMap;
+ class IdleTask;
+
JobMap::const_iterator GetJobFor(Handle<SharedFunctionInfo> shared) const;
+ void ScheduleIdleTaskIfNeeded();
+ void DoIdleWork(double deadline_in_seconds);
Isolate* isolate_;
+ Platform* platform_;
size_t max_stack_size_;
std::unique_ptr<CompilerDispatcherTracer> tracer_;
+ bool idle_task_scheduled_;
+
// Mapping from (script id, function literal id) to job. We use a multimap,
// as script id is not necessarily unique.
JobMap jobs_;
« no previous file with comments | « no previous file | src/compiler-dispatcher/compiler-dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698