| Index: src/compiler/pipeline.cc
|
| diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
|
| index e480b194c93f443a3d78adf7cef32021c6256e3e..b6e98699793138626f4861f08ae2e89b59c5076a 100644
|
| --- a/src/compiler/pipeline.cc
|
| +++ b/src/compiler/pipeline.cc
|
| @@ -476,6 +476,66 @@ class PipelineRunScope {
|
| ZonePool::Scope zone_scope_;
|
| };
|
|
|
| +class PipelineCompilationJob : public OptimizedCompileJob {
|
| + public:
|
| + explicit PipelineCompilationJob(CompilationInfo* info)
|
| + : OptimizedCompileJob(info) {}
|
| +
|
| + protected:
|
| + virtual Status CreateGraphImpl();
|
| + virtual Status OptimizeGraphImpl();
|
| + virtual Status GenerateCodeImpl();
|
| +};
|
| +
|
| +PipelineCompilationJob::Status PipelineCompilationJob::CreateGraphImpl() {
|
| + if (FLAG_trace_opt) {
|
| + OFStream os(stdout);
|
| + os << "[compiling method " << Brief(*info()->closure())
|
| + << " using TurboFan";
|
| + if (info()->is_osr()) os << " OSR";
|
| + os << "]" << std::endl;
|
| + }
|
| +
|
| + if (info()->shared_info()->asm_function()) {
|
| + if (info()->osr_frame()) info()->MarkAsFrameSpecializing();
|
| + info()->MarkAsFunctionContextSpecializing();
|
| + } else {
|
| + if (!FLAG_always_opt) {
|
| + info()->MarkAsBailoutOnUninitialized();
|
| + }
|
| + if (FLAG_native_context_specialization) {
|
| + info()->MarkAsNativeContextSpecializing();
|
| + info()->MarkAsTypingEnabled();
|
| + }
|
| + }
|
| + if (!info()->shared_info()->asm_function() || FLAG_turbo_asm_deoptimization) {
|
| + info()->MarkAsDeoptimizationEnabled();
|
| + }
|
| +
|
| + Pipeline pipeline(info());
|
| + pipeline.GenerateCode();
|
| + if (info()->code().is_null()) return BAILED_OUT;
|
| +
|
| + return SUCCEEDED;
|
| +}
|
| +
|
| +PipelineCompilationJob::Status PipelineCompilationJob::OptimizeGraphImpl() {
|
| + // TODO(turbofan): Currently everything is done in the first phase.
|
| + DCHECK(!info()->code().is_null());
|
| + return SUCCEEDED;
|
| +}
|
| +
|
| +PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() {
|
| + // TODO(turbofan): Currently everything is done in the first phase.
|
| + DCHECK(!info()->code().is_null());
|
| + info()->dependencies()->Commit(info()->code());
|
| + if (info()->is_deoptimization_enabled()) {
|
| + info()->context()->native_context()->AddOptimizedCode(*info()->code());
|
| + RegisterWeakObjectsInOptimizedCode(info()->code());
|
| + }
|
| + return SUCCEEDED;
|
| +}
|
| +
|
| } // namespace
|
|
|
|
|
| @@ -1313,6 +1373,9 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
|
| return pipeline.ScheduleAndGenerateCode(call_descriptor);
|
| }
|
|
|
| +OptimizedCompileJob* Pipeline::NewCompilationJob(CompilationInfo* info) {
|
| + return new (info->zone()) PipelineCompilationJob(info);
|
| +}
|
|
|
| bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
|
| InstructionSequence* sequence,
|
|
|