Lines Matching refs:job
25 bool DoNextStepOnMainThread(Isolate* isolate, CompilerDispatcherJob* job, in DoNextStepOnMainThread() argument
30 switch (job->status()) { in DoNextStepOnMainThread()
32 job->PrepareOnMainThread(isolate); in DoNextStepOnMainThread()
35 job->Compile(false); in DoNextStepOnMainThread()
38 job->FinalizeOnMainThread(isolate); in DoNextStepOnMainThread()
41 job->ReportErrorsOnMainThread(isolate); in DoNextStepOnMainThread()
48 DCHECK_EQ(job->IsFailed(), isolate->has_pending_exception()); in DoNextStepOnMainThread()
49 if (job->IsFailed() && exception_handling == ExceptionHandling::kSwallow) { in DoNextStepOnMainThread()
52 return job->IsFailed(); in DoNextStepOnMainThread()
55 void DoNextStepOnBackgroundThread(CompilerDispatcherJob* job) { in DoNextStepOnBackgroundThread() argument
56 DCHECK(job->NextStepCanRunOnAnyThread()); in DoNextStepOnBackgroundThread()
59 switch (job->status()) { in DoNextStepOnBackgroundThread()
61 job->Compile(true); in DoNextStepOnBackgroundThread()
230 std::unique_ptr<CompilerDispatcherJob> job) { in Enqueue() argument
231 DCHECK(!job->IsFinished()); in Enqueue()
232 JobMap::const_iterator it = InsertJob(std::move(job)); in Enqueue()
239 std::unique_ptr<CompilerDispatcherJob> job) { in EnqueueAndStep() argument
240 DCHECK(!job->IsFinished()); in EnqueueAndStep()
241 JobMap::const_iterator it = InsertJob(std::move(job)); in EnqueueAndStep()
267 std::unique_ptr<CompilerDispatcherJob> job(new UnoptimizedCompileJob( in Enqueue() local
269 Enqueue(std::move(job)); in Enqueue()
285 std::unique_ptr<CompilerDispatcherJob> job(new UnoptimizedCompileJob( in EnqueueAndStep() local
287 EnqueueAndStep(std::move(job)); in EnqueueAndStep()
299 CompilerDispatcherJob* job) { in WaitForJobIfRunningOnBackground() argument
306 if (running_background_jobs_.find(job) == running_background_jobs_.end()) { in WaitForJobIfRunningOnBackground()
307 pending_background_jobs_.erase(job); in WaitForJobIfRunningOnBackground()
311 main_thread_blocking_on_job_ = job; in WaitForJobIfRunningOnBackground()
315 DCHECK(pending_background_jobs_.find(job) == pending_background_jobs_.end()); in WaitForJobIfRunningOnBackground()
316 DCHECK(running_background_jobs_.find(job) == running_background_jobs_.end()); in WaitForJobIfRunningOnBackground()
319 bool CompilerDispatcher::FinishNow(CompilerDispatcherJob* job) { in FinishNow() argument
322 job->ShortPrintOnMainThread(); in FinishNow()
325 WaitForJobIfRunningOnBackground(job); in FinishNow()
326 while (!job->IsFinished()) { in FinishNow()
327 DoNextStepOnMainThread(isolate_, job, ExceptionHandling::kThrow); in FinishNow()
329 return !job->IsFailed(); in FinishNow()
335 JobMap::const_iterator job = GetJobFor(function); in FinishNow() local
336 CHECK(job != jobs_.end()); in FinishNow()
337 bool result = FinishNow(job->second.get()); in FinishNow()
338 RemoveIfFinished(job); in FinishNow()
345 CompilerDispatcherJob* job = it->second.get(); in FinishAllNow() local
350 running_background_jobs_.find(job) != running_background_jobs_.end(); in FinishAllNow()
351 pending_background_jobs_.erase(job); in FinishAllNow()
354 while (!job->IsFinished()) { in FinishAllNow()
355 DoNextStepOnMainThread(isolate_, job, ExceptionHandling::kThrow); in FinishAllNow()
414 auto job = it; in AbortInactiveJobs() local
418 if (running_background_jobs_.find(job->second.get()) != in AbortInactiveJobs()
425 job->second->ShortPrintOnMainThread(); in AbortInactiveJobs()
428 it = RemoveJob(job); in AbortInactiveJobs()
470 JobMap::const_iterator job = jobs_.end(); in GetJobFor() local
472 job = jobs_.find(*job_id_ptr); in GetJobFor()
473 DCHECK(job == jobs_.end() || in GetJobFor()
474 job->second->AsUnoptimizedCompileJob()->IsAssociatedWith(shared)); in GetJobFor()
476 return job; in GetJobFor()
503 CompilerDispatcherJob* job) { in ConsiderJobForBackgroundProcessing() argument
504 if (!job->NextStepCanRunOnAnyThread()) return; in ConsiderJobForBackgroundProcessing()
507 pending_background_jobs_.insert(job); in ConsiderJobForBackgroundProcessing()
529 CompilerDispatcherJob* job = nullptr; in DoBackgroundWork() local
534 job = *it; in DoBackgroundWork()
536 running_background_jobs_.insert(job); in DoBackgroundWork()
539 if (job == nullptr) break; in DoBackgroundWork()
550 DoNextStepOnBackgroundThread(job); in DoBackgroundWork()
557 running_background_jobs_.erase(job); in DoBackgroundWork()
559 if (main_thread_blocking_on_job_ == job) { in DoBackgroundWork()
609 for (auto job = jobs_.cbegin(); in DoIdleWork() local
610 job != jobs_.cend() && idle_time_in_seconds > 0.0; in DoIdleWork()
618 if (running_background_jobs_.find(job->second.get()) != in DoIdleWork()
620 ++job; in DoIdleWork()
623 auto it = pending_background_jobs_.find(job->second.get()); in DoIdleWork()
624 double estimate_in_ms = job->second->EstimateRuntimeOfNextStepInMs(); in DoIdleWork()
634 ConsiderJobForBackgroundProcessing(job->second.get()); in DoIdleWork()
636 ++job; in DoIdleWork()
637 } else if (job->second->IsFinished()) { in DoIdleWork()
640 job = RemoveJob(job); in DoIdleWork()
649 DoNextStepOnMainThread(isolate_, job->second.get(), in DoIdleWork()
657 JobMap::const_iterator job) { in RemoveIfFinished() argument
658 if (!job->second->IsFinished()) { in RemoveIfFinished()
659 return job; in RemoveIfFinished()
663 bool result = !job->second->IsFailed(); in RemoveIfFinished()
665 job->second->ShortPrintOnMainThread(); in RemoveIfFinished()
670 return RemoveJob(job); in RemoveIfFinished()
674 std::unique_ptr<CompilerDispatcherJob> job) { in InsertJob() argument
678 jobs_.insert(std::make_pair(next_job_id_++, std::move(job))); in InsertJob()
699 CompilerDispatcherJob* job = it->second.get(); in RemoveJob() local
700 job->ResetOnMainThread(isolate_); in RemoveJob()
703 if (job->type() == CompilerDispatcherJob::Type::kUnoptimizedCompile) { in RemoveJob()
705 job->AsUnoptimizedCompileJob()->shared(); in RemoveJob()