Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: src/compiler/pipeline.cc

Issue 2685543003: Revert of Reland: [Parse] ParseInfo owns the parsing Zone. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 } 542 }
543 543
544 } // namespace 544 } // namespace
545 545
546 class PipelineCompilationJob final : public CompilationJob { 546 class PipelineCompilationJob final : public CompilationJob {
547 public: 547 public:
548 PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function) 548 PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function)
549 // Note that the CompilationInfo is not initialized at the time we pass it 549 // Note that the CompilationInfo is not initialized at the time we pass it
550 // to the CompilationJob constructor, but it is not dereferenced there. 550 // to the CompilationJob constructor, but it is not dereferenced there.
551 : CompilationJob(isolate, &info_, "TurboFan"), 551 : CompilationJob(isolate, &info_, "TurboFan"),
552 parse_info_(handle(function->shared())), 552 zone_(isolate->allocator(), ZONE_NAME),
553 zone_stats_(isolate->allocator()), 553 zone_stats_(isolate->allocator()),
554 parse_info_(&zone_, handle(function->shared())),
554 info_(&parse_info_, function), 555 info_(&parse_info_, function),
555 pipeline_statistics_(CreatePipelineStatistics(info(), &zone_stats_)), 556 pipeline_statistics_(CreatePipelineStatistics(info(), &zone_stats_)),
556 data_(&zone_stats_, info(), pipeline_statistics_.get()), 557 data_(&zone_stats_, info(), pipeline_statistics_.get()),
557 pipeline_(&data_), 558 pipeline_(&data_),
558 linkage_(nullptr) {} 559 linkage_(nullptr) {}
559 560
560 protected: 561 protected:
561 Status PrepareJobImpl() final; 562 Status PrepareJobImpl() final;
562 Status ExecuteJobImpl() final; 563 Status ExecuteJobImpl() final;
563 Status FinalizeJobImpl() final; 564 Status FinalizeJobImpl() final;
564 565
565 private: 566 private:
567 Zone zone_;
568 ZoneStats zone_stats_;
566 ParseInfo parse_info_; 569 ParseInfo parse_info_;
567 ZoneStats zone_stats_;
568 CompilationInfo info_; 570 CompilationInfo info_;
569 std::unique_ptr<PipelineStatistics> pipeline_statistics_; 571 std::unique_ptr<PipelineStatistics> pipeline_statistics_;
570 PipelineData data_; 572 PipelineData data_;
571 PipelineImpl pipeline_; 573 PipelineImpl pipeline_;
572 Linkage* linkage_; 574 Linkage* linkage_;
573 575
574 DISALLOW_COPY_AND_ASSIGN(PipelineCompilationJob); 576 DISALLOW_COPY_AND_ASSIGN(PipelineCompilationJob);
575 }; 577 };
576 578
577 PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl() { 579 PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl() {
(...skipping 16 matching lines...) Expand all
594 if (FLAG_inline_accessors) { 596 if (FLAG_inline_accessors) {
595 info()->MarkAsAccessorInliningEnabled(); 597 info()->MarkAsAccessorInliningEnabled();
596 } 598 }
597 } 599 }
598 if (!info()->is_optimizing_from_bytecode()) { 600 if (!info()->is_optimizing_from_bytecode()) {
599 if (!Compiler::EnsureDeoptimizationSupport(info())) return FAILED; 601 if (!Compiler::EnsureDeoptimizationSupport(info())) return FAILED;
600 } else if (FLAG_turbo_inlining) { 602 } else if (FLAG_turbo_inlining) {
601 info()->MarkAsInliningEnabled(); 603 info()->MarkAsInliningEnabled();
602 } 604 }
603 605
604 linkage_ = new (info()->zone()) 606 linkage_ = new (&zone_) Linkage(Linkage::ComputeIncoming(&zone_, info()));
605 Linkage(Linkage::ComputeIncoming(info()->zone(), info()));
606 607
607 if (!pipeline_.CreateGraph()) { 608 if (!pipeline_.CreateGraph()) {
608 if (isolate()->has_pending_exception()) return FAILED; // Stack overflowed. 609 if (isolate()->has_pending_exception()) return FAILED; // Stack overflowed.
609 return AbortOptimization(kGraphBuildingFailed); 610 return AbortOptimization(kGraphBuildingFailed);
610 } 611 }
611 612
612 return SUCCEEDED; 613 return SUCCEEDED;
613 } 614 }
614 615
615 PipelineCompilationJob::Status PipelineCompilationJob::ExecuteJobImpl() { 616 PipelineCompilationJob::Status PipelineCompilationJob::ExecuteJobImpl() {
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 data->DeleteRegisterAllocationZone(); 2016 data->DeleteRegisterAllocationZone();
2016 } 2017 }
2017 2018
2018 CompilationInfo* PipelineImpl::info() const { return data_->info(); } 2019 CompilationInfo* PipelineImpl::info() const { return data_->info(); }
2019 2020
2020 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } 2021 Isolate* PipelineImpl::isolate() const { return info()->isolate(); }
2021 2022
2022 } // namespace compiler 2023 } // namespace compiler
2023 } // namespace internal 2024 } // namespace internal
2024 } // namespace v8 2025 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/crankshaft/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698