| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 void AddDecimalInteger(int value); | 883 void AddDecimalInteger(int value); |
| 884 | 884 |
| 885 // Finalize the string by 0-terminating it and returning the buffer. | 885 // Finalize the string by 0-terminating it and returning the buffer. |
| 886 char* Finalize(); | 886 char* Finalize(); |
| 887 | 887 |
| 888 protected: | 888 protected: |
| 889 Vector<char> buffer_; | 889 Vector<char> buffer_; |
| 890 int position_; | 890 int position_; |
| 891 | 891 |
| 892 bool is_finalized() const { return position_ < 0; } | 892 bool is_finalized() const { return position_ < 0; } |
| 893 |
| 893 private: | 894 private: |
| 894 DISALLOW_IMPLICIT_CONSTRUCTORS(SimpleStringBuilder); | 895 DISALLOW_IMPLICIT_CONSTRUCTORS(SimpleStringBuilder); |
| 895 }; | 896 }; |
| 896 | 897 |
| 897 | 898 |
| 898 // A poor man's version of STL's bitset: A bit set of enums E (without explicit | 899 // A poor man's version of STL's bitset: A bit set of enums E (without explicit |
| 899 // values), fitting into an integral type T. | 900 // values), fitting into an integral type T. |
| 900 template <class E, class T = int> | 901 template <class E, class T = int> |
| 901 class EnumSet { | 902 class EnumSet { |
| 902 public: | 903 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 914 ASSERT(element < static_cast<int>(sizeof(T) * CHAR_BIT)); | 915 ASSERT(element < static_cast<int>(sizeof(T) * CHAR_BIT)); |
| 915 return 1 << element; | 916 return 1 << element; |
| 916 } | 917 } |
| 917 | 918 |
| 918 T bits_; | 919 T bits_; |
| 919 }; | 920 }; |
| 920 | 921 |
| 921 } } // namespace v8::internal | 922 } } // namespace v8::internal |
| 922 | 923 |
| 923 #endif // V8_UTILS_H_ | 924 #endif // V8_UTILS_H_ |
| OLD | NEW |