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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
549 PipelineRunScope scope(this->data_, Phase::phase_name()); | 549 PipelineRunScope scope(this->data_, Phase::phase_name()); |
550 Phase phase; | 550 Phase phase; |
551 phase.Run(this->data_, scope.zone(), arg_0); | 551 phase.Run(this->data_, scope.zone(), arg_0); |
552 } | 552 } |
553 | 553 |
554 | 554 |
555 struct LoopAssignmentAnalysisPhase { | 555 struct LoopAssignmentAnalysisPhase { |
556 static const char* phase_name() { return "loop assignment analysis"; } | 556 static const char* phase_name() { return "loop assignment analysis"; } |
557 | 557 |
558 void Run(PipelineData* data, Zone* temp_zone) { | 558 void Run(PipelineData* data, Zone* temp_zone) { |
559 AstLoopAssignmentAnalyzer analyzer(data->graph_zone(), data->info()); | 559 if (!data->info()->shared_info()->HasBytecodeArray()) { |
Michael Starzinger
2016/04/15 12:21:40
We could add a flag (i.e. "kOptimizeFromBytecode")
Benedikt Meurer
2016/04/15 12:38:27
I'd really prefer the kOptimizeFromBytecode flag.
rmcilroy
2016/04/15 13:19:12
+1
Michael Starzinger
2016/04/15 13:21:48
Done.
| |
560 LoopAssignmentAnalysis* loop_assignment = analyzer.Analyze(); | 560 AstLoopAssignmentAnalyzer analyzer(data->graph_zone(), data->info()); |
561 data->set_loop_assignment(loop_assignment); | 561 LoopAssignmentAnalysis* loop_assignment = analyzer.Analyze(); |
562 data->set_loop_assignment(loop_assignment); | |
563 } | |
562 } | 564 } |
563 }; | 565 }; |
564 | 566 |
565 | 567 |
566 struct TypeHintAnalysisPhase { | 568 struct TypeHintAnalysisPhase { |
567 static const char* phase_name() { return "type hint analysis"; } | 569 static const char* phase_name() { return "type hint analysis"; } |
568 | 570 |
569 void Run(PipelineData* data, Zone* temp_zone) { | 571 void Run(PipelineData* data, Zone* temp_zone) { |
570 TypeHintAnalyzer analyzer(data->graph_zone()); | 572 if (!data->info()->shared_info()->HasBytecodeArray()) { |
571 Handle<Code> code(data->info()->shared_info()->code(), data->isolate()); | 573 TypeHintAnalyzer analyzer(data->graph_zone()); |
572 TypeHintAnalysis* type_hint_analysis = analyzer.Analyze(code); | 574 Handle<Code> code(data->info()->shared_info()->code(), data->isolate()); |
573 data->set_type_hint_analysis(type_hint_analysis); | 575 TypeHintAnalysis* type_hint_analysis = analyzer.Analyze(code); |
576 data->set_type_hint_analysis(type_hint_analysis); | |
577 } | |
574 } | 578 } |
575 }; | 579 }; |
576 | 580 |
577 | 581 |
578 struct GraphBuilderPhase { | 582 struct GraphBuilderPhase { |
579 static const char* phase_name() { return "graph builder"; } | 583 static const char* phase_name() { return "graph builder"; } |
580 | 584 |
581 void Run(PipelineData* data, Zone* temp_zone) { | 585 void Run(PipelineData* data, Zone* temp_zone) { |
582 bool stack_check = !data->info()->IsStub(); | 586 bool stack_check = !data->info()->IsStub(); |
583 bool succeeded = false; | 587 bool succeeded = false; |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1564 } | 1568 } |
1565 | 1569 |
1566 data->DeleteRegisterAllocationZone(); | 1570 data->DeleteRegisterAllocationZone(); |
1567 } | 1571 } |
1568 | 1572 |
1569 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1573 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
1570 | 1574 |
1571 } // namespace compiler | 1575 } // namespace compiler |
1572 } // namespace internal | 1576 } // namespace internal |
1573 } // namespace v8 | 1577 } // namespace v8 |
OLD | NEW |