Print MachineTypes when using --trace-turbo-graph.

Previously, ZoneVector<MachineType>* printed just as a pointer; now we
print each MachineType in it, separated by commas.

BUG=

Review-Url: https://codereview.chromium.org/2030323002
Cr-Commit-Position: refs/heads/master@{#36736}
This commit is contained in:
bgeron 2016-06-06 02:44:25 -07:00 committed by Commit bot
parent 960a87bbd5
commit 0d3413f874
2 changed files with 16 additions and 0 deletions

View File

@ -167,6 +167,20 @@ std::ostream& operator<<(std::ostream& os,
return os << p.value() << "|" << p.rmode() << "|" << p.type();
}
std::ostream& operator<<(std::ostream& os,
const ZoneVector<MachineType>* types) {
// Print all the MachineTypes, separated by commas.
bool first = true;
for (MachineType elem : *types) {
if (!first) {
os << ", ";
}
first = false;
os << elem;
}
return os;
}
#define CACHED_OP_LIST(V) \
V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \
V(DeoptimizeIf, Operator::kFoldable, 2, 1, 1, 0, 1, 1) \

View File

@ -136,6 +136,8 @@ bool operator!=(RelocatablePtrConstantInfo const& lhs,
RelocatablePtrConstantInfo const& rhs);
std::ostream& operator<<(std::ostream&, RelocatablePtrConstantInfo const&);
size_t hash_value(RelocatablePtrConstantInfo const& p);
std::ostream& operator<<(std::ostream& os,
const ZoneVector<MachineType>* types);
// Interface for building common operators that can be used at any level of IR,
// including JavaScript, mid-level, and low-level.