[wasm] Debug-time print for compiler graph

Simple "Print" API for the compiler graph.

BUG=

Review-Url: https://codereview.chromium.org/2447993002
Cr-Commit-Position: refs/heads/master@{#40571}
This commit is contained in:
mtrofin 2016-10-25 10:59:49 -07:00 committed by Commit bot
parent d7a8caa92a
commit e645b56073
2 changed files with 10 additions and 1 deletions

View File

@ -7,8 +7,9 @@
#include <algorithm>
#include "src/base/bits.h"
#include "src/compiler/node.h"
#include "src/compiler/graph-visualizer.h"
#include "src/compiler/node-properties.h"
#include "src/compiler/node.h"
#include "src/compiler/verifier.h"
namespace v8 {
@ -72,6 +73,11 @@ NodeId Graph::NextNodeId() {
return id;
}
void Graph::Print() const {
OFStream os(stdout);
os << AsRPO(*this);
}
} // namespace compiler
} // namespace internal
} // namespace v8

View File

@ -121,6 +121,9 @@ class V8_EXPORT_PRIVATE Graph final : public NON_EXPORTED_BASE(ZoneObject) {
void AddDecorator(GraphDecorator* decorator);
void RemoveDecorator(GraphDecorator* decorator);
// Very simple print API usable in a debugger.
void Print() const;
private:
friend class NodeMarkerBase;