| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 // Factory method for creating empty vectors. | 322 // Factory method for creating empty vectors. |
| 323 static Vector<T> empty() { return Vector<T>(NULL, 0); } | 323 static Vector<T> empty() { return Vector<T>(NULL, 0); } |
| 324 | 324 |
| 325 private: | 325 private: |
| 326 T* start_; | 326 T* start_; |
| 327 int length_; | 327 int length_; |
| 328 }; | 328 }; |
| 329 | 329 |
| 330 | 330 |
| 331 template <typename T, int size> | 331 template <typename T, int kSize> |
| 332 class EmbeddedVector : public Vector<T> { | 332 class EmbeddedVector : public Vector<T> { |
| 333 public: | 333 public: |
| 334 EmbeddedVector() : Vector<T>(buffer_, size) { } | 334 EmbeddedVector() : Vector<T>(buffer_, kSize) { } |
| 335 private: | 335 private: |
| 336 T buffer_[size]; | 336 T buffer_[kSize]; |
| 337 }; | 337 }; |
| 338 | 338 |
| 339 | 339 |
| 340 inline Vector<const char> CStrVector(const char* data) { | 340 inline Vector<const char> CStrVector(const char* data) { |
| 341 return Vector<const char>(data, strlen(data)); | 341 return Vector<const char>(data, strlen(data)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 inline Vector<char> MutableCStrVector(char* data) { | 344 inline Vector<char> MutableCStrVector(char* data) { |
| 345 return Vector<char>(data, strlen(data)); | 345 return Vector<char>(data, strlen(data)); |
| 346 } | 346 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 int position_; | 439 int position_; |
| 440 | 440 |
| 441 bool is_finalized() const { return position_ < 0; } | 441 bool is_finalized() const { return position_ < 0; } |
| 442 | 442 |
| 443 DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); | 443 DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); |
| 444 }; | 444 }; |
| 445 | 445 |
| 446 } } // namespace v8::internal | 446 } } // namespace v8::internal |
| 447 | 447 |
| 448 #endif // V8_UTILS_H_ | 448 #endif // V8_UTILS_H_ |
| OLD | NEW |