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

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

Issue 2957693002: Merged changes to avoid OOM for large wasm modules. (Closed)
Patch Set: Created 3 years, 5 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.h ('k') | src/compiler/wasm-compiler.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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 pipeline_(&data_), 674 pipeline_(&data_),
675 linkage_(descriptor), 675 linkage_(descriptor),
676 allow_signalling_nan_(allow_signalling_nan) {} 676 allow_signalling_nan_(allow_signalling_nan) {}
677 677
678 protected: 678 protected:
679 Status PrepareJobImpl() final; 679 Status PrepareJobImpl() final;
680 Status ExecuteJobImpl() final; 680 Status ExecuteJobImpl() final;
681 Status FinalizeJobImpl() final; 681 Status FinalizeJobImpl() final;
682 682
683 private: 683 private:
684 size_t AllocatedMemory() const override;
685
684 ZoneStats zone_stats_; 686 ZoneStats zone_stats_;
685 std::unique_ptr<PipelineStatistics> pipeline_statistics_; 687 std::unique_ptr<PipelineStatistics> pipeline_statistics_;
686 PipelineData data_; 688 PipelineData data_;
687 PipelineImpl pipeline_; 689 PipelineImpl pipeline_;
688 Linkage linkage_; 690 Linkage linkage_;
689 bool allow_signalling_nan_; 691 bool allow_signalling_nan_;
690 }; 692 };
691 693
692 PipelineWasmCompilationJob::Status 694 PipelineWasmCompilationJob::Status
693 PipelineWasmCompilationJob::PrepareJobImpl() { 695 PipelineWasmCompilationJob::PrepareJobImpl() {
(...skipping 26 matching lines...) Expand all
720 AddReducer(data, &graph_reducer, &common_reducer); 722 AddReducer(data, &graph_reducer, &common_reducer);
721 AddReducer(data, &graph_reducer, &value_numbering); 723 AddReducer(data, &graph_reducer, &value_numbering);
722 graph_reducer.ReduceGraph(); 724 graph_reducer.ReduceGraph();
723 pipeline_.RunPrintAndVerify("Optimized Machine", true); 725 pipeline_.RunPrintAndVerify("Optimized Machine", true);
724 } 726 }
725 727
726 if (!pipeline_.ScheduleAndSelectInstructions(&linkage_, true)) return FAILED; 728 if (!pipeline_.ScheduleAndSelectInstructions(&linkage_, true)) return FAILED;
727 return SUCCEEDED; 729 return SUCCEEDED;
728 } 730 }
729 731
732 size_t PipelineWasmCompilationJob::AllocatedMemory() const {
733 return pipeline_.data_->zone_stats()->GetCurrentAllocatedBytes();
734 }
735
730 PipelineWasmCompilationJob::Status 736 PipelineWasmCompilationJob::Status
731 PipelineWasmCompilationJob::FinalizeJobImpl() { 737 PipelineWasmCompilationJob::FinalizeJobImpl() {
732 pipeline_.AssembleCode(&linkage_); 738 pipeline_.AssembleCode(&linkage_);
733 pipeline_.FinalizeCode(); 739 pipeline_.FinalizeCode();
734 return SUCCEEDED; 740 return SUCCEEDED;
735 } 741 }
736 742
737 template <typename Phase> 743 template <typename Phase>
738 void PipelineImpl::Run() { 744 void PipelineImpl::Run() {
739 PipelineRunScope scope(this->data_, Phase::phase_name()); 745 PipelineRunScope scope(this->data_, Phase::phase_name());
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 data->DeleteRegisterAllocationZone(); 2079 data->DeleteRegisterAllocationZone();
2074 } 2080 }
2075 2081
2076 CompilationInfo* PipelineImpl::info() const { return data_->info(); } 2082 CompilationInfo* PipelineImpl::info() const { return data_->info(); }
2077 2083
2078 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } 2084 Isolate* PipelineImpl::isolate() const { return info()->isolate(); }
2079 2085
2080 } // namespace compiler 2086 } // namespace compiler
2081 } // namespace internal 2087 } // namespace internal
2082 } // namespace v8 2088 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/compiler/wasm-compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698