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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 ASSERT(length == 0 || (length > 0 && data != NULL)); | 412 ASSERT(length == 0 || (length > 0 && data != NULL)); |
413 } | 413 } |
414 | 414 |
415 static Vector<T> New(int length) { | 415 static Vector<T> New(int length) { |
416 return Vector<T>(NewArray<T>(length), length); | 416 return Vector<T>(NewArray<T>(length), length); |
417 } | 417 } |
418 | 418 |
419 // Returns a vector using the same backing storage as this one, | 419 // Returns a vector using the same backing storage as this one, |
420 // spanning from and including 'from', to but not including 'to'. | 420 // spanning from and including 'from', to but not including 'to'. |
421 Vector<T> SubVector(int from, int to) { | 421 Vector<T> SubVector(int from, int to) { |
422 ASSERT(to <= length_); | 422 SLOW_ASSERT(to <= length_); |
423 ASSERT(from < to); | 423 SLOW_ASSERT(from < to); |
424 ASSERT(0 <= from); | 424 ASSERT(0 <= from); |
425 return Vector<T>(start() + from, to - from); | 425 return Vector<T>(start() + from, to - from); |
426 } | 426 } |
427 | 427 |
428 // Returns the length of the vector. | 428 // Returns the length of the vector. |
429 int length() const { return length_; } | 429 int length() const { return length_; } |
430 | 430 |
431 // Returns whether or not the vector is empty. | 431 // Returns whether or not the vector is empty. |
432 bool is_empty() const { return length_ == 0; } | 432 bool is_empty() const { return length_ == 0; } |
433 | 433 |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 | 1135 |
1136 // Every compiled stub starts with this id. | 1136 // Every compiled stub starts with this id. |
1137 static const int kStubEntryId = 5; | 1137 static const int kStubEntryId = 5; |
1138 | 1138 |
1139 int id_; | 1139 int id_; |
1140 }; | 1140 }; |
1141 | 1141 |
1142 } } // namespace v8::internal | 1142 } } // namespace v8::internal |
1143 | 1143 |
1144 #endif // V8_UTILS_H_ | 1144 #endif // V8_UTILS_H_ |
OLD | NEW |