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 | |
2373 // This constant applies only to the initial map of "global.Object" and | 2369 // This constant applies only to the initial map of "global.Object" and |
2374 // not to arbitrary other JSObject maps. | 2370 // not to arbitrary other JSObject maps. |
2375 static const int kInitialGlobalObjectUnusedPropertiesCount = 4; | 2371 static const int kInitialGlobalObjectUnusedPropertiesCount = 4; |
2376 | 2372 |
2377 static const int kMaxInstanceSize = 255 * kPointerSize; | 2373 static const int kMaxInstanceSize = 255 * kPointerSize; |
2378 // When extending the backing storage for property values, we increase | 2374 // When extending the backing storage for property values, we increase |
2379 // its size by more than the 1 entry necessary, so sequentially adding fields | 2375 // its size by more than the 1 entry necessary, so sequentially adding fields |
2380 // to the same object requires fewer allocations and copies. | 2376 // to the same object requires fewer allocations and copies. |
2381 static const int kFieldsAdded = 3; | 2377 static const int kFieldsAdded = 3; |
2382 | 2378 |
(...skipping 7652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10035 DECLARE_PRINTER(JSArray) | 10031 DECLARE_PRINTER(JSArray) |
10036 DECLARE_VERIFIER(JSArray) | 10032 DECLARE_VERIFIER(JSArray) |
10037 | 10033 |
10038 // Number of element slots to pre-allocate for an empty array. | 10034 // Number of element slots to pre-allocate for an empty array. |
10039 static const int kPreallocatedArrayElements = 4; | 10035 static const int kPreallocatedArrayElements = 4; |
10040 | 10036 |
10041 // Layout description. | 10037 // Layout description. |
10042 static const int kLengthOffset = JSObject::kHeaderSize; | 10038 static const int kLengthOffset = JSObject::kHeaderSize; |
10043 static const int kSize = kLengthOffset + kPointerSize; | 10039 static const int kSize = kLengthOffset + kPointerSize; |
10044 | 10040 |
| 10041 // Note that Page::kMaxRegularHeapObjectSize puts a limit on |
| 10042 // permissible values (see the DCHECK in heap.cc). |
| 10043 static const int kInitialMaxFastElementArray = 100000; |
| 10044 |
10045 private: | 10045 private: |
10046 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10046 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
10047 }; | 10047 }; |
10048 | 10048 |
10049 | 10049 |
10050 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10050 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
10051 Handle<Map> initial_map); | 10051 Handle<Map> initial_map); |
10052 | 10052 |
10053 | 10053 |
10054 // JSRegExpResult is just a JSArray with a specific initial map. | 10054 // JSRegExpResult is just a JSArray with a specific initial map. |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10670 Handle<FixedArray> keys_; | 10670 Handle<FixedArray> keys_; |
10671 Handle<OrderedHashSet> set_; | 10671 Handle<OrderedHashSet> set_; |
10672 int length_; | 10672 int length_; |
10673 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10673 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
10674 }; | 10674 }; |
10675 | 10675 |
10676 } // NOLINT, false-positive due to second-order macros. | 10676 } // NOLINT, false-positive due to second-order macros. |
10677 } // NOLINT, false-positive due to second-order macros. | 10677 } // NOLINT, false-positive due to second-order macros. |
10678 | 10678 |
10679 #endif // V8_OBJECTS_H_ | 10679 #endif // V8_OBJECTS_H_ |
OLD | NEW |