Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: src/utils.h

Issue 1370303004: Distinction between FeedbackVectorICSlot and FeedbackVectorSlot eliminated. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed release builds Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/typing.cc ('k') | src/utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) { }
« no previous file with comments | « src/typing.cc ('k') | src/utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698