Commit 0afbcdfa authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

Add output operator to VectorSlotPair

Bug: v8:7127
Change-Id: Ibdbf6c5627f3fe8a29ae44cc0c284896c344a0ae
Reviewed-on: https://chromium-review.googlesource.com/817295
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49967}
parent eb62a4ab
......@@ -24,6 +24,14 @@ bool operator!=(VectorSlotPair const& lhs, VectorSlotPair const& rhs) {
return !(lhs == rhs);
}
std::ostream& operator<<(std::ostream& os, const VectorSlotPair& pair) {
if (pair.IsValid()) {
return os << "VectorSlotPair(" << pair.vector().address() << pair.slot()
<< ")";
}
return os << "VectorSlotPair(INVALID)";
}
size_t hash_value(VectorSlotPair const& p) {
return base::hash_combine(p.slot(), p.vector().location());
}
......
......@@ -37,6 +37,8 @@ class V8_EXPORT_PRIVATE VectorSlotPair {
bool operator==(VectorSlotPair const&, VectorSlotPair const&);
bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
std::ostream& operator<<(std::ostream& os, const VectorSlotPair& pair);
size_t hash_value(VectorSlotPair const&);
} // namespace internal
......
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