| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 ASSERT(length == 0 || (length > 0 && data != NULL)); | 423 ASSERT(length == 0 || (length > 0 && data != NULL)); |
| 424 } | 424 } |
| 425 | 425 |
| 426 static Vector<T> New(int length) { | 426 static Vector<T> New(int length) { |
| 427 return Vector<T>(NewArray<T>(length), length); | 427 return Vector<T>(NewArray<T>(length), length); |
| 428 } | 428 } |
| 429 | 429 |
| 430 // Returns a vector using the same backing storage as this one, | 430 // Returns a vector using the same backing storage as this one, |
| 431 // spanning from and including 'from', to but not including 'to'. | 431 // spanning from and including 'from', to but not including 'to'. |
| 432 Vector<T> SubVector(int from, int to) { | 432 Vector<T> SubVector(int from, int to) { |
| 433 ASSERT(to <= length_); | 433 SLOW_ASSERT(to <= length_); |
| 434 ASSERT(from < to); | 434 SLOW_ASSERT(from < to); |
| 435 ASSERT(0 <= from); | 435 ASSERT(0 <= from); |
| 436 return Vector<T>(start() + from, to - from); | 436 return Vector<T>(start() + from, to - from); |
| 437 } | 437 } |
| 438 | 438 |
| 439 // Returns the length of the vector. | 439 // Returns the length of the vector. |
| 440 int length() const { return length_; } | 440 int length() const { return length_; } |
| 441 | 441 |
| 442 // Returns whether or not the vector is empty. | 442 // Returns whether or not the vector is empty. |
| 443 bool is_empty() const { return length_ == 0; } | 443 bool is_empty() const { return length_ == 0; } |
| 444 | 444 |
| (...skipping 761 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 |