| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2359 static const uint32_t kMaxGap = 1024; | 2359 static const uint32_t kMaxGap = 1024; |
| 2360 | 2360 |
| 2361 // Maximal length of fast elements array that won't be checked for | 2361 // Maximal length of fast elements array that won't be checked for |
| 2362 // being dense enough on expansion. | 2362 // being dense enough on expansion. |
| 2363 static const int kMaxUncheckedFastElementsLength = 5000; | 2363 static const int kMaxUncheckedFastElementsLength = 5000; |
| 2364 | 2364 |
| 2365 // Same as above but for old arrays. This limit is more strict. We | 2365 // Same as above but for old arrays. This limit is more strict. We |
| 2366 // don't want to be wasteful with long lived objects. | 2366 // don't want to be wasteful with long lived objects. |
| 2367 static const int kMaxUncheckedOldFastElementsLength = 500; | 2367 static const int kMaxUncheckedOldFastElementsLength = 500; |
| 2368 | 2368 |
| 2369 // Note that Page::kMaxRegularHeapObjectSize puts a limit on |
| 2370 // permissible values (see the DCHECK in heap.cc). |
| 2371 static const int kInitialMaxFastElementArray = 100000; |
| 2372 |
| 2369 // This constant applies only to the initial map of "global.Object" and | 2373 // This constant applies only to the initial map of "global.Object" and |
| 2370 // not to arbitrary other JSObject maps. | 2374 // not to arbitrary other JSObject maps. |
| 2371 static const int kInitialGlobalObjectUnusedPropertiesCount = 4; | 2375 static const int kInitialGlobalObjectUnusedPropertiesCount = 4; |
| 2372 | 2376 |
| 2373 static const int kMaxInstanceSize = 255 * kPointerSize; | 2377 static const int kMaxInstanceSize = 255 * kPointerSize; |
| 2374 // When extending the backing storage for property values, we increase | 2378 // When extending the backing storage for property values, we increase |
| 2375 // its size by more than the 1 entry necessary, so sequentially adding fields | 2379 // its size by more than the 1 entry necessary, so sequentially adding fields |
| 2376 // to the same object requires fewer allocations and copies. | 2380 // to the same object requires fewer allocations and copies. |
| 2377 static const int kFieldsAdded = 3; | 2381 static const int kFieldsAdded = 3; |
| 2378 | 2382 |
| (...skipping 7646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10025 DECLARE_PRINTER(JSArray) | 10029 DECLARE_PRINTER(JSArray) |
| 10026 DECLARE_VERIFIER(JSArray) | 10030 DECLARE_VERIFIER(JSArray) |
| 10027 | 10031 |
| 10028 // Number of element slots to pre-allocate for an empty array. | 10032 // Number of element slots to pre-allocate for an empty array. |
| 10029 static const int kPreallocatedArrayElements = 4; | 10033 static const int kPreallocatedArrayElements = 4; |
| 10030 | 10034 |
| 10031 // Layout description. | 10035 // Layout description. |
| 10032 static const int kLengthOffset = JSObject::kHeaderSize; | 10036 static const int kLengthOffset = JSObject::kHeaderSize; |
| 10033 static const int kSize = kLengthOffset + kPointerSize; | 10037 static const int kSize = kLengthOffset + kPointerSize; |
| 10034 | 10038 |
| 10035 // Note that Page::kMaxRegularHeapObjectSize puts a limit on | |
| 10036 // permissible values (see the DCHECK in heap.cc). | |
| 10037 static const int kInitialMaxFastElementArray = 100000; | |
| 10038 | |
| 10039 private: | 10039 private: |
| 10040 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10040 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
| 10041 }; | 10041 }; |
| 10042 | 10042 |
| 10043 | 10043 |
| 10044 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10044 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
| 10045 Handle<Map> initial_map); | 10045 Handle<Map> initial_map); |
| 10046 | 10046 |
| 10047 | 10047 |
| 10048 // JSRegExpResult is just a JSArray with a specific initial map. | 10048 // JSRegExpResult is just a JSArray with a specific initial map. |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10664 Handle<FixedArray> keys_; | 10664 Handle<FixedArray> keys_; |
| 10665 Handle<OrderedHashSet> set_; | 10665 Handle<OrderedHashSet> set_; |
| 10666 int length_; | 10666 int length_; |
| 10667 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10667 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
| 10668 }; | 10668 }; |
| 10669 | 10669 |
| 10670 } // NOLINT, false-positive due to second-order macros. | 10670 } // NOLINT, false-positive due to second-order macros. |
| 10671 } // NOLINT, false-positive due to second-order macros. | 10671 } // NOLINT, false-positive due to second-order macros. |
| 10672 | 10672 |
| 10673 #endif // V8_OBJECTS_H_ | 10673 #endif // V8_OBJECTS_H_ |
| OLD | NEW |