Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index f4d898f8a5457af7357f2e56a7c15429de5f9a38..5adeb755f6d8c220229a9c12d07f1b7093ede82b 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -602,6 +602,18 @@ PipelineWasmCompilationJob::CreateGraphImpl() { |
PipelineWasmCompilationJob::Status |
PipelineWasmCompilationJob::OptimizeGraphImpl() { |
+ if (FLAG_trace_turbo) { |
+ FILE* json_file = OpenVisualizerLogFile(info(), nullptr, "json", "w+"); |
+ if (json_file != nullptr) { |
+ OFStream json_of(json_file); |
+ json_of << "{\"function\":\"" << info()->GetDebugName().get() |
+ << "\", \"source\":\"\",\n\"phases\":["; |
+ fclose(json_file); |
+ } |
+ } |
+ |
+ pipeline_.RunPrintAndVerify("Machine", true); |
+ |
if (!pipeline_.ScheduleAndSelectInstructions(&linkage_)) return FAILED; |
return SUCCEEDED; |
} |
@@ -1452,10 +1464,18 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info, |
} |
Pipeline pipeline(&data); |
- if (data.schedule() == nullptr) { |
- // TODO(rossberg): Should this really be untyped? |
- pipeline.RunPrintAndVerify("Machine", true); |
+ |
+ if (FLAG_trace_turbo) { |
+ FILE* json_file = OpenVisualizerLogFile(info, nullptr, "json", "w+"); |
+ if (json_file != nullptr) { |
+ OFStream json_of(json_file); |
+ json_of << "{\"function\":\"" << info->GetDebugName().get() |
+ << "\", \"source\":\"\",\n\"phases\":["; |
+ fclose(json_file); |
+ } |
} |
+ // TODO(rossberg): Should this really be untyped? |
+ pipeline.RunPrintAndVerify("Machine", true); |
return pipeline.ScheduleAndGenerateCode(call_descriptor); |
} |