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

Unified Diff: src/compiler/pipeline.cc

Issue 1928503002: [wasm] Fix turbolizer output (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address titzer's comments Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/pipeline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 3ea6c2ba812ef824b2ddadd4ee03040b062c3c94..c12853c3576254e9ca3425ef588ba26de041fa11 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -572,6 +572,8 @@ PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() {
return SUCCEEDED;
}
+} // namespace
+
class PipelineWasmCompilationJob final : public CompilationJob {
public:
explicit PipelineWasmCompilationJob(CompilationInfo* info, Graph* graph,
@@ -602,6 +604,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;
}
@@ -612,8 +626,6 @@ PipelineWasmCompilationJob::GenerateCodeImpl() {
return SUCCEEDED;
}
-} // namespace
-
template <typename Phase>
void Pipeline::Run() {
@@ -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);
}
« no previous file with comments | « src/compiler/pipeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698