| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 void Remove(const EnumSet& set) { bits_ &= ~set.bits_; } | 967 void Remove(const EnumSet& set) { bits_ &= ~set.bits_; } |
| 968 void RemoveAll() { bits_ = 0; } | 968 void RemoveAll() { bits_ = 0; } |
| 969 void Intersect(const EnumSet& set) { bits_ &= set.bits_; } | 969 void Intersect(const EnumSet& set) { bits_ &= set.bits_; } |
| 970 T ToIntegral() const { return bits_; } | 970 T ToIntegral() const { return bits_; } |
| 971 bool operator==(const EnumSet& set) { return bits_ == set.bits_; } | 971 bool operator==(const EnumSet& set) { return bits_ == set.bits_; } |
| 972 | 972 |
| 973 private: | 973 private: |
| 974 T Mask(E element) const { | 974 T Mask(E element) const { |
| 975 // The strange typing in ASSERT is necessary to avoid stupid warnings, see: | 975 // The strange typing in ASSERT is necessary to avoid stupid warnings, see: |
| 976 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680 | 976 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680 |
| 977 ASSERT(static_cast<int>(element) < static_cast<int>(sizeof(T) * CHAR_BIT)); | 977 ASSERT(element < static_cast<int>(sizeof(T) * CHAR_BIT)); |
| 978 return 1 << element; | 978 return 1 << element; |
| 979 } | 979 } |
| 980 | 980 |
| 981 T bits_; | 981 T bits_; |
| 982 }; | 982 }; |
| 983 | 983 |
| 984 | 984 |
| 985 class TypeFeedbackId { | 985 class TypeFeedbackId { |
| 986 public: | 986 public: |
| 987 explicit TypeFeedbackId(int id) : id_(id) { } | 987 explicit TypeFeedbackId(int id) : id_(id) { } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 | 1023 |
| 1024 // Ever FunctionState starts with this id. | 1024 // Ever FunctionState starts with this id. |
| 1025 static const int kFirstUsableId = 4; | 1025 static const int kFirstUsableId = 4; |
| 1026 | 1026 |
| 1027 int id_; | 1027 int id_; |
| 1028 }; | 1028 }; |
| 1029 | 1029 |
| 1030 } } // namespace v8::internal | 1030 } } // namespace v8::internal |
| 1031 | 1031 |
| 1032 #endif // V8_UTILS_H_ | 1032 #endif // V8_UTILS_H_ |
| OLD | NEW |