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 2c16cddd06193d66c56d0097107e15fba92fd7fc..bbf6549cd0ba5aac5e00be385dd5a198abd2dc20 100644 |
--- a/src/compiler-dispatcher/compiler-dispatcher-job.cc |
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc |
@@ -176,19 +176,19 @@ bool CompilerDispatcherJob::PrepareToCompileOnMainThread() { |
DeferredHandleScope scope(isolate_); |
if (Compiler::Analyze(parse_info_.get())) { |
- compile_job_.reset( |
- Compiler::PrepareUnoptimizedCompilationJob(compile_info_.get())); |
+ compile_jobs_ = |
+ Compiler::PrepareUnoptimizedCompilationJobs(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; |
} |
@@ -202,10 +202,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. |
@@ -216,17 +217,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; |
@@ -243,7 +246,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()); |