Index: src/utils.h |
diff --git a/src/utils.h b/src/utils.h |
index ef35f9696489678a74a7dcc33793343f00193eb4..23f52f63be4b0449b49430709897d441223ff3fa 100644 |
--- a/src/utils.h |
+++ b/src/utils.h |
@@ -1043,23 +1043,23 @@ class TypeFeedbackId { |
}; |
-template <int dummy_parameter> |
-class VectorSlot { |
+class FeedbackVectorSlot { |
public: |
- explicit VectorSlot(int id) : id_(id) {} |
+ FeedbackVectorSlot() : id_(kInvalidSlot) {} |
+ explicit FeedbackVectorSlot(int id) : id_(id) {} |
int ToInt() const { return id_; } |
- static VectorSlot Invalid() { return VectorSlot(kInvalidSlot); } |
+ static FeedbackVectorSlot Invalid() { return FeedbackVectorSlot(); } |
bool IsInvalid() const { return id_ == kInvalidSlot; } |
- VectorSlot next() const { |
- DCHECK_NE(kInvalidSlot, id_); |
- return VectorSlot(id_ + 1); |
+ bool operator==(FeedbackVectorSlot that) const { |
+ return this->id_ == that.id_; |
} |
+ bool operator!=(FeedbackVectorSlot that) const { return !(*this == that); } |
- bool operator==(VectorSlot that) const { return this->id_ == that.id_; } |
- bool operator!=(VectorSlot that) const { return !(*this == that); } |
+ friend size_t hash_value(FeedbackVectorSlot slot) { return slot.ToInt(); } |
+ friend std::ostream& operator<<(std::ostream& os, FeedbackVectorSlot); |
private: |
static const int kInvalidSlot = -1; |
@@ -1068,16 +1068,6 @@ class VectorSlot { |
}; |
-template <int dummy_parameter> |
-size_t hash_value(VectorSlot<dummy_parameter> slot) { |
- return slot.ToInt(); |
-} |
- |
- |
-typedef VectorSlot<0> FeedbackVectorSlot; |
-typedef VectorSlot<1> FeedbackVectorICSlot; |
- |
- |
class BailoutId { |
public: |
explicit BailoutId(int id) : id_(id) { } |