| 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 bool operator!=(const EnumSet& set) { return bits_ != set.bits_; } | 1087 bool operator!=(const EnumSet& set) { return bits_ != set.bits_; } |
| 1088 EnumSet<E, T> operator|(const EnumSet& set) const { | 1088 EnumSet<E, T> operator|(const EnumSet& set) const { |
| 1089 return EnumSet<E, T>(bits_ | set.bits_); | 1089 return EnumSet<E, T>(bits_ | set.bits_); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 private: | 1092 private: |
| 1093 T Mask(E element) const { | 1093 T Mask(E element) const { |
| 1094 // The strange typing in ASSERT is necessary to avoid stupid warnings, see: | 1094 // The strange typing in ASSERT is necessary to avoid stupid warnings, see: |
| 1095 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680 | 1095 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680 |
| 1096 ASSERT(static_cast<int>(element) < static_cast<int>(sizeof(T) * CHAR_BIT)); | 1096 ASSERT(static_cast<int>(element) < static_cast<int>(sizeof(T) * CHAR_BIT)); |
| 1097 return 1 << element; | 1097 return static_cast<T>(1) << element; |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 T bits_; | 1100 T bits_; |
| 1101 }; | 1101 }; |
| 1102 | 1102 |
| 1103 // Bit field extraction. | 1103 // Bit field extraction. |
| 1104 inline uint32_t unsigned_bitextract_32(int msb, int lsb, uint32_t x) { | 1104 inline uint32_t unsigned_bitextract_32(int msb, int lsb, uint32_t x) { |
| 1105 return (x >> lsb) & ((1 << (1 + msb - lsb)) - 1); | 1105 return (x >> lsb) & ((1 << (1 + msb - lsb)) - 1); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 | 1206 |
| 1207 // Every compiled stub starts with this id. | 1207 // Every compiled stub starts with this id. |
| 1208 static const int kStubEntryId = 5; | 1208 static const int kStubEntryId = 5; |
| 1209 | 1209 |
| 1210 int id_; | 1210 int id_; |
| 1211 }; | 1211 }; |
| 1212 | 1212 |
| 1213 } } // namespace v8::internal | 1213 } } // namespace v8::internal |
| 1214 | 1214 |
| 1215 #endif // V8_UTILS_H_ | 1215 #endif // V8_UTILS_H_ |
| OLD | NEW |