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

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

Issue 1891663004: [compiler] Prevent unnecessary parsing with interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 8 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.cc ('k') | test/cctest/compiler/function-tester.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 <sstream> 8 #include <sstream>
9 9
10 #include "src/base/adapters.h" 10 #include "src/base/adapters.h"
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 PipelineRunScope scope(this->data_, Phase::phase_name()); 554 PipelineRunScope scope(this->data_, Phase::phase_name());
555 Phase phase; 555 Phase phase;
556 phase.Run(this->data_, scope.zone(), arg_0); 556 phase.Run(this->data_, scope.zone(), arg_0);
557 } 557 }
558 558
559 559
560 struct LoopAssignmentAnalysisPhase { 560 struct LoopAssignmentAnalysisPhase {
561 static const char* phase_name() { return "loop assignment analysis"; } 561 static const char* phase_name() { return "loop assignment analysis"; }
562 562
563 void Run(PipelineData* data, Zone* temp_zone) { 563 void Run(PipelineData* data, Zone* temp_zone) {
564 AstLoopAssignmentAnalyzer analyzer(data->graph_zone(), data->info()); 564 if (!data->info()->is_optimizing_from_bytecode()) {
565 LoopAssignmentAnalysis* loop_assignment = analyzer.Analyze(); 565 AstLoopAssignmentAnalyzer analyzer(data->graph_zone(), data->info());
566 data->set_loop_assignment(loop_assignment); 566 LoopAssignmentAnalysis* loop_assignment = analyzer.Analyze();
567 data->set_loop_assignment(loop_assignment);
568 }
567 } 569 }
568 }; 570 };
569 571
570 572
571 struct TypeHintAnalysisPhase { 573 struct TypeHintAnalysisPhase {
572 static const char* phase_name() { return "type hint analysis"; } 574 static const char* phase_name() { return "type hint analysis"; }
573 575
574 void Run(PipelineData* data, Zone* temp_zone) { 576 void Run(PipelineData* data, Zone* temp_zone) {
575 TypeHintAnalyzer analyzer(data->graph_zone()); 577 if (!data->info()->is_optimizing_from_bytecode()) {
576 Handle<Code> code(data->info()->shared_info()->code(), data->isolate()); 578 TypeHintAnalyzer analyzer(data->graph_zone());
577 TypeHintAnalysis* type_hint_analysis = analyzer.Analyze(code); 579 Handle<Code> code(data->info()->shared_info()->code(), data->isolate());
578 data->set_type_hint_analysis(type_hint_analysis); 580 TypeHintAnalysis* type_hint_analysis = analyzer.Analyze(code);
581 data->set_type_hint_analysis(type_hint_analysis);
582 }
579 } 583 }
580 }; 584 };
581 585
582 586
583 struct GraphBuilderPhase { 587 struct GraphBuilderPhase {
584 static const char* phase_name() { return "graph builder"; } 588 static const char* phase_name() { return "graph builder"; }
585 589
586 void Run(PipelineData* data, Zone* temp_zone) { 590 void Run(PipelineData* data, Zone* temp_zone) {
587 bool stack_check = !data->info()->IsStub(); 591 bool stack_check = !data->info()->IsStub();
588 bool succeeded = false; 592 bool succeeded = false;
589 593
590 if (data->info()->shared_info()->HasBytecodeArray()) { 594 if (data->info()->is_optimizing_from_bytecode()) {
591 BytecodeGraphBuilder graph_builder(temp_zone, data->info(), 595 BytecodeGraphBuilder graph_builder(temp_zone, data->info(),
592 data->jsgraph()); 596 data->jsgraph());
593 succeeded = graph_builder.CreateGraph(); 597 succeeded = graph_builder.CreateGraph();
594 } else { 598 } else {
595 AstGraphBuilderWithPositions graph_builder( 599 AstGraphBuilderWithPositions graph_builder(
596 temp_zone, data->info(), data->jsgraph(), data->loop_assignment(), 600 temp_zone, data->info(), data->jsgraph(), data->loop_assignment(),
597 data->type_hint_analysis(), data->source_positions()); 601 data->type_hint_analysis(), data->source_positions());
598 succeeded = graph_builder.CreateGraph(stack_check); 602 succeeded = graph_builder.CreateGraph(stack_check);
599 } 603 }
600 604
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 } 1628 }
1625 1629
1626 data->DeleteRegisterAllocationZone(); 1630 data->DeleteRegisterAllocationZone();
1627 } 1631 }
1628 1632
1629 Isolate* Pipeline::isolate() const { return info()->isolate(); } 1633 Isolate* Pipeline::isolate() const { return info()->isolate(); }
1630 1634
1631 } // namespace compiler 1635 } // namespace compiler
1632 } // namespace internal 1636 } // namespace internal
1633 } // namespace v8 1637 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | test/cctest/compiler/function-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698