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/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
11 #include "src/compiler/ast-graph-builder.h" | 11 #include "src/compiler/ast-graph-builder.h" |
12 #include "src/compiler/ast-loop-assignment-analyzer.h" | 12 #include "src/compiler/ast-loop-assignment-analyzer.h" |
13 #include "src/compiler/basic-block-instrumentor.h" | 13 #include "src/compiler/basic-block-instrumentor.h" |
14 #include "src/compiler/change-lowering.h" | 14 #include "src/compiler/change-lowering.h" |
15 #include "src/compiler/code-generator.h" | 15 #include "src/compiler/code-generator.h" |
16 #include "src/compiler/common-operator-reducer.h" | 16 #include "src/compiler/common-operator-reducer.h" |
17 #include "src/compiler/control-flow-optimizer.h" | 17 #include "src/compiler/control-flow-optimizer.h" |
18 #include "src/compiler/control-reducer.h" | 18 #include "src/compiler/control-reducer.h" |
19 #include "src/compiler/graph-replay.h" | 19 #include "src/compiler/graph-replay.h" |
20 #include "src/compiler/graph-visualizer.h" | 20 #include "src/compiler/graph-visualizer.h" |
21 #include "src/compiler/instruction.h" | 21 #include "src/compiler/instruction.h" |
22 #include "src/compiler/instruction-selector.h" | 22 #include "src/compiler/instruction-selector.h" |
23 #include "src/compiler/js-builtin-reducer.h" | 23 #include "src/compiler/js-builtin-reducer.h" |
24 #include "src/compiler/js-context-specialization.h" | 24 #include "src/compiler/js-context-specialization.h" |
25 #include "src/compiler/js-generic-lowering.h" | 25 #include "src/compiler/js-generic-lowering.h" |
26 #include "src/compiler/js-inlining.h" | 26 #include "src/compiler/js-inlining.h" |
27 #include "src/compiler/js-intrinsic-lowering.h" | 27 #include "src/compiler/js-intrinsic-lowering.h" |
28 #include "src/compiler/js-type-feedback.h" | |
28 #include "src/compiler/js-typed-lowering.h" | 29 #include "src/compiler/js-typed-lowering.h" |
29 #include "src/compiler/jump-threading.h" | 30 #include "src/compiler/jump-threading.h" |
30 #include "src/compiler/load-elimination.h" | 31 #include "src/compiler/load-elimination.h" |
31 #include "src/compiler/loop-analysis.h" | 32 #include "src/compiler/loop-analysis.h" |
32 #include "src/compiler/loop-peeling.h" | 33 #include "src/compiler/loop-peeling.h" |
33 #include "src/compiler/machine-operator-reducer.h" | 34 #include "src/compiler/machine-operator-reducer.h" |
34 #include "src/compiler/move-optimizer.h" | 35 #include "src/compiler/move-optimizer.h" |
35 #include "src/compiler/osr.h" | 36 #include "src/compiler/osr.h" |
36 #include "src/compiler/pipeline-statistics.h" | 37 #include "src/compiler/pipeline-statistics.h" |
37 #include "src/compiler/register-allocator.h" | 38 #include "src/compiler/register-allocator.h" |
38 #include "src/compiler/register-allocator-verifier.h" | 39 #include "src/compiler/register-allocator-verifier.h" |
39 #include "src/compiler/schedule.h" | 40 #include "src/compiler/schedule.h" |
40 #include "src/compiler/scheduler.h" | 41 #include "src/compiler/scheduler.h" |
41 #include "src/compiler/select-lowering.h" | 42 #include "src/compiler/select-lowering.h" |
42 #include "src/compiler/simplified-lowering.h" | 43 #include "src/compiler/simplified-lowering.h" |
43 #include "src/compiler/simplified-operator-reducer.h" | 44 #include "src/compiler/simplified-operator-reducer.h" |
44 #include "src/compiler/typer.h" | 45 #include "src/compiler/typer.h" |
45 #include "src/compiler/value-numbering-reducer.h" | 46 #include "src/compiler/value-numbering-reducer.h" |
46 #include "src/compiler/verifier.h" | 47 #include "src/compiler/verifier.h" |
47 #include "src/compiler/zone-pool.h" | 48 #include "src/compiler/zone-pool.h" |
48 #include "src/ostreams.h" | 49 #include "src/ostreams.h" |
50 #include "src/type-info.h" | |
49 #include "src/utils.h" | 51 #include "src/utils.h" |
50 | 52 |
51 namespace v8 { | 53 namespace v8 { |
52 namespace internal { | 54 namespace internal { |
53 namespace compiler { | 55 namespace compiler { |
54 | 56 |
55 class PipelineData { | 57 class PipelineData { |
56 public: | 58 public: |
57 // For main entry point. | 59 // For main entry point. |
58 PipelineData(ZonePool* zone_pool, CompilationInfo* info, | 60 PipelineData(ZonePool* zone_pool, CompilationInfo* info, |
59 PipelineStatistics* pipeline_statistics) | 61 PipelineStatistics* pipeline_statistics) |
60 : isolate_(info->isolate()), | 62 : isolate_(info->isolate()), |
61 info_(info), | 63 info_(info), |
62 outer_zone_(info_->zone()), | 64 outer_zone_(info_->zone()), |
63 zone_pool_(zone_pool), | 65 zone_pool_(zone_pool), |
64 pipeline_statistics_(pipeline_statistics), | 66 pipeline_statistics_(pipeline_statistics), |
65 compilation_failed_(false), | 67 compilation_failed_(false), |
66 code_(Handle<Code>::null()), | 68 code_(Handle<Code>::null()), |
67 graph_zone_scope_(zone_pool_), | 69 graph_zone_scope_(zone_pool_), |
68 graph_zone_(graph_zone_scope_.zone()), | 70 graph_zone_(graph_zone_scope_.zone()), |
69 graph_(nullptr), | 71 graph_(nullptr), |
70 loop_assignment_(nullptr), | 72 loop_assignment_(nullptr), |
71 machine_(nullptr), | 73 machine_(nullptr), |
72 common_(nullptr), | 74 common_(nullptr), |
73 javascript_(nullptr), | 75 javascript_(nullptr), |
74 jsgraph_(nullptr), | 76 jsgraph_(nullptr), |
77 js_type_feedback_(nullptr), | |
75 typer_(nullptr), | 78 typer_(nullptr), |
76 schedule_(nullptr), | 79 schedule_(nullptr), |
77 instruction_zone_scope_(zone_pool_), | 80 instruction_zone_scope_(zone_pool_), |
78 instruction_zone_(instruction_zone_scope_.zone()), | 81 instruction_zone_(instruction_zone_scope_.zone()), |
79 sequence_(nullptr), | 82 sequence_(nullptr), |
80 frame_(nullptr), | 83 frame_(nullptr), |
81 register_allocator_(nullptr) { | 84 register_allocator_(nullptr) { |
82 PhaseScope scope(pipeline_statistics, "init pipeline data"); | 85 PhaseScope scope(pipeline_statistics, "init pipeline data"); |
83 graph_ = new (graph_zone_) Graph(graph_zone_); | 86 graph_ = new (graph_zone_) Graph(graph_zone_); |
84 source_positions_.Reset(new SourcePositionTable(graph_)); | 87 source_positions_.Reset(new SourcePositionTable(graph_)); |
(...skipping 19 matching lines...) Expand all Loading... | |
104 code_(Handle<Code>::null()), | 107 code_(Handle<Code>::null()), |
105 graph_zone_scope_(zone_pool_), | 108 graph_zone_scope_(zone_pool_), |
106 graph_zone_(nullptr), | 109 graph_zone_(nullptr), |
107 graph_(graph), | 110 graph_(graph), |
108 source_positions_(new SourcePositionTable(graph_)), | 111 source_positions_(new SourcePositionTable(graph_)), |
109 loop_assignment_(nullptr), | 112 loop_assignment_(nullptr), |
110 machine_(nullptr), | 113 machine_(nullptr), |
111 common_(nullptr), | 114 common_(nullptr), |
112 javascript_(nullptr), | 115 javascript_(nullptr), |
113 jsgraph_(nullptr), | 116 jsgraph_(nullptr), |
117 js_type_feedback_(nullptr), | |
114 typer_(nullptr), | 118 typer_(nullptr), |
115 schedule_(schedule), | 119 schedule_(schedule), |
116 instruction_zone_scope_(zone_pool_), | 120 instruction_zone_scope_(zone_pool_), |
117 instruction_zone_(instruction_zone_scope_.zone()), | 121 instruction_zone_(instruction_zone_scope_.zone()), |
118 sequence_(nullptr), | 122 sequence_(nullptr), |
119 frame_(nullptr), | 123 frame_(nullptr), |
120 register_allocator_(nullptr) {} | 124 register_allocator_(nullptr) {} |
121 | 125 |
122 // For register allocation testing entry point. | 126 // For register allocation testing entry point. |
123 PipelineData(ZonePool* zone_pool, CompilationInfo* info, | 127 PipelineData(ZonePool* zone_pool, CompilationInfo* info, |
124 InstructionSequence* sequence) | 128 InstructionSequence* sequence) |
125 : isolate_(info->isolate()), | 129 : isolate_(info->isolate()), |
126 info_(info), | 130 info_(info), |
127 outer_zone_(nullptr), | 131 outer_zone_(nullptr), |
128 zone_pool_(zone_pool), | 132 zone_pool_(zone_pool), |
129 pipeline_statistics_(nullptr), | 133 pipeline_statistics_(nullptr), |
130 compilation_failed_(false), | 134 compilation_failed_(false), |
131 code_(Handle<Code>::null()), | 135 code_(Handle<Code>::null()), |
132 graph_zone_scope_(zone_pool_), | 136 graph_zone_scope_(zone_pool_), |
133 graph_zone_(nullptr), | 137 graph_zone_(nullptr), |
134 graph_(nullptr), | 138 graph_(nullptr), |
135 loop_assignment_(nullptr), | 139 loop_assignment_(nullptr), |
136 machine_(nullptr), | 140 machine_(nullptr), |
137 common_(nullptr), | 141 common_(nullptr), |
138 javascript_(nullptr), | 142 javascript_(nullptr), |
139 jsgraph_(nullptr), | 143 jsgraph_(nullptr), |
144 js_type_feedback_(nullptr), | |
140 typer_(nullptr), | 145 typer_(nullptr), |
141 schedule_(nullptr), | 146 schedule_(nullptr), |
142 instruction_zone_scope_(zone_pool_), | 147 instruction_zone_scope_(zone_pool_), |
143 instruction_zone_(sequence->zone()), | 148 instruction_zone_(sequence->zone()), |
144 sequence_(sequence), | 149 sequence_(sequence), |
145 frame_(nullptr), | 150 frame_(nullptr), |
146 register_allocator_(nullptr) {} | 151 register_allocator_(nullptr) {} |
147 | 152 |
148 ~PipelineData() { | 153 ~PipelineData() { |
149 DeleteInstructionZone(); | 154 DeleteInstructionZone(); |
(...skipping 17 matching lines...) Expand all Loading... | |
167 | 172 |
168 Zone* graph_zone() const { return graph_zone_; } | 173 Zone* graph_zone() const { return graph_zone_; } |
169 Graph* graph() const { return graph_; } | 174 Graph* graph() const { return graph_; } |
170 SourcePositionTable* source_positions() const { | 175 SourcePositionTable* source_positions() const { |
171 return source_positions_.get(); | 176 return source_positions_.get(); |
172 } | 177 } |
173 MachineOperatorBuilder* machine() const { return machine_; } | 178 MachineOperatorBuilder* machine() const { return machine_; } |
174 CommonOperatorBuilder* common() const { return common_; } | 179 CommonOperatorBuilder* common() const { return common_; } |
175 JSOperatorBuilder* javascript() const { return javascript_; } | 180 JSOperatorBuilder* javascript() const { return javascript_; } |
176 JSGraph* jsgraph() const { return jsgraph_; } | 181 JSGraph* jsgraph() const { return jsgraph_; } |
182 JSTypeFeedbackTable* js_type_feedback() { return js_type_feedback_; } | |
183 void set_js_type_feedback(JSTypeFeedbackTable* js_type_feedback) { | |
184 js_type_feedback_ = js_type_feedback; | |
185 } | |
177 Typer* typer() const { return typer_.get(); } | 186 Typer* typer() const { return typer_.get(); } |
178 | 187 |
179 LoopAssignmentAnalysis* loop_assignment() const { return loop_assignment_; } | 188 LoopAssignmentAnalysis* loop_assignment() const { return loop_assignment_; } |
180 void set_loop_assignment(LoopAssignmentAnalysis* loop_assignment) { | 189 void set_loop_assignment(LoopAssignmentAnalysis* loop_assignment) { |
181 DCHECK(!loop_assignment_); | 190 DCHECK(!loop_assignment_); |
182 loop_assignment_ = loop_assignment; | 191 loop_assignment_ = loop_assignment; |
183 } | 192 } |
184 | 193 |
185 Schedule* schedule() const { return schedule_; } | 194 Schedule* schedule() const { return schedule_; } |
186 void set_schedule(Schedule* schedule) { | 195 void set_schedule(Schedule* schedule) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 ZonePool::Scope graph_zone_scope_; | 261 ZonePool::Scope graph_zone_scope_; |
253 Zone* graph_zone_; | 262 Zone* graph_zone_; |
254 Graph* graph_; | 263 Graph* graph_; |
255 // TODO(dcarney): make this into a ZoneObject. | 264 // TODO(dcarney): make this into a ZoneObject. |
256 SmartPointer<SourcePositionTable> source_positions_; | 265 SmartPointer<SourcePositionTable> source_positions_; |
257 LoopAssignmentAnalysis* loop_assignment_; | 266 LoopAssignmentAnalysis* loop_assignment_; |
258 MachineOperatorBuilder* machine_; | 267 MachineOperatorBuilder* machine_; |
259 CommonOperatorBuilder* common_; | 268 CommonOperatorBuilder* common_; |
260 JSOperatorBuilder* javascript_; | 269 JSOperatorBuilder* javascript_; |
261 JSGraph* jsgraph_; | 270 JSGraph* jsgraph_; |
271 JSTypeFeedbackTable* js_type_feedback_; | |
Michael Starzinger
2015/03/24 09:06:40
nit: If the feedback table lives in this block, it
titzer
2015/03/24 10:49:32
Done.
| |
262 // TODO(dcarney): make this into a ZoneObject. | 272 // TODO(dcarney): make this into a ZoneObject. |
263 SmartPointer<Typer> typer_; | 273 SmartPointer<Typer> typer_; |
264 Schedule* schedule_; | 274 Schedule* schedule_; |
265 | 275 |
266 // All objects in the following group of fields are allocated in | 276 // All objects in the following group of fields are allocated in |
267 // instruction_zone_. They are all set to NULL when the instruction_zone_ is | 277 // instruction_zone_. They are all set to NULL when the instruction_zone_ is |
268 // destroyed. | 278 // destroyed. |
269 ZonePool::Scope instruction_zone_scope_; | 279 ZonePool::Scope instruction_zone_scope_; |
270 Zone* instruction_zone_; | 280 Zone* instruction_zone_; |
271 InstructionSequence* sequence_; | 281 InstructionSequence* sequence_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 return info->function()->debug_name()->ToCString(); | 313 return info->function()->debug_name()->ToCString(); |
304 } | 314 } |
305 } | 315 } |
306 | 316 |
307 | 317 |
308 class AstGraphBuilderWithPositions : public AstGraphBuilder { | 318 class AstGraphBuilderWithPositions : public AstGraphBuilder { |
309 public: | 319 public: |
310 AstGraphBuilderWithPositions(Zone* local_zone, CompilationInfo* info, | 320 AstGraphBuilderWithPositions(Zone* local_zone, CompilationInfo* info, |
311 JSGraph* jsgraph, | 321 JSGraph* jsgraph, |
312 LoopAssignmentAnalysis* loop_assignment, | 322 LoopAssignmentAnalysis* loop_assignment, |
323 JSTypeFeedbackTable* js_type_feedback, | |
313 SourcePositionTable* source_positions) | 324 SourcePositionTable* source_positions) |
314 : AstGraphBuilder(local_zone, info, jsgraph, loop_assignment), | 325 : AstGraphBuilder(local_zone, info, jsgraph, loop_assignment, |
326 js_type_feedback), | |
315 source_positions_(source_positions), | 327 source_positions_(source_positions), |
316 start_position_(info->shared_info()->start_position()) {} | 328 start_position_(info->shared_info()->start_position()) {} |
317 | 329 |
318 bool CreateGraph(bool constant_context, bool stack_check) { | 330 bool CreateGraph(bool constant_context, bool stack_check) { |
319 SourcePositionTable::Scope pos_scope(source_positions_, start_position_); | 331 SourcePositionTable::Scope pos_scope(source_positions_, start_position_); |
320 return AstGraphBuilder::CreateGraph(constant_context, stack_check); | 332 return AstGraphBuilder::CreateGraph(constant_context, stack_check); |
321 } | 333 } |
322 | 334 |
323 #define DEF_VISIT(type) \ | 335 #define DEF_VISIT(type) \ |
324 void Visit##type(type* node) OVERRIDE { \ | 336 void Visit##type(type* node) OVERRIDE { \ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
412 } | 424 } |
413 }; | 425 }; |
414 | 426 |
415 | 427 |
416 struct GraphBuilderPhase { | 428 struct GraphBuilderPhase { |
417 static const char* phase_name() { return "graph builder"; } | 429 static const char* phase_name() { return "graph builder"; } |
418 | 430 |
419 void Run(PipelineData* data, Zone* temp_zone, bool constant_context) { | 431 void Run(PipelineData* data, Zone* temp_zone, bool constant_context) { |
420 AstGraphBuilderWithPositions graph_builder( | 432 AstGraphBuilderWithPositions graph_builder( |
421 temp_zone, data->info(), data->jsgraph(), data->loop_assignment(), | 433 temp_zone, data->info(), data->jsgraph(), data->loop_assignment(), |
422 data->source_positions()); | 434 data->js_type_feedback(), data->source_positions()); |
423 bool stack_check = !data->info()->IsStub(); | 435 bool stack_check = !data->info()->IsStub(); |
424 if (!graph_builder.CreateGraph(constant_context, stack_check)) { | 436 if (!graph_builder.CreateGraph(constant_context, stack_check)) { |
425 data->set_compilation_failed(); | 437 data->set_compilation_failed(); |
426 } | 438 } |
427 } | 439 } |
428 }; | 440 }; |
429 | 441 |
430 | 442 |
431 struct ContextSpecializerPhase { | 443 struct ContextSpecializerPhase { |
432 static const char* phase_name() { return "context specializing"; } | 444 static const char* phase_name() { return "context specializing"; } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 SourcePositionTable::Scope pos(data->source_positions(), | 485 SourcePositionTable::Scope pos(data->source_positions(), |
474 SourcePosition::Unknown()); | 486 SourcePosition::Unknown()); |
475 OsrHelper osr_helper(data->info()); | 487 OsrHelper osr_helper(data->info()); |
476 bool success = | 488 bool success = |
477 osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone); | 489 osr_helper.Deconstruct(data->jsgraph(), data->common(), temp_zone); |
478 if (!success) data->info()->RetryOptimization(kOsrCompileFailed); | 490 if (!success) data->info()->RetryOptimization(kOsrCompileFailed); |
479 } | 491 } |
480 }; | 492 }; |
481 | 493 |
482 | 494 |
495 struct JSTypeFeedbackPhase { | |
496 static const char* phase_name() { return "type feedback specializing"; } | |
497 | |
498 void Run(PipelineData* data, Zone* temp_zone) { | |
499 SourcePositionTable::Scope pos(data->source_positions(), | |
500 SourcePosition::Unknown()); | |
501 Handle<Context> native_context(data->info()->context()->native_context()); | |
502 TypeFeedbackOracle oracle(data->isolate(), temp_zone, | |
503 data->info()->unoptimized_code(), | |
504 data->info()->feedback_vector(), native_context); | |
505 GraphReducer graph_reducer(data->graph(), temp_zone); | |
506 JSTypeFeedbackSpecializer specializer(data->jsgraph(), | |
507 data->js_type_feedback(), &oracle); | |
508 AddReducer(data, &graph_reducer, &specializer); | |
509 graph_reducer.ReduceGraph(); | |
510 } | |
511 }; | |
512 | |
513 | |
483 struct TypedLoweringPhase { | 514 struct TypedLoweringPhase { |
484 static const char* phase_name() { return "typed lowering"; } | 515 static const char* phase_name() { return "typed lowering"; } |
485 | 516 |
486 void Run(PipelineData* data, Zone* temp_zone) { | 517 void Run(PipelineData* data, Zone* temp_zone) { |
487 SourcePositionTable::Scope pos(data->source_positions(), | 518 SourcePositionTable::Scope pos(data->source_positions(), |
488 SourcePosition::Unknown()); | 519 SourcePosition::Unknown()); |
489 LoadElimination load_elimination; | 520 LoadElimination load_elimination; |
490 JSBuiltinReducer builtin_reducer(data->jsgraph()); | 521 JSBuiltinReducer builtin_reducer(data->jsgraph()); |
491 JSTypedLowering typed_lowering(data->jsgraph(), temp_zone); | 522 JSTypedLowering typed_lowering(data->jsgraph(), temp_zone); |
492 JSIntrinsicLowering intrinsic_lowering(data->jsgraph()); | 523 JSIntrinsicLowering intrinsic_lowering(data->jsgraph()); |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
877 } | 908 } |
878 } | 909 } |
879 json_of << "\",\n\"phases\":["; | 910 json_of << "\",\n\"phases\":["; |
880 fclose(json_file); | 911 fclose(json_file); |
881 } | 912 } |
882 } | 913 } |
883 | 914 |
884 PipelineData data(&zone_pool, info(), pipeline_statistics.get()); | 915 PipelineData data(&zone_pool, info(), pipeline_statistics.get()); |
885 this->data_ = &data; | 916 this->data_ = &data; |
886 | 917 |
918 if (info()->is_type_feedback_enabled()) { | |
919 data.set_js_type_feedback(new (data.graph_zone()) | |
920 JSTypeFeedbackTable(data.graph_zone())); | |
921 } | |
922 | |
887 BeginPhaseKind("graph creation"); | 923 BeginPhaseKind("graph creation"); |
888 | 924 |
889 if (FLAG_trace_turbo) { | 925 if (FLAG_trace_turbo) { |
890 OFStream os(stdout); | 926 OFStream os(stdout); |
891 os << "---------------------------------------------------\n" | 927 os << "---------------------------------------------------\n" |
892 << "Begin compiling method " << GetDebugName(info()).get() | 928 << "Begin compiling method " << GetDebugName(info()).get() |
893 << " using Turbofan" << std::endl; | 929 << " using Turbofan" << std::endl; |
894 TurboCfgFile tcf(isolate()); | 930 TurboCfgFile tcf(isolate()); |
895 tcf << AsC1VCompilation(info()); | 931 tcf << AsC1VCompilation(info()); |
896 } | 932 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
944 Run<StressLoopPeelingPhase>(); | 980 Run<StressLoopPeelingPhase>(); |
945 RunPrintAndVerify("Loop peeled", true); | 981 RunPrintAndVerify("Loop peeled", true); |
946 } | 982 } |
947 | 983 |
948 if (info()->is_osr()) { | 984 if (info()->is_osr()) { |
949 Run<OsrDeconstructionPhase>(); | 985 Run<OsrDeconstructionPhase>(); |
950 if (info()->bailout_reason() != kNoReason) return Handle<Code>::null(); | 986 if (info()->bailout_reason() != kNoReason) return Handle<Code>::null(); |
951 RunPrintAndVerify("OSR deconstruction"); | 987 RunPrintAndVerify("OSR deconstruction"); |
952 } | 988 } |
953 | 989 |
990 if (info()->is_type_feedback_enabled()) { | |
991 Run<JSTypeFeedbackPhase>(); | |
992 RunPrintAndVerify("JSType feedback"); | |
993 } | |
994 | |
954 // Lower simplified operators and insert changes. | 995 // Lower simplified operators and insert changes. |
955 Run<SimplifiedLoweringPhase>(); | 996 Run<SimplifiedLoweringPhase>(); |
956 RunPrintAndVerify("Lowered simplified"); | 997 RunPrintAndVerify("Lowered simplified"); |
957 | 998 |
958 // Optimize control flow. | 999 // Optimize control flow. |
959 if (FLAG_turbo_cf_optimization) { | 1000 if (FLAG_turbo_cf_optimization) { |
960 Run<ControlFlowOptimizationPhase>(); | 1001 Run<ControlFlowOptimizationPhase>(); |
961 RunPrintAndVerify("Control flow optimized"); | 1002 RunPrintAndVerify("Control flow optimized"); |
962 } | 1003 } |
963 | 1004 |
964 // Lower changes that have been inserted before. | 1005 // Lower changes that have been inserted before. |
965 Run<ChangeLoweringPhase>(); | 1006 Run<ChangeLoweringPhase>(); |
966 // // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. | 1007 // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
967 RunPrintAndVerify("Lowered changes", true); | 1008 RunPrintAndVerify("Lowered changes", true); |
968 | 1009 |
969 Run<LateControlReductionPhase>(); | 1010 Run<LateControlReductionPhase>(); |
970 RunPrintAndVerify("Late Control reduced"); | 1011 RunPrintAndVerify("Late Control reduced"); |
971 } else { | 1012 } else { |
972 if (info()->is_osr()) { | 1013 if (info()->is_osr()) { |
973 Run<OsrDeconstructionPhase>(); | 1014 Run<OsrDeconstructionPhase>(); |
974 if (info()->bailout_reason() != kNoReason) return Handle<Code>::null(); | 1015 if (info()->bailout_reason() != kNoReason) return Handle<Code>::null(); |
975 RunPrintAndVerify("OSR deconstruction"); | 1016 RunPrintAndVerify("OSR deconstruction"); |
976 } | 1017 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1194 | 1235 |
1195 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { | 1236 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { |
1196 TurboCfgFile tcf(data->isolate()); | 1237 TurboCfgFile tcf(data->isolate()); |
1197 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); | 1238 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); |
1198 } | 1239 } |
1199 } | 1240 } |
1200 | 1241 |
1201 } // namespace compiler | 1242 } // namespace compiler |
1202 } // namespace internal | 1243 } // namespace internal |
1203 } // namespace v8 | 1244 } // namespace v8 |
OLD | NEW |