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

Unified Diff: src/utils.h

Issue 641373002: Introduce FeedbackVectorSlot type - better than int. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 years, 2 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/type-info.cc ('k') | src/x64/full-codegen-x64.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 bfafe3367a6aeb47a06ab624d7187899c37791c8..5c58ff8e608d03df56ea9b1b082dffc726d95ec8 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -951,6 +951,28 @@ class TypeFeedbackId {
};
+class FeedbackVectorSlot {
+ public:
+ explicit FeedbackVectorSlot(int id) : id_(id) {}
+ int ToInt() const { return id_; }
+
+ static FeedbackVectorSlot Invalid() {
+ return FeedbackVectorSlot(kInvalidSlot);
+ }
+ bool IsInvalid() const { return id_ == kInvalidSlot; }
+
+ FeedbackVectorSlot next() const {
+ DCHECK(id_ != kInvalidSlot);
+ return FeedbackVectorSlot(id_ + 1);
+ }
+
+ private:
+ static const int kInvalidSlot = -1;
+
+ int id_;
+};
+
+
class BailoutId {
public:
explicit BailoutId(int id) : id_(id) { }
« no previous file with comments | « src/type-info.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698