OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" | 5 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" |
6 | 6 |
7 #include "src/assert-scope.h" | 7 #include "src/assert-scope.h" |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler-dispatcher/compiler-dispatcher-tracer.h" | 9 #include "src/compiler-dispatcher/compiler-dispatcher-tracer.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 bool CompilerDispatcherJob::PrepareToCompileOnMainThread() { | 176 bool CompilerDispatcherJob::PrepareToCompileOnMainThread() { |
177 DCHECK(ThreadId::Current().Equals(isolate_->thread_id())); | 177 DCHECK(ThreadId::Current().Equals(isolate_->thread_id())); |
178 DCHECK(status() == CompileJobStatus::kReadyToAnalyse); | 178 DCHECK(status() == CompileJobStatus::kReadyToAnalyse); |
179 COMPILER_DISPATCHER_TRACE_SCOPE(tracer_, kPrepareToCompile); | 179 COMPILER_DISPATCHER_TRACE_SCOPE(tracer_, kPrepareToCompile); |
180 | 180 |
181 compile_info_.reset( | 181 compile_info_.reset( |
182 new CompilationInfo(parse_info_.get(), Handle<JSFunction>::null())); | 182 new CompilationInfo(parse_info_.get(), Handle<JSFunction>::null())); |
183 | 183 |
184 DeferredHandleScope scope(isolate_); | 184 DeferredHandleScope scope(isolate_); |
185 if (Compiler::Analyze(parse_info_.get())) { | 185 if (Compiler::Analyze(parse_info_.get())) { |
186 compile_job_.reset( | 186 compile_job_.reset(Compiler::PrepareUnoptimizedCompilationJob( |
187 Compiler::PrepareUnoptimizedCompilationJob(compile_info_.get())); | 187 compile_info_.get(), LazyCompilationMode::kAlways)); |
188 } | 188 } |
189 compile_info_->set_deferred_handles(scope.Detach()); | 189 compile_info_->set_deferred_handles(scope.Detach()); |
190 | 190 |
191 if (!compile_job_.get()) { | 191 if (!compile_job_.get()) { |
192 if (!isolate_->has_pending_exception()) isolate_->StackOverflow(); | 192 if (!isolate_->has_pending_exception()) isolate_->StackOverflow(); |
193 status_ = CompileJobStatus::kFailed; | 193 status_ = CompileJobStatus::kFailed; |
194 return false; | 194 return false; |
195 } | 195 } |
196 | 196 |
197 can_compile_on_background_thread_ = | 197 can_compile_on_background_thread_ = |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 if (!source_.is_null()) { | 258 if (!source_.is_null()) { |
259 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); | 259 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); |
260 source_ = Handle<String>::null(); | 260 source_ = Handle<String>::null(); |
261 } | 261 } |
262 | 262 |
263 status_ = CompileJobStatus::kInitial; | 263 status_ = CompileJobStatus::kInitial; |
264 } | 264 } |
265 | 265 |
266 } // namespace internal | 266 } // namespace internal |
267 } // namespace v8 | 267 } // namespace v8 |
OLD | NEW |