5 #include "src/vector-slot-pair.h" 7 #include "src/feedback-vector.h" 12 VectorSlotPair::VectorSlotPair() =
default;
14 int VectorSlotPair::index()
const {
15 return vector_.is_null() ? -1 : FeedbackVector::GetIndex(slot_);
18 bool operator==(VectorSlotPair
const& lhs, VectorSlotPair
const& rhs) {
19 return lhs.slot() == rhs.slot() &&
20 lhs.vector().location() == rhs.vector().location() &&
21 lhs.ic_state() == rhs.ic_state();
24 bool operator!=(VectorSlotPair
const& lhs, VectorSlotPair
const& rhs) {
28 std::ostream& operator<<(std::ostream& os,
const VectorSlotPair& p) {
30 return os <<
"VectorSlotPair(" << p.slot() <<
", " 31 << InlineCacheState2String(p.ic_state()) <<
")";
33 return os <<
"VectorSlotPair(INVALID)";
36 size_t hash_value(VectorSlotPair
const& p) {
37 return base::hash_combine(p.slot(), p.vector().location(), p.ic_state());