diff options
author | isaacs <i@izs.me> | 2012-09-18 15:20:38 -0700 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-09-21 01:52:24 +0200 |
commit | 3411a03dd114d635800cc50749d2351cd734eb2a (patch) | |
tree | 0ba1e52ab2236286894b33400302181ece91b63a /deps/v8/src/utils.h | |
parent | cc1b09d6b7c3cc6b8729804cbf644634ba5d0815 (diff) | |
download | node-3411a03dd114d635800cc50749d2351cd734eb2a.tar.gz |
V8: Upgrade to 3.13.7.1
Diffstat (limited to 'deps/v8/src/utils.h')
-rw-r--r-- | deps/v8/src/utils.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/deps/v8/src/utils.h b/deps/v8/src/utils.h index f116c14db..dc3a171c8 100644 --- a/deps/v8/src/utils.h +++ b/deps/v8/src/utils.h @@ -248,6 +248,7 @@ class BitField { // bitfield without compiler warnings we have to compute 2^32 without // using a shift count of 32. static const uint32_t kMask = ((1U << shift) << size) - (1U << shift); + static const uint32_t kShift = shift; // Value for the field with all bits set. static const T kMax = static_cast<T>((1U << size) - 1); @@ -980,6 +981,52 @@ class EnumSet { T bits_; }; + +class TypeFeedbackId { + public: + explicit TypeFeedbackId(int id) : id_(id) { } + int ToInt() const { return id_; } + + static TypeFeedbackId None() { return TypeFeedbackId(kNoneId); } + bool IsNone() const { return id_ == kNoneId; } + + private: + static const int kNoneId = -1; + + int id_; +}; + + +class BailoutId { + public: + explicit BailoutId(int id) : id_(id) { } + int ToInt() const { return id_; } + + static BailoutId None() { return BailoutId(kNoneId); } + static BailoutId FunctionEntry() { return BailoutId(kFunctionEntryId); } + static BailoutId Declarations() { return BailoutId(kDeclarationsId); } + static BailoutId FirstUsable() { return BailoutId(kFirstUsableId); } + + bool IsNone() const { return id_ == kNoneId; } + bool operator==(const BailoutId& other) const { return id_ == other.id_; } + + private: + static const int kNoneId = -1; + + // Using 0 could disguise errors. + static const int kFunctionEntryId = 2; + + // This AST id identifies the point after the declarations have been visited. + // We need it to capture the environment effects of declarations that emit + // code (function declarations). + static const int kDeclarationsId = 3; + + // Ever FunctionState starts with this id. + static const int kFirstUsableId = 4; + + int id_; +}; + } } // namespace v8::internal #endif // V8_UTILS_H_ |