OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_UTILS_H_ | 5 #ifndef V8_UTILS_H_ |
6 #define V8_UTILS_H_ | 6 #define V8_UTILS_H_ |
7 | 7 |
8 #include <limits.h> | 8 #include <limits.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 explicit EmbeddedVector(T initial_value) : Vector<T>(buffer_, kSize) { | 418 explicit EmbeddedVector(T initial_value) : Vector<T>(buffer_, kSize) { |
419 for (int i = 0; i < kSize; ++i) { | 419 for (int i = 0; i < kSize; ++i) { |
420 buffer_[i] = initial_value; | 420 buffer_[i] = initial_value; |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 // When copying, make underlying Vector to reference our buffer. | 424 // When copying, make underlying Vector to reference our buffer. |
425 EmbeddedVector(const EmbeddedVector& rhs) | 425 EmbeddedVector(const EmbeddedVector& rhs) |
426 : Vector<T>(rhs) { | 426 : Vector<T>(rhs) { |
427 MemCopy(buffer_, rhs.buffer_, sizeof(T) * kSize); | 427 MemCopy(buffer_, rhs.buffer_, sizeof(T) * kSize); |
428 set_start(buffer_); | 428 this->set_start(buffer_); |
429 } | 429 } |
430 | 430 |
431 EmbeddedVector& operator=(const EmbeddedVector& rhs) { | 431 EmbeddedVector& operator=(const EmbeddedVector& rhs) { |
432 if (this == &rhs) return *this; | 432 if (this == &rhs) return *this; |
433 Vector<T>::operator=(rhs); | 433 Vector<T>::operator=(rhs); |
434 MemCopy(buffer_, rhs.buffer_, sizeof(T) * kSize); | 434 MemCopy(buffer_, rhs.buffer_, sizeof(T) * kSize); |
435 this->set_start(buffer_); | 435 this->set_start(buffer_); |
436 return *this; | 436 return *this; |
437 } | 437 } |
438 | 438 |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 } | 1531 } |
1532 | 1532 |
1533 *index = result; | 1533 *index = result; |
1534 return true; | 1534 return true; |
1535 } | 1535 } |
1536 | 1536 |
1537 | 1537 |
1538 } } // namespace v8::internal | 1538 } } // namespace v8::internal |
1539 | 1539 |
1540 #endif // V8_UTILS_H_ | 1540 #endif // V8_UTILS_H_ |
OLD | NEW |