| 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 "src/base/platform/elapsed-timer.h" | 7 #include "src/base/platform/elapsed-timer.h" |
| 8 #include "src/compiler/ast-graph-builder.h" | 8 #include "src/compiler/ast-graph-builder.h" |
| 9 #include "src/compiler/code-generator.h" | 9 #include "src/compiler/code-generator.h" |
| 10 #include "src/compiler/graph-replay.h" | 10 #include "src/compiler/graph-replay.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Lower JSOperators where we can determine types. | 163 // Lower JSOperators where we can determine types. |
| 164 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, | 164 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, |
| 165 "typed lowering"); | 165 "typed lowering"); |
| 166 JSTypedLowering lowering(&jsgraph, &source_positions); | 166 JSTypedLowering lowering(&jsgraph, &source_positions); |
| 167 lowering.LowerAllNodes(); | 167 lowering.LowerAllNodes(); |
| 168 | 168 |
| 169 VerifyAndPrintGraph(&graph, "Lowered typed"); | 169 VerifyAndPrintGraph(&graph, "Lowered typed"); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 if (SupportedTarget()) { | |
| 174 // Lower any remaining generic JSOperators. | |
| 175 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, | |
| 176 "generic lowering"); | |
| 177 MachineOperatorBuilder machine(zone()); | |
| 178 JSGenericLowering lowering(info(), &jsgraph, &machine, &source_positions); | |
| 179 lowering.LowerAllNodes(); | |
| 180 | |
| 181 VerifyAndPrintGraph(&graph, "Lowered generic"); | |
| 182 } | |
| 183 | |
| 184 // Compute a schedule. | |
| 185 Schedule* schedule = ComputeSchedule(&graph); | |
| 186 TraceSchedule(schedule); | |
| 187 | |
| 188 Handle<Code> code = Handle<Code>::null(); | 173 Handle<Code> code = Handle<Code>::null(); |
| 189 if (SupportedTarget()) { | 174 if (SupportedTarget()) { |
| 190 { | 175 { |
| 176 // Lower any remaining generic JSOperators. |
| 177 PhaseStats lowering_stats(info(), PhaseStats::CREATE_GRAPH, |
| 178 "generic lowering"); |
| 179 MachineOperatorBuilder machine(zone()); |
| 180 JSGenericLowering lowering(info(), &jsgraph, &machine, &source_positions); |
| 181 lowering.LowerAllNodes(); |
| 182 |
| 183 VerifyAndPrintGraph(&graph, "Lowered generic"); |
| 184 } |
| 185 |
| 186 // Compute a schedule. |
| 187 Schedule* schedule = ComputeSchedule(&graph); |
| 188 TraceSchedule(schedule); |
| 189 |
| 190 { |
| 191 // Generate optimized code. | 191 // Generate optimized code. |
| 192 PhaseStats codegen_stats(info(), PhaseStats::CODEGEN, "codegen"); | 192 PhaseStats codegen_stats(info(), PhaseStats::CODEGEN, "codegen"); |
| 193 Linkage linkage(info()); | 193 Linkage linkage(info()); |
| 194 code = GenerateCode(&linkage, &graph, schedule, &source_positions); | 194 code = GenerateCode(&linkage, &graph, schedule, &source_positions); |
| 195 info()->SetCode(code); | 195 info()->SetCode(code); |
| 196 } | 196 } |
| 197 |
| 197 // Print optimized code. | 198 // Print optimized code. |
| 198 v8::internal::CodeGenerator::PrintCode(code, info()); | 199 v8::internal::CodeGenerator::PrintCode(code, info()); |
| 199 } | 200 } |
| 200 | 201 |
| 201 if (FLAG_trace_turbo) { | 202 if (FLAG_trace_turbo) { |
| 202 OFStream os(stdout); | 203 OFStream os(stdout); |
| 203 os << "--------------------------------------------------\n" | 204 os << "--------------------------------------------------\n" |
| 204 << "Finished compiling method " | 205 << "Finished compiling method " |
| 205 << info()->function()->debug_name()->ToCString().get() | 206 << info()->function()->debug_name()->ToCString().get() |
| 206 << " using Turbofan" << endl; | 207 << " using Turbofan" << endl; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } | 284 } |
| 284 | 285 |
| 285 // Generate native sequence. | 286 // Generate native sequence. |
| 286 CodeGenerator generator(&sequence); | 287 CodeGenerator generator(&sequence); |
| 287 return generator.GenerateCode(); | 288 return generator.GenerateCode(); |
| 288 } | 289 } |
| 289 | 290 |
| 290 } // namespace compiler | 291 } // namespace compiler |
| 291 } // namespace internal | 292 } // namespace internal |
| 292 } // namespace v8 | 293 } // namespace v8 |
| OLD | NEW |