| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 4371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4382 // Uses handles. Ensures that the fixed array backing the JSArray has at | 4382 // Uses handles. Ensures that the fixed array backing the JSArray has at |
| 4383 // least the stated size. | 4383 // least the stated size. |
| 4384 inline void EnsureSize(int minimum_size_of_backing_fixed_array); | 4384 inline void EnsureSize(int minimum_size_of_backing_fixed_array); |
| 4385 | 4385 |
| 4386 // Dispatched behavior. | 4386 // Dispatched behavior. |
| 4387 #ifdef DEBUG | 4387 #ifdef DEBUG |
| 4388 void JSArrayPrint(); | 4388 void JSArrayPrint(); |
| 4389 void JSArrayVerify(); | 4389 void JSArrayVerify(); |
| 4390 #endif | 4390 #endif |
| 4391 | 4391 |
| 4392 // Number of element slots to pre-allocate for an empty array. |
| 4393 static const int kPreallocatedArrayElements = 4; |
| 4394 |
| 4392 // Layout description. | 4395 // Layout description. |
| 4393 static const int kLengthOffset = JSObject::kHeaderSize; | 4396 static const int kLengthOffset = JSObject::kHeaderSize; |
| 4394 static const int kSize = kLengthOffset + kPointerSize; | 4397 static const int kSize = kLengthOffset + kPointerSize; |
| 4395 | 4398 |
| 4396 private: | 4399 private: |
| 4397 // Expand the fixed array backing of a fast-case JSArray to at least | 4400 // Expand the fixed array backing of a fast-case JSArray to at least |
| 4398 // the requested size. | 4401 // the requested size. |
| 4399 void Expand(int minimum_size_of_backing_fixed_array); | 4402 void Expand(int minimum_size_of_backing_fixed_array); |
| 4400 | 4403 |
| 4401 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 4404 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4841 } else { | 4844 } else { |
| 4842 value &= ~(1 << bit_position); | 4845 value &= ~(1 << bit_position); |
| 4843 } | 4846 } |
| 4844 return value; | 4847 return value; |
| 4845 } | 4848 } |
| 4846 }; | 4849 }; |
| 4847 | 4850 |
| 4848 } } // namespace v8::internal | 4851 } } // namespace v8::internal |
| 4849 | 4852 |
| 4850 #endif // V8_OBJECTS_H_ | 4853 #endif // V8_OBJECTS_H_ |
| OLD | NEW |