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

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

Issue 1291693004: [Interpreter] Bytecode graph builder (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixes/progress from rmcilroy to enable turbofan to process graphs from bytecode. Created 5 years, 3 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
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"
11 #include "src/base/platform/elapsed-timer.h" 11 #include "src/base/platform/elapsed-timer.h"
12 #include "src/compiler/ast-graph-builder.h" 12 #include "src/compiler/ast-graph-builder.h"
13 #include "src/compiler/ast-loop-assignment-analyzer.h" 13 #include "src/compiler/ast-loop-assignment-analyzer.h"
14 #include "src/compiler/basic-block-instrumentor.h" 14 #include "src/compiler/basic-block-instrumentor.h"
15 #include "src/compiler/bytecode-graph-builder.h"
15 #include "src/compiler/change-lowering.h" 16 #include "src/compiler/change-lowering.h"
16 #include "src/compiler/code-generator.h" 17 #include "src/compiler/code-generator.h"
17 #include "src/compiler/common-operator-reducer.h" 18 #include "src/compiler/common-operator-reducer.h"
18 #include "src/compiler/control-flow-optimizer.h" 19 #include "src/compiler/control-flow-optimizer.h"
19 #include "src/compiler/dead-code-elimination.h" 20 #include "src/compiler/dead-code-elimination.h"
20 #include "src/compiler/frame-elider.h" 21 #include "src/compiler/frame-elider.h"
21 #include "src/compiler/graph-replay.h" 22 #include "src/compiler/graph-replay.h"
22 #include "src/compiler/graph-trimmer.h" 23 #include "src/compiler/graph-trimmer.h"
23 #include "src/compiler/graph-visualizer.h" 24 #include "src/compiler/graph-visualizer.h"
24 #include "src/compiler/greedy-allocator.h" 25 #include "src/compiler/greedy-allocator.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 LoopAssignmentAnalysis* loop_assignment = analyzer.Analyze(); 466 LoopAssignmentAnalysis* loop_assignment = analyzer.Analyze();
466 data->set_loop_assignment(loop_assignment); 467 data->set_loop_assignment(loop_assignment);
467 } 468 }
468 }; 469 };
469 470
470 471
471 struct GraphBuilderPhase { 472 struct GraphBuilderPhase {
472 static const char* phase_name() { return "graph builder"; } 473 static const char* phase_name() { return "graph builder"; }
473 474
474 void Run(PipelineData* data, Zone* temp_zone) { 475 void Run(PipelineData* data, Zone* temp_zone) {
475 AstGraphBuilderWithPositions graph_builder(
476 temp_zone, data->info(), data->jsgraph(), data->loop_assignment(),
477 data->js_type_feedback(), data->source_positions());
478 bool stack_check = !data->info()->IsStub(); 476 bool stack_check = !data->info()->IsStub();
479 if (!graph_builder.CreateGraph(stack_check)) { 477 bool succeeded = false;
478
479 if (data->info()->shared_info()->HasBytecodeArray()) {
480 BytecodeGraphBuilder graph_builder(temp_zone, data->info(),
481 data->jsgraph());
482 succeeded = graph_builder.CreateGraph(stack_check);
483 } else {
484 AstGraphBuilderWithPositions graph_builder(
485 temp_zone, data->info(), data->jsgraph(), data->loop_assignment(),
486 data->js_type_feedback(), data->source_positions());
487 succeeded = graph_builder.CreateGraph(stack_check);
488 }
489
490 if (!succeeded) {
480 data->set_compilation_failed(); 491 data->set_compilation_failed();
481 } 492 }
482 } 493 }
483 }; 494 };
484 495
485 496
486 struct InliningPhase { 497 struct InliningPhase {
487 static const char* phase_name() { return "inlining"; } 498 static const char* phase_name() { return "inlining"; }
488 499
489 void Run(PipelineData* data, Zone* temp_zone) { 500 void Run(PipelineData* data, Zone* temp_zone) {
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 tcf << AsC1VRegisterAllocationData("CodeGen", 1409 tcf << AsC1VRegisterAllocationData("CodeGen",
1399 data->register_allocation_data()); 1410 data->register_allocation_data());
1400 } 1411 }
1401 1412
1402 data->DeleteRegisterAllocationZone(); 1413 data->DeleteRegisterAllocationZone();
1403 } 1414 }
1404 1415
1405 } // namespace compiler 1416 } // namespace compiler
1406 } // namespace internal 1417 } // namespace internal
1407 } // namespace v8 1418 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698