| Index: src/compiler-dispatcher/compiler-dispatcher.h
|
| diff --git a/src/compiler-dispatcher/compiler-dispatcher.h b/src/compiler-dispatcher/compiler-dispatcher.h
|
| index 088b3bbccfa8505c157abe5acd23326b59dcfabe..6b416daa58d19bb668efc81b4b9153655347daaf 100644
|
| --- a/src/compiler-dispatcher/compiler-dispatcher.h
|
| +++ b/src/compiler-dispatcher/compiler-dispatcher.h
|
| @@ -25,9 +25,11 @@ enum class MemoryPressureLevel;
|
|
|
| namespace internal {
|
|
|
| +class AstValueFactory;
|
| class CancelableTaskManager;
|
| class CompilerDispatcherJob;
|
| class CompilerDispatcherTracer;
|
| +class FunctionLiteral;
|
| class Isolate;
|
| class SharedFunctionInfo;
|
|
|
| @@ -68,7 +70,10 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
|
| size_t max_stack_size);
|
| ~CompilerDispatcher();
|
|
|
| - // Returns true if a job was enqueued.
|
| + // Returns true if the compiler dispatcher is enabled.
|
| + bool IsEnabled() const;
|
| +
|
| + // Enqueue a job for parse and compile. Returns true if a job was enqueued.
|
| bool Enqueue(Handle<SharedFunctionInfo> function);
|
|
|
| // Like Enqueue, but also advances the job so that it can potentially
|
| @@ -76,13 +81,29 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
|
| // true if the job was enqueued.
|
| bool EnqueueAndStep(Handle<SharedFunctionInfo> function);
|
|
|
| + // Enqueue a job for compilation. Function must have already been parsed and
|
| + // analyzed and be ready for compilation. Returns true if a job was enqueued.
|
| + bool Enqueue(Handle<SharedFunctionInfo> function, FunctionLiteral* literal,
|
| + AstValueFactory* ast_value_factory);
|
| +
|
| + // Like Enqueue, but also advances the job so that it can potentially
|
| + // continue running on a background thread (if at all possible). Returns
|
| + // true if the job was enqueued.
|
| + bool EnqueueAndStep(Handle<SharedFunctionInfo> function,
|
| + FunctionLiteral* literal,
|
| + AstValueFactory* ast_value_factory);
|
| +
|
| // Returns true if there is a pending job for the given function.
|
| bool IsEnqueued(Handle<SharedFunctionInfo> function) const;
|
|
|
| // Blocks until the given function is compiled (and does so as fast as
|
| - // possible). Returns true if the compile job was succesful.
|
| + // possible). Returns true if the compile job was successful.
|
| bool FinishNow(Handle<SharedFunctionInfo> function);
|
|
|
| + // Blocks until all enqueued jobs have finished. Returns true if all the
|
| + // compile jobs were successful.
|
| + bool FinishAllNow();
|
| +
|
| // Aborts a given job. Blocks if requested.
|
| void Abort(Handle<SharedFunctionInfo> function, BlockingBehavior blocking);
|
|
|
| @@ -95,6 +116,8 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
|
|
|
| private:
|
| FRIEND_TEST(CompilerDispatcherTest, EnqueueAndStep);
|
| + FRIEND_TEST(CompilerDispatcherTest, EnqueueParsed);
|
| + FRIEND_TEST(CompilerDispatcherTest, EnqueueAndStepParsed);
|
| FRIEND_TEST(CompilerDispatcherTest, IdleTaskSmallIdleTime);
|
| FRIEND_TEST(IgnitionCompilerDispatcherTest, CompileOnBackgroundThread);
|
| FRIEND_TEST(IgnitionCompilerDispatcherTest, FinishNowWithBackgroundTask);
|
| @@ -112,9 +135,10 @@ class V8_EXPORT_PRIVATE CompilerDispatcher {
|
| class IdleTask;
|
|
|
| void WaitForJobIfRunningOnBackground(CompilerDispatcherJob* job);
|
| - bool IsEnabled() const;
|
| void AbortInactiveJobs();
|
| + bool CanEnqueue(Handle<SharedFunctionInfo> function);
|
| JobMap::const_iterator GetJobFor(Handle<SharedFunctionInfo> shared) const;
|
| + bool FinishNow(CompilerDispatcherJob* job);
|
| void ConsiderJobForBackgroundProcessing(CompilerDispatcherJob* job);
|
| void ScheduleMoreBackgroundTasksIfNeeded();
|
| void ScheduleIdleTaskFromAnyThread();
|
|
|