| 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 <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/base/adapters.h" | 10 #include "src/base/adapters.h" |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 if (!FLAG_always_opt) { | 592 if (!FLAG_always_opt) { |
| 593 info()->MarkAsBailoutOnUninitialized(); | 593 info()->MarkAsBailoutOnUninitialized(); |
| 594 } | 594 } |
| 595 if (FLAG_native_context_specialization) { | 595 if (FLAG_native_context_specialization) { |
| 596 info()->MarkAsNativeContextSpecializing(); | 596 info()->MarkAsNativeContextSpecializing(); |
| 597 } | 597 } |
| 598 } | 598 } |
| 599 if (!info()->shared_info()->asm_function() || FLAG_turbo_asm_deoptimization) { | 599 if (!info()->shared_info()->asm_function() || FLAG_turbo_asm_deoptimization) { |
| 600 info()->MarkAsDeoptimizationEnabled(); | 600 info()->MarkAsDeoptimizationEnabled(); |
| 601 } | 601 } |
| 602 if (info()->is_deoptimization_enabled() && FLAG_turbo_type_feedback) { | |
| 603 info()->MarkAsTypeFeedbackEnabled(); | |
| 604 } | |
| 605 if (!info()->is_optimizing_from_bytecode()) { | 602 if (!info()->is_optimizing_from_bytecode()) { |
| 603 if (info()->is_deoptimization_enabled() && FLAG_turbo_type_feedback) { |
| 604 info()->MarkAsTypeFeedbackEnabled(); |
| 605 } |
| 606 if (!Compiler::EnsureDeoptimizationSupport(info())) return FAILED; | 606 if (!Compiler::EnsureDeoptimizationSupport(info())) return FAILED; |
| 607 } | 607 } |
| 608 | 608 |
| 609 linkage_ = new (&zone_) Linkage(Linkage::ComputeIncoming(&zone_, info())); | 609 linkage_ = new (&zone_) Linkage(Linkage::ComputeIncoming(&zone_, info())); |
| 610 | 610 |
| 611 if (!pipeline_.CreateGraph()) { | 611 if (!pipeline_.CreateGraph()) { |
| 612 if (isolate()->has_pending_exception()) return FAILED; // Stack overflowed. | 612 if (isolate()->has_pending_exception()) return FAILED; // Stack overflowed. |
| 613 return AbortOptimization(kGraphBuildingFailed); | 613 return AbortOptimization(kGraphBuildingFailed); |
| 614 } | 614 } |
| 615 | 615 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 data->set_loop_assignment(loop_assignment); | 717 data->set_loop_assignment(loop_assignment); |
| 718 } | 718 } |
| 719 } | 719 } |
| 720 }; | 720 }; |
| 721 | 721 |
| 722 | 722 |
| 723 struct TypeHintAnalysisPhase { | 723 struct TypeHintAnalysisPhase { |
| 724 static const char* phase_name() { return "type hint analysis"; } | 724 static const char* phase_name() { return "type hint analysis"; } |
| 725 | 725 |
| 726 void Run(PipelineData* data, Zone* temp_zone) { | 726 void Run(PipelineData* data, Zone* temp_zone) { |
| 727 if (!data->info()->is_optimizing_from_bytecode()) { | 727 if (data->info()->is_type_feedback_enabled()) { |
| 728 TypeHintAnalyzer analyzer(data->graph_zone()); | 728 TypeHintAnalyzer analyzer(data->graph_zone()); |
| 729 Handle<Code> code(data->info()->shared_info()->code(), data->isolate()); | 729 Handle<Code> code(data->info()->shared_info()->code(), data->isolate()); |
| 730 TypeHintAnalysis* type_hint_analysis = analyzer.Analyze(code); | 730 TypeHintAnalysis* type_hint_analysis = analyzer.Analyze(code); |
| 731 data->set_type_hint_analysis(type_hint_analysis); | 731 data->set_type_hint_analysis(type_hint_analysis); |
| 732 } | 732 } |
| 733 } | 733 } |
| 734 }; | 734 }; |
| 735 | 735 |
| 736 | 736 |
| 737 struct GraphBuilderPhase { | 737 struct GraphBuilderPhase { |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1811 data->DeleteRegisterAllocationZone(); | 1811 data->DeleteRegisterAllocationZone(); |
| 1812 } | 1812 } |
| 1813 | 1813 |
| 1814 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1814 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
| 1815 | 1815 |
| 1816 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1816 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
| 1817 | 1817 |
| 1818 } // namespace compiler | 1818 } // namespace compiler |
| 1819 } // namespace internal | 1819 } // namespace internal |
| 1820 } // namespace v8 | 1820 } // namespace v8 |
| OLD | NEW |