Commit 51ef3212 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Remove the --print-turbo-replay flag.

Review-Url: https://codereview.chromium.org/2775423005
Cr-Commit-Position: refs/heads/master@{#44224}
parent 9937d0c4
......@@ -1235,8 +1235,6 @@ v8_source_set("v8_base") {
"src/compiler/graph-assembler.h",
"src/compiler/graph-reducer.cc",
"src/compiler/graph-reducer.h",
"src/compiler/graph-replay.cc",
"src/compiler/graph-replay.h",
"src/compiler/graph-trimmer.cc",
"src/compiler/graph-trimmer.h",
"src/compiler/graph-visualizer.cc",
......
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/graph-replay.h"
#include "src/compiler/all-nodes.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/node.h"
#include "src/compiler/operator.h"
#include "src/compiler/operator-properties.h"
namespace v8 {
namespace internal {
namespace compiler {
#ifdef DEBUG
void GraphReplayPrinter::PrintReplay(Graph* graph) {
GraphReplayPrinter replay;
PrintF(" Node* nil = graph()->NewNode(common()->Dead());\n");
Zone zone(graph->zone()->allocator(), ZONE_NAME);
AllNodes nodes(&zone, graph);
// Allocate the nodes first.
for (Node* node : nodes.reachable) {
PrintReplayOpCreator(node->op());
PrintF(" Node* n%d = graph()->NewNode(op", node->id());
for (int i = 0; i < node->InputCount(); ++i) {
PrintF(", nil");
}
PrintF("); USE(n%d);\n", node->id());
}
// Connect the nodes to their inputs.
for (Node* node : nodes.reachable) {
for (int i = 0; i < node->InputCount(); i++) {
PrintF(" n%d->ReplaceInput(%d, n%d);\n", node->id(), i,
node->InputAt(i)->id());
}
}
}
void GraphReplayPrinter::PrintReplayOpCreator(const Operator* op) {
IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode());
const char* builder = IrOpcode::IsCommonOpcode(opcode) ? "common" : "js";
const char* mnemonic = IrOpcode::IsCommonOpcode(opcode)
? IrOpcode::Mnemonic(opcode)
: IrOpcode::Mnemonic(opcode) + 2;
PrintF(" op = %s()->%s(", builder, mnemonic);
switch (opcode) {
case IrOpcode::kParameter:
PrintF("%d", ParameterIndexOf(op));
break;
case IrOpcode::kNumberConstant:
PrintF("%g", OpParameter<double>(op));
break;
case IrOpcode::kHeapConstant:
PrintF("unique_constant");
break;
case IrOpcode::kPhi:
PrintF("kMachAnyTagged, %d", op->ValueInputCount());
break;
case IrOpcode::kStateValues:
PrintF("%d", op->ValueInputCount());
break;
case IrOpcode::kEffectPhi:
PrintF("%d", op->EffectInputCount());
break;
case IrOpcode::kLoop:
case IrOpcode::kMerge:
PrintF("%d", op->ControlInputCount());
break;
case IrOpcode::kStart:
PrintF("%d", op->ValueOutputCount() - 3);
break;
case IrOpcode::kFrameState:
PrintF("JS_FRAME, BailoutId(-1), OutputFrameStateCombine::Ignore()");
break;
default:
break;
}
PrintF(");\n");
}
#endif // DEBUG
} // namespace compiler
} // namespace internal
} // namespace v8
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_GRAPH_REPLAY_H_
#define V8_COMPILER_GRAPH_REPLAY_H_
#include "src/compiler/node.h"
namespace v8 {
namespace internal {
namespace compiler {
// Forward declarations.
class Graph;
// Helper class to print a full replay of a graph. This replay can be used to
// materialize the same graph within a C++ unit test and hence test subsequent
// optimization passes on a graph without going through the construction steps.
class GraphReplayPrinter {
public:
#ifdef DEBUG
static void PrintReplay(Graph* graph);
#else
static void PrintReplay(Graph* graph) {}
#endif
private:
GraphReplayPrinter() {}
static void PrintReplayOpCreator(const Operator* op);
DISALLOW_COPY_AND_ASSIGN(GraphReplayPrinter);
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_GRAPH_REPLAY_H_
......@@ -26,7 +26,6 @@
#include "src/compiler/escape-analysis-reducer.h"
#include "src/compiler/escape-analysis.h"
#include "src/compiler/frame-elider.h"
#include "src/compiler/graph-replay.h"
#include "src/compiler/graph-trimmer.h"
#include "src/compiler/graph-visualizer.h"
#include "src/compiler/instruction-selector.h"
......@@ -1520,11 +1519,6 @@ bool PipelineImpl::CreateGraph() {
Run<EarlyGraphTrimmingPhase>();
RunPrintAndVerify("Early trimmed", true);
if (FLAG_print_turbo_replay) {
// Print a replay of the initial graph.
GraphReplayPrinter::PrintReplay(data->graph());
}
// Run the type-sensitive lowerings and optimizations on the graph.
{
// Determine the Typer operation flags.
......
......@@ -1098,8 +1098,6 @@ DEFINE_BOOL(check_handle_count, false,
DEFINE_BOOL(print_global_handles, false, "report global handles after GC")
// TurboFan debug-only flags.
DEFINE_BOOL(print_turbo_replay, false,
"print C++ code to recreate TurboFan graphs")
DEFINE_BOOL(trace_turbo_escape, false, "enable tracing in escape analysis")
// objects.cc
......
......@@ -630,8 +630,6 @@
'compiler/graph-assembler.h',
'compiler/graph-reducer.cc',
'compiler/graph-reducer.h',
'compiler/graph-replay.cc',
'compiler/graph-replay.h',
'compiler/graph-trimmer.cc',
'compiler/graph-trimmer.h',
'compiler/graph-visualizer.cc',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment