| Index: src/compiler-dispatcher/compiler-dispatcher-job.cc
|
| diff --git a/src/compiler-dispatcher/compiler-dispatcher-job.cc b/src/compiler-dispatcher/compiler-dispatcher-job.cc
|
| index 96956aec97a6235a1f082ca09f8f42485a0cda22..d8c77f9a6a309c02317040b0014d59e70a300442 100644
|
| --- a/src/compiler-dispatcher/compiler-dispatcher-job.cc
|
| +++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc
|
| @@ -177,19 +177,19 @@ bool CompilerDispatcherJob::PrepareToCompileOnMainThread() {
|
|
|
| DeferredHandleScope scope(isolate_);
|
| if (Compiler::Analyze(parse_info_.get())) {
|
| - compile_job_.reset(
|
| - Compiler::PrepareUnoptimizedCompilationJob(compile_info_.get()));
|
| + compile_jobs_ =
|
| + Compiler::PrepareUnoptimizedCompilationJob(compile_info_.get());
|
| }
|
| compile_info_->set_deferred_handles(scope.Detach());
|
|
|
| - if (!compile_job_.get()) {
|
| + if (compile_jobs_.empty()) {
|
| if (!isolate_->has_pending_exception()) isolate_->StackOverflow();
|
| status_ = CompileJobStatus::kFailed;
|
| return false;
|
| }
|
|
|
| can_compile_on_background_thread_ =
|
| - compile_job_->can_execute_on_background_thread();
|
| + compile_jobs_.at(0)->can_execute_on_background_thread();
|
| status_ = CompileJobStatus::kReadyToCompile;
|
| return true;
|
| }
|
| @@ -203,10 +203,11 @@ void CompilerDispatcherJob::Compile() {
|
| // CompilationJob::ExecuteJob.
|
|
|
| uintptr_t stack_limit = GetCurrentStackPosition() - max_stack_size_ * KB;
|
| - compile_job_->set_stack_limit(stack_limit);
|
|
|
| - CompilationJob::Status status = compile_job_->ExecuteJob();
|
| - USE(status);
|
| + for (auto& job : compile_jobs_) {
|
| + job->set_stack_limit(stack_limit);
|
| + if (job->ExecuteJob() == CompilationJob::FAILED) break;
|
| + }
|
|
|
| // Always transition to kCompiled - errors will be reported by
|
| // FinalizeCompilingOnMainThread.
|
| @@ -217,17 +218,19 @@ bool CompilerDispatcherJob::FinalizeCompilingOnMainThread() {
|
| DCHECK(ThreadId::Current().Equals(isolate_->thread_id()));
|
| DCHECK(status() == CompileJobStatus::kCompiled);
|
|
|
| - if (compile_job_->state() == CompilationJob::State::kFailed ||
|
| - !Compiler::FinalizeCompilationJob(compile_job_.release())) {
|
| - if (!isolate_->has_pending_exception()) isolate_->StackOverflow();
|
| - status_ = CompileJobStatus::kFailed;
|
| - return false;
|
| + for (auto& job : compile_jobs_) {
|
| + if (job->state() == CompilationJob::State::kFailed ||
|
| + !Compiler::FinalizeCompilationJob(job.release())) {
|
| + if (!isolate_->has_pending_exception()) isolate_->StackOverflow();
|
| + status_ = CompileJobStatus::kFailed;
|
| + return false;
|
| + }
|
| }
|
|
|
| zone_.reset();
|
| parse_info_.reset();
|
| compile_info_.reset();
|
| - compile_job_.reset();
|
| + compile_jobs_.clear();
|
| handles_from_parsing_.reset();
|
|
|
| status_ = CompileJobStatus::kDone;
|
| @@ -244,7 +247,7 @@ void CompilerDispatcherJob::ResetOnMainThread() {
|
| zone_.reset();
|
| handles_from_parsing_.reset();
|
| compile_info_.reset();
|
| - compile_job_.reset();
|
| + compile_jobs_.clear();
|
|
|
| if (!source_.is_null()) {
|
| i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location());
|
|
|