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

Unified Diff: src/utils.h

Issue 639123009: Classes: Add basic support for properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase 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/types.h ('k') | src/v8natives.js » ('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 5c58ff8e608d03df56ea9b1b082dffc726d95ec8..e2e10fd73d0866f69082cbca6279e58e805b61e0 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -156,7 +156,7 @@ T Abs(T a) {
// Floor(-0.0) == 0.0
inline double Floor(double x) {
-#ifdef _MSC_VER
+#if V8_CC_MSVC
if (x == 0) return x; // Fix for issue 3477.
#endif
return std::floor(x);
@@ -951,21 +951,22 @@ class TypeFeedbackId {
};
-class FeedbackVectorSlot {
+template <int dummy_parameter>
+class VectorSlot {
public:
- explicit FeedbackVectorSlot(int id) : id_(id) {}
+ explicit VectorSlot(int id) : id_(id) {}
int ToInt() const { return id_; }
- static FeedbackVectorSlot Invalid() {
- return FeedbackVectorSlot(kInvalidSlot);
- }
+ static VectorSlot Invalid() { return VectorSlot(kInvalidSlot); }
bool IsInvalid() const { return id_ == kInvalidSlot; }
- FeedbackVectorSlot next() const {
+ VectorSlot next() const {
DCHECK(id_ != kInvalidSlot);
- return FeedbackVectorSlot(id_ + 1);
+ return VectorSlot(id_ + 1);
}
+ bool operator==(const VectorSlot& other) const { return id_ == other.id_; }
+
private:
static const int kInvalidSlot = -1;
@@ -973,6 +974,10 @@ class FeedbackVectorSlot {
};
+typedef VectorSlot<0> FeedbackVectorSlot;
+typedef VectorSlot<1> FeedbackVectorICSlot;
+
+
class BailoutId {
public:
explicit BailoutId(int id) : id_(id) { }
« no previous file with comments | « src/types.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698