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 3964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3975 Object* Initialize(int capacity); | 3975 Object* Initialize(int capacity); |
3976 | 3976 |
3977 // Set the content of the array to the content of storage. | 3977 // Set the content of the array to the content of storage. |
3978 inline void SetContent(FixedArray* storage); | 3978 inline void SetContent(FixedArray* storage); |
3979 | 3979 |
3980 // Casting. | 3980 // Casting. |
3981 static inline JSArray* cast(Object* obj); | 3981 static inline JSArray* cast(Object* obj); |
3982 | 3982 |
3983 // Uses handles. Ensures that the fixed array backing the JSArray has at | 3983 // Uses handles. Ensures that the fixed array backing the JSArray has at |
3984 // least the stated size. | 3984 // least the stated size. |
3985 void EnsureSize(int minimum_size_of_backing_fixed_array); | 3985 inline void EnsureSize(int minimum_size_of_backing_fixed_array); |
3986 | 3986 |
3987 // Dispatched behavior. | 3987 // Dispatched behavior. |
3988 #ifdef DEBUG | 3988 #ifdef DEBUG |
3989 void JSArrayPrint(); | 3989 void JSArrayPrint(); |
3990 void JSArrayVerify(); | 3990 void JSArrayVerify(); |
3991 #endif | 3991 #endif |
3992 | 3992 |
3993 // Layout description. | 3993 // Layout description. |
3994 static const int kLengthOffset = JSObject::kHeaderSize; | 3994 static const int kLengthOffset = JSObject::kHeaderSize; |
3995 static const int kSize = kLengthOffset + kPointerSize; | 3995 static const int kSize = kLengthOffset + kPointerSize; |
3996 | 3996 |
3997 private: | 3997 private: |
| 3998 // Expand the fixed array backing of a fast-case JSArray to at least |
| 3999 // the requested size. |
| 4000 void Expand(int minimum_size_of_backing_fixed_array); |
| 4001 |
3998 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 4002 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
3999 }; | 4003 }; |
4000 | 4004 |
4001 | 4005 |
4002 // An accessor must have a getter, but can have no setter. | 4006 // An accessor must have a getter, but can have no setter. |
4003 // | 4007 // |
4004 // When setting a property, V8 searches accessors in prototypes. | 4008 // When setting a property, V8 searches accessors in prototypes. |
4005 // If an accessor was found and it does not have a setter, | 4009 // If an accessor was found and it does not have a setter, |
4006 // the request is ignored. | 4010 // the request is ignored. |
4007 // | 4011 // |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4444 } else { | 4448 } else { |
4445 value &= ~(1 << bit_position); | 4449 value &= ~(1 << bit_position); |
4446 } | 4450 } |
4447 return value; | 4451 return value; |
4448 } | 4452 } |
4449 }; | 4453 }; |
4450 | 4454 |
4451 } } // namespace v8::internal | 4455 } } // namespace v8::internal |
4452 | 4456 |
4453 #endif // V8_OBJECTS_H_ | 4457 #endif // V8_OBJECTS_H_ |
OLD | NEW |