| 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 10010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10021 static Handle<Object> SetElementsLength(Handle<JSArray> array, | 10021 static Handle<Object> SetElementsLength(Handle<JSArray> array, |
| 10022 Handle<Object> length); | 10022 Handle<Object> length); |
| 10023 | 10023 |
| 10024 // Set the content of the array to the content of storage. | 10024 // Set the content of the array to the content of storage. |
| 10025 static inline void SetContent(Handle<JSArray> array, | 10025 static inline void SetContent(Handle<JSArray> array, |
| 10026 Handle<FixedArrayBase> storage); | 10026 Handle<FixedArrayBase> storage); |
| 10027 | 10027 |
| 10028 // Casting. | 10028 // Casting. |
| 10029 static inline JSArray* cast(Object* obj); | 10029 static inline JSArray* cast(Object* obj); |
| 10030 | 10030 |
| 10031 // Uses handles. Ensures that the fixed array backing the JSArray has at | 10031 // Ensures that the fixed array backing the JSArray has at |
| 10032 // least the stated size. | 10032 // least the stated size. |
| 10033 inline void EnsureSize(int minimum_size_of_backing_fixed_array); | 10033 static inline void EnsureSize(Handle<JSArray> array, |
| 10034 int minimum_size_of_backing_fixed_array); |
| 10035 |
| 10036 // Expand the fixed array backing of a fast-case JSArray to at least |
| 10037 // the requested size. |
| 10038 static void Expand(Handle<JSArray> array, |
| 10039 int minimum_size_of_backing_fixed_array); |
| 10034 | 10040 |
| 10035 // Dispatched behavior. | 10041 // Dispatched behavior. |
| 10036 DECLARE_PRINTER(JSArray) | 10042 DECLARE_PRINTER(JSArray) |
| 10037 DECLARE_VERIFIER(JSArray) | 10043 DECLARE_VERIFIER(JSArray) |
| 10038 | 10044 |
| 10039 // Number of element slots to pre-allocate for an empty array. | 10045 // Number of element slots to pre-allocate for an empty array. |
| 10040 static const int kPreallocatedArrayElements = 4; | 10046 static const int kPreallocatedArrayElements = 4; |
| 10041 | 10047 |
| 10042 // Layout description. | 10048 // Layout description. |
| 10043 static const int kLengthOffset = JSObject::kHeaderSize; | 10049 static const int kLengthOffset = JSObject::kHeaderSize; |
| 10044 static const int kSize = kLengthOffset + kPointerSize; | 10050 static const int kSize = kLengthOffset + kPointerSize; |
| 10045 | 10051 |
| 10046 private: | 10052 private: |
| 10047 // Expand the fixed array backing of a fast-case JSArray to at least | |
| 10048 // the requested size. | |
| 10049 void Expand(int minimum_size_of_backing_fixed_array); | |
| 10050 | |
| 10051 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10053 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
| 10052 }; | 10054 }; |
| 10053 | 10055 |
| 10054 | 10056 |
| 10055 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10057 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
| 10056 Handle<Map> initial_map); | 10058 Handle<Map> initial_map); |
| 10057 | 10059 |
| 10058 | 10060 |
| 10059 // JSRegExpResult is just a JSArray with a specific initial map. | 10061 // JSRegExpResult is just a JSArray with a specific initial map. |
| 10060 // This initial map adds in-object properties for "index" and "input" | 10062 // This initial map adds in-object properties for "index" and "input" |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10786 } else { | 10788 } else { |
| 10787 value &= ~(1 << bit_position); | 10789 value &= ~(1 << bit_position); |
| 10788 } | 10790 } |
| 10789 return value; | 10791 return value; |
| 10790 } | 10792 } |
| 10791 }; | 10793 }; |
| 10792 | 10794 |
| 10793 } } // namespace v8::internal | 10795 } } // namespace v8::internal |
| 10794 | 10796 |
| 10795 #endif // V8_OBJECTS_H_ | 10797 #endif // V8_OBJECTS_H_ |
| OLD | NEW |