| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
| 6 | 6 |
| 7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 } | 543 } |
| 544 | 544 |
| 545 } // namespace | 545 } // namespace |
| 546 | 546 |
| 547 class PipelineCompilationJob final : public CompilationJob { | 547 class PipelineCompilationJob final : public CompilationJob { |
| 548 public: | 548 public: |
| 549 PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function) | 549 PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function) |
| 550 // Note that the CompilationInfo is not initialized at the time we pass it | 550 // Note that the CompilationInfo is not initialized at the time we pass it |
| 551 // to the CompilationJob constructor, but it is not dereferenced there. | 551 // to the CompilationJob constructor, but it is not dereferenced there. |
| 552 : CompilationJob(isolate, &info_, "TurboFan"), | 552 : CompilationJob(isolate, &info_, "TurboFan"), |
| 553 parse_info_(handle(function->shared())), | 553 zone_(isolate->allocator(), ZONE_NAME), |
| 554 zone_stats_(isolate->allocator()), | 554 zone_stats_(isolate->allocator()), |
| 555 parse_info_(&zone_, handle(function->shared())), |
| 555 info_(&parse_info_, function), | 556 info_(&parse_info_, function), |
| 556 pipeline_statistics_(CreatePipelineStatistics(info(), &zone_stats_)), | 557 pipeline_statistics_(CreatePipelineStatistics(info(), &zone_stats_)), |
| 557 data_(&zone_stats_, info(), pipeline_statistics_.get()), | 558 data_(&zone_stats_, info(), pipeline_statistics_.get()), |
| 558 pipeline_(&data_), | 559 pipeline_(&data_), |
| 559 linkage_(nullptr) {} | 560 linkage_(nullptr) {} |
| 560 | 561 |
| 561 protected: | 562 protected: |
| 562 Status PrepareJobImpl() final; | 563 Status PrepareJobImpl() final; |
| 563 Status ExecuteJobImpl() final; | 564 Status ExecuteJobImpl() final; |
| 564 Status FinalizeJobImpl() final; | 565 Status FinalizeJobImpl() final; |
| 565 | 566 |
| 566 private: | 567 private: |
| 568 Zone zone_; |
| 569 ZoneStats zone_stats_; |
| 567 ParseInfo parse_info_; | 570 ParseInfo parse_info_; |
| 568 ZoneStats zone_stats_; | |
| 569 CompilationInfo info_; | 571 CompilationInfo info_; |
| 570 std::unique_ptr<PipelineStatistics> pipeline_statistics_; | 572 std::unique_ptr<PipelineStatistics> pipeline_statistics_; |
| 571 PipelineData data_; | 573 PipelineData data_; |
| 572 PipelineImpl pipeline_; | 574 PipelineImpl pipeline_; |
| 573 Linkage* linkage_; | 575 Linkage* linkage_; |
| 574 | 576 |
| 575 DISALLOW_COPY_AND_ASSIGN(PipelineCompilationJob); | 577 DISALLOW_COPY_AND_ASSIGN(PipelineCompilationJob); |
| 576 }; | 578 }; |
| 577 | 579 |
| 578 PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl() { | 580 PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl() { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 595 if (FLAG_inline_accessors) { | 597 if (FLAG_inline_accessors) { |
| 596 info()->MarkAsAccessorInliningEnabled(); | 598 info()->MarkAsAccessorInliningEnabled(); |
| 597 } | 599 } |
| 598 } | 600 } |
| 599 if (!info()->is_optimizing_from_bytecode()) { | 601 if (!info()->is_optimizing_from_bytecode()) { |
| 600 if (!Compiler::EnsureDeoptimizationSupport(info())) return FAILED; | 602 if (!Compiler::EnsureDeoptimizationSupport(info())) return FAILED; |
| 601 } else if (FLAG_turbo_inlining) { | 603 } else if (FLAG_turbo_inlining) { |
| 602 info()->MarkAsInliningEnabled(); | 604 info()->MarkAsInliningEnabled(); |
| 603 } | 605 } |
| 604 | 606 |
| 605 linkage_ = new (info()->zone()) | 607 linkage_ = new (&zone_) Linkage(Linkage::ComputeIncoming(&zone_, info())); |
| 606 Linkage(Linkage::ComputeIncoming(info()->zone(), info())); | |
| 607 | 608 |
| 608 if (!pipeline_.CreateGraph()) { | 609 if (!pipeline_.CreateGraph()) { |
| 609 if (isolate()->has_pending_exception()) return FAILED; // Stack overflowed. | 610 if (isolate()->has_pending_exception()) return FAILED; // Stack overflowed. |
| 610 return AbortOptimization(kGraphBuildingFailed); | 611 return AbortOptimization(kGraphBuildingFailed); |
| 611 } | 612 } |
| 612 | 613 |
| 613 return SUCCEEDED; | 614 return SUCCEEDED; |
| 614 } | 615 } |
| 615 | 616 |
| 616 PipelineCompilationJob::Status PipelineCompilationJob::ExecuteJobImpl() { | 617 PipelineCompilationJob::Status PipelineCompilationJob::ExecuteJobImpl() { |
| (...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 data->DeleteRegisterAllocationZone(); | 2014 data->DeleteRegisterAllocationZone(); |
| 2014 } | 2015 } |
| 2015 | 2016 |
| 2016 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 2017 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
| 2017 | 2018 |
| 2018 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 2019 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
| 2019 | 2020 |
| 2020 } // namespace compiler | 2021 } // namespace compiler |
| 2021 } // namespace internal | 2022 } // namespace internal |
| 2022 } // namespace v8 | 2023 } // namespace v8 |
| OLD | NEW |