| 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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 info.set_output_code_kind(kind); | 1220 info.set_output_code_kind(kind); |
| 1221 | 1221 |
| 1222 // Construct a pipeline for scheduling and code generation. | 1222 // Construct a pipeline for scheduling and code generation. |
| 1223 ZonePool zone_pool; | 1223 ZonePool zone_pool; |
| 1224 PipelineData data(&zone_pool, &info, graph, schedule); | 1224 PipelineData data(&zone_pool, &info, graph, schedule); |
| 1225 base::SmartPointer<PipelineStatistics> pipeline_statistics; | 1225 base::SmartPointer<PipelineStatistics> pipeline_statistics; |
| 1226 if (FLAG_turbo_stats) { | 1226 if (FLAG_turbo_stats) { |
| 1227 pipeline_statistics.Reset(new PipelineStatistics(&info, &zone_pool)); | 1227 pipeline_statistics.Reset(new PipelineStatistics(&info, &zone_pool)); |
| 1228 pipeline_statistics->BeginPhaseKind("interpreter handler codegen"); | 1228 pipeline_statistics->BeginPhaseKind("interpreter handler codegen"); |
| 1229 } | 1229 } |
| 1230 |
| 1231 Pipeline pipeline(&info); |
| 1232 pipeline.data_ = &data; |
| 1233 DCHECK_NOT_NULL(data.schedule()); |
| 1234 |
| 1230 if (FLAG_trace_turbo) { | 1235 if (FLAG_trace_turbo) { |
| 1231 FILE* json_file = OpenVisualizerLogFile(&info, NULL, "json", "w+"); | 1236 FILE* json_file = OpenVisualizerLogFile(&info, NULL, "json", "w+"); |
| 1232 if (json_file != nullptr) { | 1237 if (json_file != nullptr) { |
| 1233 OFStream json_of(json_file); | 1238 OFStream json_of(json_file); |
| 1234 json_of << "{\"function\":\"" << info.GetDebugName().get() | 1239 json_of << "{\"function\":\"" << info.GetDebugName().get() |
| 1235 << "\", \"source\":\"\",\n\"phases\":["; | 1240 << "\", \"source\":\"\",\n\"phases\":["; |
| 1236 fclose(json_file); | 1241 fclose(json_file); |
| 1237 } | 1242 } |
| 1243 pipeline.Run<PrintGraphPhase>("Machine"); |
| 1238 } | 1244 } |
| 1239 | 1245 |
| 1240 Pipeline pipeline(&info); | |
| 1241 pipeline.data_ = &data; | |
| 1242 pipeline.RunPrintAndVerify("Machine", true); | |
| 1243 return pipeline.ScheduleAndGenerateCode(call_descriptor); | 1246 return pipeline.ScheduleAndGenerateCode(call_descriptor); |
| 1244 } | 1247 } |
| 1245 | 1248 |
| 1246 | 1249 |
| 1247 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, | 1250 Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, |
| 1248 Graph* graph, | 1251 Graph* graph, |
| 1249 Schedule* schedule) { | 1252 Schedule* schedule) { |
| 1250 CallDescriptor* call_descriptor = | 1253 CallDescriptor* call_descriptor = |
| 1251 Linkage::ComputeIncoming(info->zone(), info); | 1254 Linkage::ComputeIncoming(info->zone(), info); |
| 1252 return GenerateCodeForTesting(info, call_descriptor, graph, schedule); | 1255 return GenerateCodeForTesting(info, call_descriptor, graph, schedule); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 tcf << AsC1VRegisterAllocationData("CodeGen", | 1480 tcf << AsC1VRegisterAllocationData("CodeGen", |
| 1478 data->register_allocation_data()); | 1481 data->register_allocation_data()); |
| 1479 } | 1482 } |
| 1480 | 1483 |
| 1481 data->DeleteRegisterAllocationZone(); | 1484 data->DeleteRegisterAllocationZone(); |
| 1482 } | 1485 } |
| 1483 | 1486 |
| 1484 } // namespace compiler | 1487 } // namespace compiler |
| 1485 } // namespace internal | 1488 } // namespace internal |
| 1486 } // namespace v8 | 1489 } // namespace v8 |
| OLD | NEW |